Defactoring: Difference between revisions
Cmloegcmluin (talk | contribs) link to failed methods |
Cmloegcmluin (talk | contribs) fix bad vector and map templates |
||
| Line 9: | Line 9: | ||
A mapping is enfactored if linear combinations of its rows can produce another row whose elements have a common factor (other than 1).<ref>The counts of rows that are being linearly combined in this way to check for enfactoring may not share a common factor (again, other than 1), or else enfactoring would be introduced.</ref> | A mapping is enfactored if linear combinations of its rows can produce another row whose elements have a common factor (other than 1).<ref>The counts of rows that are being linearly combined in this way to check for enfactoring may not share a common factor (again, other than 1), or else enfactoring would be introduced.</ref> | ||
For example, {{ | For example, {{ket|{{map|3 0 -1}} {{map|0 3 5}}}} is enfactored, because {{map|3 0 -1}} - {{map|0 3 5}} = {{map|3 -3 -6}}, which has a common factor of 3. | ||
This definition includes mappings whose rows themselves include a common factor, such as {{ | This definition includes mappings whose rows themselves include a common factor, such as {{ket|{{map|24 38 56}}}}, which already has a clearly visible common factor of 2. | ||
= motivation = | = motivation = | ||
| Line 40: | Line 40: | ||
sage: S.index_in_saturation()<br> | sage: S.index_in_saturation()<br> | ||
1<br></span><br> | 1<br></span><br> | ||
Indeed 18 is the common factor in {{ | Indeed 18 is the common factor in {{ket|{{map|11 16 21}} {{map|19 26 33}}}}.</ref>. We think we should avoid propagating Sage's decision to overload matrix saturation with a second meaning. | ||
# Furthermore, there is another common but conflicting sense of saturation for matrices which clamps entry values to between -1 and 1<ref>See https://math.stackexchange.com/questions/1964814/linear-transformation-of-a-saturated-vector and https://faculty.uml.edu//thu/tcs01-june.pdf</ref>. | # Furthermore, there is another common but conflicting sense of saturation for matrices which clamps entry values to between -1 and 1<ref>See https://math.stackexchange.com/questions/1964814/linear-transformation-of-a-saturated-vector and https://faculty.uml.edu//thu/tcs01-june.pdf</ref>. | ||
| Line 77: | Line 77: | ||
First, let's look at an defactored mapping. This example temperament is so simple that it is not of practical musical interest. It was chosen because it's basically the numerically simplest possible example, where this type of simplicity empowers us to visualize the problem at a practical scale as clearly as possible. Please consider the diagram at right. | First, let's look at an defactored mapping. This example temperament is so simple that it is not of practical musical interest. It was chosen because it's basically the numerically simplest possible example, where this type of simplicity empowers us to visualize the problem at a practical scale as clearly as possible. Please consider the diagram at right. | ||
This is a representation of 2-ET, a 3-limit, rank-1 (equal) temperament, with mapping {{ | This is a representation of 2-ET, a 3-limit, rank-1 (equal) temperament, with mapping {{ket|{{map|2 3}}}}, meaning it has a single generator which takes two steps to reach the octave, and three steps to reach the tritave. This temperament tempers out a single comma, whose vector representation looks similar to the mapping: {{vector|-3 2}}, AKA 9/8. And so the comma-basis for this temperament is {{bra|{{vector|-3 2}}}}. | ||
We can imagine that we started out with a JI lattice, where movement up and down correspond to prime 2 (the octave) and movements right and left correspond to prime 3 (the tritave). We have tempered JI here, and so we've faded the JI lattice out to a faint grey color in the background. What we've done specifically is tempered out the comma {{vector|-3 2}} so that any nodes in this lattice which are 2 over and 3 up from each other are equivalent. Therefore we only need to consider a thin swath of the lattice anymore, specifically, a swath which connects the origin {{vector|0 0}}, AKA 1/1, to {{vector|-3 2}}, and then runs perpendicularly to infinity in either direction. | We can imagine that we started out with a JI lattice, where movement up and down correspond to prime 2 (the octave) and movements right and left correspond to prime 3 (the tritave). We have tempered JI here, and so we've faded the JI lattice out to a faint grey color in the background. What we've done specifically is tempered out the comma {{vector|-3 2}} so that any nodes in this lattice which are 2 over and 3 up from each other are equivalent. Therefore we only need to consider a thin swath of the lattice anymore, specifically, a swath which connects the origin {{vector|0 0}}, AKA 1/1, to {{vector|-3 2}}, and then runs perpendicularly to infinity in either direction. | ||
| Line 101: | Line 101: | ||
[[File:2-enfactored mapping.png|365px|thumb|right|A 2-enfactored mapping represents a temperoid for which every other step of its generator lands on a pitch which no JI interval would ever temper to.]] | [[File:2-enfactored mapping.png|365px|thumb|right|A 2-enfactored mapping represents a temperoid for which every other step of its generator lands on a pitch which no JI interval would ever temper to.]] | ||
We are now comparing the previous diagram, which had the mapping {{ | We are now comparing the previous diagram, which had the mapping {{ket|{{map|2 3}}}}, with the 2-enfactored version of it, i.e. the mapping 2×{{ket|{{map|2 3}}}} = {{ket|{{map|4 6}}}}, AKA 4-ET. | ||
If you compare this lattice of an enfactored mapping with the previous lattice for a healthy, defactored mapping, they should look almost the same. They have the same comma and tube circumference. And the generator follows the same path through that tube/swath. The key difference is how far the generator moves with each step along that path. | If you compare this lattice of an enfactored mapping with the previous lattice for a healthy, defactored mapping, they should look almost the same. They have the same comma and tube circumference. And the generator follows the same path through that tube/swath. The key difference is how far the generator moves with each step along that path. | ||
| Line 115: | Line 115: | ||
[[File:2-enfactored comma-basis.png|365px|thumb|left|enfactored comma-bases are garbage]] | [[File:2-enfactored comma-basis.png|365px|thumb|left|enfactored comma-bases are garbage]] | ||
Here's where things get kind of nuts. Most recently we experimented with enfactoring our healthy temperament's mapping. Now let's experiment with enfactoring its comma-basis. In the defactored situation, if our comma-basis was {{ | Here's where things get kind of nuts. Most recently we experimented with enfactoring our healthy temperament's mapping. Now let's experiment with enfactoring its comma-basis. In the defactored situation, if our comma-basis was {{bra|{{vector|-3 2}}}}, then 2-enfactoring it produces 2×{{bra|{{vector|-3 2}}}} = {{bra|{{vector|-6 4}}}}. | ||
We know that in the original diagram, the large-labelled {{vector|-3 2}} represented our comma, and this was the point that our dotted line ran through, the one that represented our boundary of warp/wrap. So our first thought should be: we must alter our diagram so that now {{vector|-6 4}} is that point instead. Fine. | We know that in the original diagram, the large-labelled {{vector|-3 2}} represented our comma, and this was the point that our dotted line ran through, the one that represented our boundary of warp/wrap. So our first thought should be: we must alter our diagram so that now {{vector|-6 4}} is that point instead. Fine. | ||
| Line 188: | Line 188: | ||
This is a form of 5-limit [[porcupine]], a [[rank-2]] temperament. Looking at either row, neither map has a common factor. But remember that we also need to check linear combinations of rows. If we subtract the 2nd row from the 1st row, we can produce the row {{map|3 -3 -6}}, which has a common factor of 3. So this mapping is also enfactored, even though it's not obvious from just looking at it. | This is a form of 5-limit [[porcupine]], a [[rank-2]] temperament. Looking at either row, neither map has a common factor. But remember that we also need to check linear combinations of rows. If we subtract the 2nd row from the 1st row, we can produce the row {{map|3 -3 -6}}, which has a common factor of 3. So this mapping is also enfactored, even though it's not obvious from just looking at it. | ||
If you're unsure why this {{map|3 -3 -6}} matters despite not being in {{ | If you're unsure why this {{map|3 -3 -6}} matters despite not being in {{ket|{{map|3 0 -1}} {{map|0 3 5}}}}, we may need to quickly review some linear algebra fundamentals. It may take some getting used to, but a mapping can be changed to another equivalent mapping (both mappings will map input vectors to the same scalars) by replacing any row with linear combinations of its rows. That is, we could replace either {{map|3 0 -1}} or {{map|0 3 5}} in our original matrix {{ket|{{map|3 0 -1}} {{map|0 3 5}}}} to get {{ket|{{map|3 -3 -6}} {{map|0 3 5}}}} or {{ket|{{map|3 0 -1}} {{map|3 -3 -6}}}} and any of these mappings represent the same temperament. | ||
== well-hidden enfactoring == | == well-hidden enfactoring == | ||
| Line 241: | Line 241: | ||
Dave and Douglas did much of their work in [https://www.wolfram.com/language/ Wolfram Language] (formerly Mathematica), a popular programming language used for math problems. In this section we'll give examples using it. | Dave and Douglas did much of their work in [https://www.wolfram.com/language/ Wolfram Language] (formerly Mathematica), a popular programming language used for math problems. In this section we'll give examples using it. | ||
An input mapping <span><math>m</math></span>, such as the example Gene gives [[saturation|on the xen wiki page for Saturation]], {{ | An input mapping <span><math>m</math></span>, such as the example Gene gives [[saturation|on the xen wiki page for Saturation]], {{ket|{{map|12 19 28 34}} {{map|26 41 60 72}}}}, in Wolfram Language you would have to write as a list: | ||
<nowiki>m = {{12,19,28,34},{26,41,60,72}};</nowiki> | <nowiki>m = {{12,19,28,34},{26,41,60,72}};</nowiki> | ||
| Line 329: | Line 329: | ||
==== Hermite decomposition by hand ==== | ==== Hermite decomposition by hand ==== | ||
Let's do a Hermite decomposition example first. We begin with the mapping for the temperament 12&26bbb, which looks like {{ | Let's do a Hermite decomposition example first. We begin with the mapping for the temperament 12&26bbb, which looks like {{ket|{{map|12 19 28}} {{map|26 43 60}}}}, or as a matrix: | ||
<math>\left[ \begin{array} {rrr} | <math>\left[ \begin{array} {rrr} | ||
| Line 579: | Line 579: | ||
\end{array} </math> | \end{array} </math> | ||
I chose this matrix specifically to demonstrate the importance of the unimodularity of the other matrix produced by the Hermite decomposition. A unimodular matrix is defined by having a determinant of ±1. And what does this have to do with inverses? Well, take a look at the determinant of our original matrix here, {{ | I chose this matrix specifically to demonstrate the importance of the unimodularity of the other matrix produced by the Hermite decomposition. A unimodular matrix is defined by having a determinant of ±1. And what does this have to do with inverses? Well, take a look at the determinant of our original matrix here, {{ket|{{map|3 -2 4}} {{map|1 0 2}} {{map|0 1 0}}}}. It's 2. The determinant of an invertible matrix will tell you what the LCM of all the denominators in the inverse will be<ref>If you're familiar with the formula for the Moore-Penrose pseudoinverse of rectangular matrices, you may recognize this fact as akin to how you multiply the outside of the pseudoinverse by the reciprocal of the determinant of the matrix.</ref><ref>This may also shed some light on the fact that the only square matrices that are not invertible are those with determinants equal to 0.</ref> And so, the fact that the other matrix produced by the Hermite decomposition is unimodular means that not only is it invertible, if it has only integer terms (which it will, being involved in HNF), then its inverse will also have only integer terms. And this is important because the inverse of a Hermite unimodular matrix is just one step away from the defactored form of an input matrix. | ||
==== putting it all together ==== | ==== putting it all together ==== | ||
| Line 591: | Line 591: | ||
Here, we'll be demonstrating the process using the first option, because we might as well follow the same approach as the code unless we have a compelling reason not to. And we don't! If we were to follow the second option — rotating everything 90 degrees — we'd have to rewire our brains to recognize matrices in HNF but rotated 90 degrees, which is certainly harder than just transposing a matrix 90 degrees and then treating it the same way with respect to the complexities of Hermite decomposition as we've already become accustomed to. | Here, we'll be demonstrating the process using the first option, because we might as well follow the same approach as the code unless we have a compelling reason not to. And we don't! If we were to follow the second option — rotating everything 90 degrees — we'd have to rewire our brains to recognize matrices in HNF but rotated 90 degrees, which is certainly harder than just transposing a matrix 90 degrees and then treating it the same way with respect to the complexities of Hermite decomposition as we've already become accustomed to. | ||
So, while it's a silly example, let's suppose we want to defactor the mapping {{ | So, while it's a silly example, let's suppose we want to defactor the mapping {{ket|{{map|6 5 4}} {{map|4 -4 1}}}}. Spoiler alert: it is 11-enfactored: | ||
<math>\left[ \begin{array} {rrr} | <math>\left[ \begin{array} {rrr} | ||
| Line 841: | Line 841: | ||
And that's all there is to defactoring! | And that's all there is to defactoring! | ||
Note that this is not yet the canonical form. Remember that to achieve canonical form, we still have to take this result and get it into HNF. We won't work through that here, though if you'd like to practice by-hand Hermite decomposition, this would be a perfect example to try it on! The result you should end up with is {{ | Note that this is not yet the canonical form. Remember that to achieve canonical form, we still have to take this result and get it into HNF. We won't work through that here, though if you'd like to practice by-hand Hermite decomposition, this would be a perfect example to try it on! The result you should end up with is {{ket|{{map|2 1 -1}} {{map|0 2 -1}}}}. | ||
But what have we accomplished here, really? You may well feel underwhelmed by this matrix's transformation from {{ | But what have we accomplished here, really? You may well feel underwhelmed by this matrix's transformation from {{ket|{{map|6 5 -4}} {{map|4 -4 1}}}} to {{ket|{{map|6 5 -4}} {{map|-4 -4 3}}}}. It seems barely to have even changed! | ||
Well, the difference becomes clearer when we compare the HNF of the original matrix, which is {{ | Well, the difference becomes clearer when we compare the HNF of the original matrix, which is {{ket|{{map|2 9 -5}} {{map|0 22 -11}}}}, a clearly 11-enfactored mapping. One thing that's cool about performing this defactoring process by hand is that you can clearly see any common factor that you've removed as a result: all you have to do is look at the pivots of the HNF of the original matrix that you left behind, which in this case was: | ||
<math>\left[ \begin{array} {rrr} | <math>\left[ \begin{array} {rrr} | ||
| Line 853: | Line 853: | ||
\end{array} \right]</math> | \end{array} \right]</math> | ||
The pivots are 1 and 11, so that 11 tells us that we had a common factor of 11<ref>In the doubly-enfactored case of {{ | The pivots are 1 and 11, so that 11 tells us that we had a common factor of 11<ref>In the doubly-enfactored case of {{ket|{{map|17 16 -4}} {{map|4 -4 1}}}}, i.e. with a common factor of 33 = 3 × 11, the two pivots of the HNF are 3 and 11, putting each of them on display separately.</ref><ref>It's interesting to observe that while the 11-enfactoring can be observed in the original matrix as a linear combination of 2 of the 1st row with -3 of the 2nd row, i.e. 2{{map|6 5 -4}} + -3{{map|4 -4 1}} = {{map|0 22 -11}}, the linear combination of ''columns'', i.e. slicing the original {{ket|{{map|6 5 -4}} {{map|4 -4 1}}}} mapping the other direction like {{bra|{{vector|6 4}} {{vector|5 -4}} {{vector|-4 1}}}}, that leads to the revelation of this 11 is completely different: -1{{vector|6 4}} + 2{{vector|5 -4}} + 1{{vector|-4 1}} = {{vector|0 11}}.</ref>. You could say that the HNF is useful for identifying common factors, but not for removing them. But if you leave them behind in the column-style HNF, the information that is retained in the unimodular matrix which is the other product of the Hermite decomposition, is enough to preserve everything important about the temperament, to get you back to where you started via an inverse and a trimming of extraneous rows. | ||
== other defactoring methods == | == other defactoring methods == | ||
| Line 939: | Line 939: | ||
Note that canonicalizing a mapping does not remove trailing dimensions with only zeros. | Note that canonicalizing a mapping does not remove trailing dimensions with only zeros. | ||
In the case of a mapping, this would take the form of an extra column of all zeros to the right of any non-zero entries, or in other words, an unmapped prime higher than other mapped prime. For example you could have {{ | In the case of a mapping, this would take the form of an extra column of all zeros to the right of any non-zero entries, or in other words, an unmapped prime higher than other mapped prime. For example you could have {{ket|{{map|1 0 -4 0}} {{map|0 1 4 0}}}} which is just 5-limit meantone but represented in the 7-limit even though prime 7 is not used. | ||
And for a comma-basis the form dimensionality deficiency would take is rotated 90 degrees: a row of all zeros below all other nonzero entries, e.g. {{ | And for a comma-basis the form dimensionality deficiency would take is rotated 90 degrees: a row of all zeros below all other nonzero entries, e.g. {{bra|{{vector|4 -4 1 0}}}}. | ||
The reason these additional zeros should be preserved and these temperaments be treated as different from their untrimmed counterparts is made clear when we consider the difference in the duals. For a comma-basis, the extra dimension implies the presence of extra generators that are unbound to the other generators. For example, a basis for the anti-null-space of {{ | The reason these additional zeros should be preserved and these temperaments be treated as different from their untrimmed counterparts is made clear when we consider the difference in the duals. For a comma-basis, the extra dimension implies the presence of extra generators that are unbound to the other generators. For example, a basis for the anti-null-space of {{bra|{{vector|4 -4 1}}}}, or in other words its mapping, as we know well is {{ket|{{map|1 0 -4}} {{map|0 1 4}}}}. But that is not a basis for the anti-null-space of {{bra|{{vector|4 -4 1 <span><math>\color{red}0</math></span>}}}}; the mapping for that comma-basis would have to be {{ket|{{map|1 0 -4 <span><math>\color{red}0</math></span>}} {{map|0 1 4 <span><math>\color{red}0</math></span>}} {{map|<span><math>\color{red}0</math></span> <span><math>\color{red}0</math></span> <span><math>\color{red}0</math></span> <span><math>\color{red}1</math></span>}}}}. | ||
= references = | = references = | ||