Douglas Blumeyer's RTT How-To: Difference between revisions
Cmloegcmluin (talk | contribs) |
Cmloegcmluin (talk | contribs) Wolfram Language update |
||
| Line 61: | Line 61: | ||
For another example, we can quickly find the fifth size for 12-EDO from its map, because 3/2 is {{vector|-1 1 0}}, and so {{map|12 19 28}}{{vector|-1 1 0}} = (12 × -1) + (19 × 1) = 7. Similarly, the major third — 5/4, or {{vector|-2 0 1}} — is simply 28 - 12 - 12 = 4. | For another example, we can quickly find the fifth size for 12-EDO from its map, because 3/2 is {{vector|-1 1 0}}, and so {{map|12 19 28}}{{vector|-1 1 0}} = (12 × -1) + (19 × 1) = 7. Similarly, the major third — 5/4, or {{vector|-2 0 1}} — is simply 28 - 12 - 12 = 4. | ||
Throughout this article I will be referring to examples implemented in [https://www.wolfram.com/language/ Wolfram Language] (formerly Mathematica), a popular and capable programming language for working with math. If you're interested | Throughout this article I will be referring to examples implemented in [https://www.wolfram.com/language/ Wolfram Language] (formerly Mathematica), a popular and capable programming language for working with math. I encourage you to try them out, to get a feel for things in another way, and get yourself started exploring temperaments yourself! If you're interested, you can run them right on the web without downloading or setting anything up on your computer: just go to https://www.wolframcloud.com, sign up for free, create a new computational notebook, paste in the contents from [https://github.com/cmloegcmluin/RTT/blob/main/main.nb this file], and Shift+Enter to run it, which will load up all the functions. Then open a new tab to use them; you'll be computing in no time. (And of course you're encouraged to look over the implementations of the functions if that may help you.) FYI, any notebook you create has a lifespan of 60 days before Wolfram Cloud will recycle it, so you'll have to copy and paste them to new notebooks or wherever if you don't want to lose your work.<ref>It's not as simple as select-all, copy, paste, because of how computational notebooks can (and should) be broken down into many cells. However there is a handy way to copy all cells, including all of each of their output: just click in the top right to select the first cell (it should highlight along the right edge in blue), then shift-click the same area but for the bottom cell, copy, and paste. Voilà!</ref> | ||
If, on the other hand, you're not interested in code examples, that's no big deal. They're not necessary to follow along. | If, on the other hand, you're not interested in code examples, that's no big deal. They're not necessary to follow along. | ||
| Line 67: | Line 67: | ||
So here's the first: | So here's the first: | ||
<nowiki>In: {12,19,28}.{-1,1,0} | |||
Out: 7</nowiki> | |||
Wolfram's syntax is a bit different than what we use in RTT, which can take a little getting used to. As you can see here, both our vector and covector use the same curly brackets instead of angle and square brackets. This is a very simple example, though, and the actual difference between RTT and Wolfram syntax gets more complicated than just replacing all brackets with curlies; but we won't have to worry about that for a while. | Wolfram Language's syntax is a bit different than what we use in RTT, which can take a little getting used to. As you can see here, both our vector and covector use the same curly brackets instead of angle and square brackets. This is a very simple example, though, and the actual difference between RTT and Wolfram Language syntax gets more complicated than just replacing all brackets with curlies; but we won't have to worry about that for a while. | ||
=== tempering out commas === | === tempering out commas === | ||
| Line 610: | Line 605: | ||
And ta-da! You’ve found a mapping from a comma-basis, and it is {{ket|{{map|19 30 44}}}}. In other words, for this temperament, you have converted a basis for its null-space to a row-basis for its mapping row-space. Feel free to try this with any other combination of two commas tempered out by this mapping-row. | And ta-da! You’ve found a mapping from a comma-basis, and it is {{ket|{{map|19 30 44}}}}. In other words, for this temperament, you have converted a basis for its null-space to a row-basis for its mapping row-space. Feel free to try this with any other combination of two commas tempered out by this mapping-row. | ||
So why the anti-transpose sandwich? What we (and everyone) want in a mapping is to have a triangle of zeros in the bottom left corner. What we want in a comma-basis is also to have a triangle of zeros in the bottom left corner. But the comma-basis is on the other side of duality from the mapping, so it must be transposed before we can apply our | So why the anti-transpose sandwich? What we (and everyone) want in a mapping is to have a triangle of zeros in the bottom left corner. What we want in a comma-basis is also to have a triangle of zeros in the bottom left corner. But the comma-basis is on the other side of duality from the mapping, so it must be transposed before we can apply our null-space-basis finding process to it, because that process is designed for mappings. But when we transpose the comma-basis we end up with the triangle of zeros in the top right. If we take the null-space of that and then transpose it back again, we don't get a nice form of the mapping, we get a mapping with a triangle of zeros in the top right. The way to fix this is to anti-transpose instead of transpose, before and after taking the null-space. Because when you anti-transpose the comma-basis, you still turn columns into rows, but this time the triangle of zeros stays on the bottom left. | ||
Let's try it out in Wolfram Language: | |||
<nowiki>In: antiNullSpaceBasis[{{-4,4,-1},{-10,-1,5}}] | |||
Out: {{19,30,44}}</nowiki> | |||
Note that this time we used two sets of curlies around our numbers. That's because these are not technically vectors and covectors, but matrices now. A matrix can be thought of as a list of lists. The comma-basis here is a list of two lists. The output mapping is a list with only one list in it. | |||
Now the null-space function, to take you from {{ket|{{map|19 30 44}}}} back to the matrix, is pretty much the same thing, but simpler! No need to anti-transpose. Just start at the augmentation step: | Now the null-space function, to take you from {{ket|{{map|19 30 44}}}} back to the matrix, is pretty much the same thing, but simpler! No need to anti-transpose. Just start at the augmentation step: | ||
| Line 698: | Line 680: | ||
So that’s not any of the commas we’ve looked at so far (it’s the [[19-comma]] and the [[acute limma]]). But it is clear to see that either of them would be tempered out by 19-ET (no need to map by hand — just look at these commas side-by-side with the mapping-row {{ket|{{map|19 30 44}}}} and it should be apparent). We're done! | So that’s not any of the commas we’ve looked at so far (it’s the [[19-comma]] and the [[acute limma]]). But it is clear to see that either of them would be tempered out by 19-ET (no need to map by hand — just look at these commas side-by-side with the mapping-row {{ket|{{map|19 30 44}}}} and it should be apparent). We're done! | ||
And let's try that one in Wolfram Language, too: | |||
<nowiki>In: nullSpaceBasis[{{19,30,44}}] | |||
Out: {{-44,0,19},{-30,19,0}} | |||
</nowiki> | |||
So we've gotten right back where we've started. | |||
The RTT library for Wolfram Language includes a function called <code>dual[]</code>. This will give you the comma-basis for a mapping, or the mapping for a comma-basis, depending on which you put it. There's a catch, though. You have to tell it which type you're putting in! Otherwise it can't tell the difference. And of course it needs to know whether or not it needs to do an anti-transpose sandwich. So here's how we provide that: | |||
<nowiki>In: dual[{{{19,30,44}},"mapping"}] | |||
Out: {{{-44,0,19},{-30,19,0}},"comma-basis"} | |||
In: dual[{{{-4,4,-1},{-10,-1,5}},"comma-basis"}] | |||
Out: {{{19,30,44}},"mapping"}</nowiki> | |||
Note that we're now using a data structure which is an ordered pair: the first entry is the matrix, and the second entry is a string which says which type of matrix it is. | |||
It's great to have Wolfram and other such tools to compute these things for us, once we understand them. But I think it’s a very good idea to work through these operations by hand at least a couple times, to demystify them and give you a feel for them. | It's great to have Wolfram and other such tools to compute these things for us, once we understand them. But I think it’s a very good idea to work through these operations by hand at least a couple times, to demystify them and give you a feel for them. | ||
| Line 1,019: | Line 1,010: | ||
</math> | </math> | ||
Let's try it out in Wolfram Language: | |||
<nowiki>In: nullSpaceBasis[{{12,19}}] | |||
Out: {{-19, 12}} | |||
</nowiki> | |||
Unsurprisingly, the comma is {{vector|-19 12}}, the compton comma. Basically, any comma we could temper out in 3-limit JI is going to be obvious from the ET’s map. Another option would be the blackwood comma, {{vector|-8 5}} tempered out in 5-ET, {{map|5 8}}. Exciting stuff! Okay, not really. But good to ground yourself with. | Unsurprisingly, the comma is {{vector|-19 12}}, the compton comma. Basically, any comma we could temper out in 3-limit JI is going to be obvious from the ET’s map. Another option would be the blackwood comma, {{vector|-8 5}} tempered out in 5-ET, {{map|5 8}}. Exciting stuff! Okay, not really. But good to ground yourself with. | ||
| Line 1,108: | Line 1,097: | ||
So if you take the canonical form of {{ket|{{map|5 8 12}} {{map|7 11 16}}}}, that’s what you get. It’s also what you get if you take the canonical form of {{ket|{{map|12 19 28}} {{map|19 30 44}}}}, or any equivalent other mapping-row-basis. That’s the power of canonicalization. | So if you take the canonical form of {{ket|{{map|5 8 12}} {{map|7 11 16}}}}, that’s what you get. It’s also what you get if you take the canonical form of {{ket|{{map|12 19 28}} {{map|19 30 44}}}}, or any equivalent other mapping-row-basis. That’s the power of canonicalization. | ||
Let's try it out in Wolfram Language: | |||
<nowiki>In: canonicalForm[{{{5,8,12},{7,11,16}},"mapping"}] | |||
Out: {{{1,0,-4},{0,1,4}},"mapping"}</nowiki> | |||
Canonical form can be done by hand, but it's a bit involved, because it requires first [[defactoring]] and then putting into [[Hermite Normal Form]]. I've demonstrated how to do these processes at the links provided. | Canonical form can be done by hand, but it's a bit involved, because it requires first [[defactoring]] and then putting into [[Hermite Normal Form]]. I've demonstrated how to do these processes at the links provided. | ||