Normal forms: Difference between revisions

Cmloegcmluin (talk | contribs)
Positive generator form: \colorbox → \style
Normal val lists: redefine equave-reduced generator form (see talk). Misc cleanup
Line 33: Line 33:


# First, defactor it (aka make sure it is [[saturated]]). <ref>Historically, this step was not explicitly recognized as necessary for normal forms. The vast majority of normal forms catalogued on the wiki are not contorted/enfactored in the first place, but specifically defining this canonical form to include this requirement is an important step toward ensuring that, which will prevent redundant temperaments from being catalogued. In various domains, normal forms are often required to be unique, however, canonical forms are required to be unique even more often that normal forms are; according to [[Wikipedia: Canonical form]], 'the distinction between "canonical" and "normal" forms varies from subfield to subfield. In most fields, a canonical form specifies a unique representation for every object, while a normal form simply specifies its form, without the requirement of uniqueness.' This is the rationale behind defining "canonical" as opposed to merely "normal". To be more specific, The HNF does provide a unique representation of ''matrices'', i.e. from a perspective of pure mathematics, and so you will certainly find throughout mathematical literature that HNF is described as providing a unique representation, and this is correct. However, when applied to the RTT domain, i.e. to ''mappings'', the HNF sometimes fails to identify equivalent mappings as such. And the critical flaw with HNF is its failure to defactor matrices - meaning that a "contorted" mapping matrix has a different Hermite normal form than a non-contorted one with the same kernel - and this is because dividing rows is not a permitted elementary row operation when computing the HNF. See: [https://math.stackexchange.com/a/685922]. The canonical form as described here ''does'' defactor matrices, and therefore it delivers a truly canonical result. <br>
# First, defactor it (aka make sure it is [[saturated]]). <ref>Historically, this step was not explicitly recognized as necessary for normal forms. The vast majority of normal forms catalogued on the wiki are not contorted/enfactored in the first place, but specifically defining this canonical form to include this requirement is an important step toward ensuring that, which will prevent redundant temperaments from being catalogued. In various domains, normal forms are often required to be unique, however, canonical forms are required to be unique even more often that normal forms are; according to [[Wikipedia: Canonical form]], 'the distinction between "canonical" and "normal" forms varies from subfield to subfield. In most fields, a canonical form specifies a unique representation for every object, while a normal form simply specifies its form, without the requirement of uniqueness.' This is the rationale behind defining "canonical" as opposed to merely "normal". To be more specific, The HNF does provide a unique representation of ''matrices'', i.e. from a perspective of pure mathematics, and so you will certainly find throughout mathematical literature that HNF is described as providing a unique representation, and this is correct. However, when applied to the RTT domain, i.e. to ''mappings'', the HNF sometimes fails to identify equivalent mappings as such. And the critical flaw with HNF is its failure to defactor matrices - meaning that a "contorted" mapping matrix has a different Hermite normal form than a non-contorted one with the same kernel - and this is because dividing rows is not a permitted elementary row operation when computing the HNF. See: [https://math.stackexchange.com/a/685922]. The canonical form as described here ''does'' defactor matrices, and therefore it delivers a truly canonical result. <br>
There is also a rarely mentioned Hermite Canonical Form, or HCF, described here: [http://home.iitk.ac.in/~rksr/html/03CANONICALFACTORIZATIONS.htm], which sort of combines the HNF's constraint and the [[Matrix echelon forms #RREF|RREF]]'s reduced constraint (all pivots equal 1, all other entries in pivot columns are 0, both above and below the pivot), but we didn't find it useful because due to its constraint that all pivots be 1, it does not preserve periods that are genuinely unit fractions of an octave (at first glance, when a pivot is not equal to 1, it might trigger you to think that the mapping is enfactored. But temperaments can legitimately have generators that divide primes evenly, such as 5-limit Blackwood, {{rket|{{map|5 8 0}} {{map|0 0 1}}}}, which divides the octave into 5 parts. So any form that enforces pivots all be 1's, such as HCF and RREF, would fail this criteria.) It also doesn't qualify as an echelon form, which becomes apparent only when you use it on [[rank-deficient]] matrices, because it doesn't require the rows of all zeros to be at the bottom; instead it (bizarrely, though maybe it's related to how the SNF requires all pivots exactly along the main diagonal) requires the rows to be sorted so that all the pivots fall on the main diagonal.</ref>. Note that if the matrix was not [[full-rank]], this will result in the elimination of some rows<ref>Note that canonicalizing a mapping does not remove trailing ''dimensions'' with only zeros. <br>
There is also a rarely mentioned Hermite Canonical Form, or HCF, described here: [http://home.iitk.ac.in/~rksr/html/03CANONICALFACTORIZATIONS.htm], which sort of combines the HNF's constraint and the [[Matrix echelon forms #RREF|RREF]]'s reduced constraint (all pivots equal 1, all other entries in pivot columns are 0, both above and below the pivot), but we didn't find it useful because due to its constraint that all pivots be 1, it does not preserve periods that are genuinely unit fractions of an octave (at first glance, when a pivot is not equal to 1, it might trigger you to think that the mapping is enfactored. But temperaments can legitimately have generators that divide primes evenly, such as 5-limit Blackwood, {{rket| {{map| 5 8 0 }} {{map| 0 0 1 }} }}, which divides the octave into 5 parts. So any form that enforces pivots all be 1's, such as HCF and RREF, would fail this criteria.) It also doesn't qualify as an echelon form, which becomes apparent only when you use it on [[rank-deficient]] matrices, because it doesn't require the rows of all zeros to be at the bottom; instead it (bizarrely, though maybe it's related to how the SNF requires all pivots exactly along the main diagonal) requires the rows to be sorted so that all the pivots fall on the main diagonal.</ref>. Note that if the matrix was not [[full-rank]], this will result in the elimination of some rows<ref>Note that canonicalizing a mapping does not remove trailing ''dimensions'' with only zeros. <br>
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 {{rket|{{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. <br>
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 {{rket| {{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. <br>
And for a comma basis the form this would take is rotated 90 degrees: a row of all zeros below all other nonzero entries, e.g. [{{vector|4 -4 1 0}}].<br>
And for a comma basis the form this would take is rotated 90 degrees: a row of all zeros below all other nonzero entries, e.g. [{{vector| 4 -4 1 0 }}].<br>
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 antinullspace of [{{vector|4 -4 1}}], or in other words its mapping, as we know well is {{rket|{{map|1 0 -4}} {{map|0 1 4}}}}. But that is not a basis for the antinullspace of [{{vector|4 -4 1 <math>\color{red}0</math>}}]; the mapping for that comma basis would have to be {{ket|{map|1 0 -4 <math>\color{red}0</math>}} {{map|0 1 4 <math>\color{red}0</math>}} {{map|<math>\color{red}0</math> <math>\color{red}0</math> <math>\color{red}0</math> <math>\color{red}1</math>}}}}.</ref>. We now have a <math>(r,d)</math>-shaped matrix, with <math>r</math> rows where <math>r</math> is the ''rank''.
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 antinullspace of [{{vector| 4 -4 1 }}], or in other words its mapping, as we know well is {{rket| {{map| 1 0 -4 }} {{map| 0 1 4 }} }}. But that is not a basis for the antinullspace of [{{vector| 4 -4 1 <math>\color{red}0</math> }}]; the mapping for that comma basis would have to be {{ket| {{map| 1 0 -4 <math>\color{red}0</math> }} {{map| 0 1 4 <math>\color{red}0</math> }} {{map| <math>\color{red}0</math> <math>\color{red}0</math> <math>\color{red}0</math> <math>\color{red}1</math> }} }}.</ref>. We now have a <math>(r,d)</math>-shaped matrix, with <math>r</math> rows where <math>r</math> is the ''rank''.
# Then, put this result into HNF.
# Then, put this result into HNF.


For example, septimal meantone has the defactored Hermite form of {{rket|{{map|1 0 -4 -13}} {{map|0 1 4 10}}}}, corresponding to generators of ~2/1 and ~3/1.
For example, septimal meantone has the defactored Hermite form of {{rket| {{map| 1 0 -4 -13 }} {{map| 0 1 4 10 }} }}, corresponding to generators of ~2/1 and ~3/1.


The HNF step is not necessary to defactor the mapping, but it is important for canonicalizing into a convenient form.
The HNF step is not necessary to defactor the mapping, but it is important for canonicalizing into a convenient form.
Line 46: Line 46:


=== Positive generator form ===
=== Positive generator form ===
Even though by using the HNF the defactored Hermite form ensures that the pivot (first nonzero entry) of each mapping row is a positive ''number'', this does not necessarily mean that the corresponding generators are all positive ''in pitch''. For example, the defactored Hermite form of porcupine is the matrix {{rket|{{map|1 2 3}} {{map|0 3 5}}}}. The second column of this matrix tells us it takes 2 of the first generator and 3 of the second generator to reach its approximation of 3/1. But as we can tell from the first column of this matrix, it takes only 1 of the first generator and nothing else to reach its approximation of 2/1. Therefore, if we move by 2 of the first generator, we are already at this temperament's approximation of 4/1, and so if we still need to move by 3 of the second generator to reach its approximation of 3/1, then the second generator must be negative. Indeed, it is about 163 cents ''downward'' in pitch. Negative generators like this can be surprising and confusing, and so the '''positive generator form''' was developed to address this concern.  
Even though by using the HNF the defactored Hermite form ensures that the pivot (first nonzero entry) of each mapping row is a positive ''number'', this does not necessarily mean that the corresponding generators are all positive ''in pitch''. For example, the defactored Hermite form of porcupine is the matrix {{rket| {{map| 1 2 3 }} {{map| 0 3 5 }} }}. The second column of this matrix tells us it takes 2 of the first generator and 3 of the second generator to reach its approximation of 3/1. But as we can tell from the first column of this matrix, it takes only 1 of the first generator and nothing else to reach its approximation of 2/1. Therefore, if we move by 2 of the first generator, we are already at this temperament's approximation of 4/1, and so if we still need to move by 3 of the second generator to reach its approximation of 3/1, then the second generator must be negative. Indeed, it is about 163 cents ''downward'' in pitch. Negative generators like this can be surprising and confusing, and so the '''positive generator form''' was developed to address this concern.  


To obtain this form, we first need to know whether each generator is positive or negative in pitch. Many methods are available for finding this information, but the one which is the easiest (and therefore the one this form is defined as using) is to find the [[Frobenius generator]]s of the temperament. To break this down, we find the [[Wikipedia: Moore–Penrose pseudoinverse|Moore–Penrose pseudoinverse]] of the mapping A, which we notate A<sup>+</sup>, and multiply this from the left by the row vector of [[JIP]], J<sub>0</sub> = [1 log<sub>2</sub>3 log<sub>2</sub>5 … log<sub>2</sub>''p''].  
To obtain this form, we first need to know whether each generator is positive or negative in pitch. Many methods are available for finding this information, but the one which is the easiest (and therefore the one this form is defined as using) is to find the [[Frobenius generator]]s of the temperament. To break this down, we find the [[Wikipedia: Moore–Penrose pseudoinverse|Moore–Penrose pseudoinverse]] of the mapping V, which we notate V<sup>+</sup>, and multiply this from the left by the row vector of [[JIP]], J = [1 log<sub>2</sub>3 log<sub>2</sub>5 … log<sub>2</sub>''p''].  


<math>G_\text{F} = J_0 A^+</math>
<math>G = JV^+</math>


If the ''i''-th entry in the result is negative, change the signs of every entry in the corresponding row of the mapping.
If the ''i''-th entry in the result is negative, change the signs of every entry in the corresponding row of the mapping.


The "mapping" (though not the "[[mapping to lattice]]") listed on temperament pages of this wiki are in this form. The generators in defactored Hermite form of septimal meantone is positive already, so its positive generator form is the same as its defactored Hermite form, [{{val| 1 0 -4 -13 }}, {{val| 0 1 4 10 }}], corresponding to generators of ~2/1 and ~3/1. An example of positive generator form that is different from the defactored Hermite form is the porcupine temperament, elaborated below.  
'''Note''': the "mapping" (though not the "[[mapping to lattice]]") listed on temperament pages of this wiki are in this form.  
 
The generators in defactored Hermite form of septimal meantone is positive already, so its positive generator form is the same as its defactored Hermite form, [{{val| 1 0 -4 -13 }}, {{val| 0 1 4 10 }}], corresponding to generators of ~2/1 and ~3/1. An example of positive generator form that is different from the defactored Hermite form is the porcupine temperament, elaborated below.  


The defactored Hermite form mapping matrix for porcupine is
The defactored Hermite form mapping matrix for porcupine is
Line 75: Line 77:
</math>
</math>


Since we're in the 5-limit here, we want the 5-limit JIP:
Since we are in the 5-limit here, we want the 5-limit JIP:


<math>
<math>
Line 153: Line 155:


=== Equave-reduced generator form ===
=== Equave-reduced generator form ===
The '''equave-reduced generator form''' has the matrix modified from the defactored Hermite normal form so that each generator is equave-reduced, where the [[equave]] can be found as the formal prime represented by the first ''column'' of the matrix (which is usually the octave). For more information, see [[Octave reduction #Generalization]].


The '''equave-reduced generator form''' is similar to the positive generator form, but the matrix is further modified so that each generator is equave-reduced, where the [[equave]] can be found as the formal prime represented by the first ''column'' of the matrix (which is usually the octave). For more information, see: [[Octave reduction #Generalization]]
Consider the case of septimal meantone. As we know, its defactored Hermite normal form is {{rket| {{map| 1 0 -4 -13 }} {{map| 0 1 4 10 }} }} which corresponds to generators of ~2/1 and ~3/1. In this case, as is typical, the formal prime represented by the first column of the matrix is 2, and so the equave is the octave. Therefore, all generators must be octave-reduced. But our second generator is ~3/1, which is not octave-reduced. We must alter the mapping in such a way that this row represents a generator of ~3/2 instead. We can do that here by adding the second row of the mapping to the first: {{rket| {{map| 1 1 0 -3 }} {{map| 0 1 4 10 }} }}. So that is septimal meantone's equave-reduced generator form, corresponding to generators of ~2/1 and ~3/2.  
 
Consider the case of septimal meantone. As we know, its positive generator form is {{rket|{{map|1 0 -4 -13}} {{map|0 1 4 10}}}} which corresponds to generators of ~2/1 and ~3/1. In this case, as is typical, the formal prime represented by the first column of the matrix is 2, and so the equave is the octave. Therefore, all generators must be octave-reduced. But our second generator is ~3/1, which is not octave-reduced. We must alter the mapping in such a way that this row represents a generator of ~3/2 instead. We can do that here by adding the second row of the mapping to the first: {{rket|{{map|1 1 0 -3}} {{map|0 1 4 10}}}}. So that is septimal meantone's equave-reduced generator form, corresponding to generators of ~2/1 and ~3/2.  


Probably the most reliable way to achieve equave-reduced generator form in general, however, is not to work with a [[generators preimage transversal]] such as ~3/1 and ~3/2. Instead the Frobenius generators may be used, as described in the positive generator form section just above, and reduction can be accomplished by calling modulo on their cents.
Probably the most reliable way to achieve equave-reduced generator form in general, however, is not to work with a [[generators preimage transversal]] such as ~3/1 and ~3/2. Instead the Frobenius generators may be used, as described in the positive generator form section just above, and reduction can be accomplished by calling modulo on their cents.


For a general discussion of how to manipulate the sizes of generators in this way, see [[Generator size manipulation]].
For a general discussion of how to manipulate the sizes of generators in this way, see [[Generator size manipulation]].
=== Positive equave-reduced generator form ===
The '''positive equave-reduced generator form''' is similar to the equave-reduced generator form, but starts from the positive generator form instead of the defactored Hermite normal form.


=== Minimal generator form ===
=== Minimal generator form ===
Line 169: Line 173:
Beyond rank-2, the mingen form of a temperament is no longer unique. You can always get smaller and smaller generators. This is why on Graham Breed's temperament finding tool, beyond rank-2 he simply uses the Hermite Normal Form.
Beyond rank-2, the mingen form of a temperament is no longer unique. You can always get smaller and smaller generators. This is why on Graham Breed's temperament finding tool, beyond rank-2 he simply uses the Hermite Normal Form.


Consider the example in the diagram given here: [[Generator form manipulation#Beyond rank-2]]. We begin with {{rket|{{map|1 2 0 -1}} {{map|0 -1 6 10}} {{map|0 0 -1 -2}}}} with generators of 1200.6¢, 499.841¢, and 214.024¢, which therefore already satisfies the condition that each generator is less than half the previous generator. But we can transform it into {{rket|{{map|1 2 2 3}} {{map|0 -1 1 0}} {{map|0 0 -1 -2}}}} which has a third generator of 116.013¢ instead. This is accomplished by adding row 3 to row 2 five times, which decreases generator 3 by the size of five times row 2, from 214.024¢ by 5 × 499.841 = 2499.205¢ to -2285.18¢; and then subtracting row 3 from row 1 twice, which increases generator 3 by the size of two times row 1, from -2285.18¢ by 2 × 1200.6¢ = 2401.2¢ to 116.013¢. And we can get that generator even smaller if we had instead moved up by 499.841 twice to 1213.71¢ and then down by 1200.6¢ once to 13.109¢ (that's a final mapping of {{rket|{{map|1 2 -1 -3}} {{map|0 -1 8 14}} {{map|0 0 -1 -2}}}}.  
Consider the example in the diagram given here: [[Generator form manipulation #Beyond rank-2]]. We begin with {{rket| {{map| 1 2 0 -1 }} {{map| 0 -1 6 10 }} {{map| 0 0 -1 -2 }} }} with generators of 1200.6¢, 499.841¢, and 214.024¢, which therefore already satisfies the condition that each generator is less than half the previous generator. But we can transform it into {{rket| {{map| 1 2 2 3 }} {{map| 0 -1 1 0}} {{map| 0 0 -1 -2 }} }} which has a third generator of 116.013¢ instead. This is accomplished by adding row 3 to row 2 five times, which decreases generator 3 by the size of five times row 2, from 214.024¢ by 5 × 499.841 = 2499.205¢ to -2285.18¢; and then subtracting row 3 from row 1 twice, which increases generator 3 by the size of two times row 1, from -2285.18¢ by 2 × 1200.6¢ = 2401.2¢ to 116.013¢. And we can get that generator even smaller if we had instead moved up by 499.841 twice to 1213.71¢ and then down by 1200.6¢ once to 13.109¢ (that's a final mapping of {{rket| {{map| 1 2 -1 -3 }} {{map| 0 -1 8 14 }} {{map| 0 0 -1 -2 }} }}.  


You could find smaller and smaller generators if you wanted, by essentially finding increasingly small "commas" between the other generators' sizes (e.g. 5 × 1200.6¢ versus 12 × 499.841¢ is a difference of only 4.908¢) and then shifting generators by those commas.
You could find smaller and smaller generators if you wanted, by essentially finding increasingly small "commas" between the other generators' sizes (e.g. 5 × 1200.6¢ versus 12 × 499.841¢ is a difference of only 4.908¢) and then shifting generators by those commas.
Line 176: Line 180:


=== Reduced row echelon form (RREF) ===
=== Reduced row echelon form (RREF) ===
{{main| Wikipedia: Row echelon form }}
{{Main| Wikipedia: Row echelon form }}


If you have a routine which will compute the reduced row echelon form of a matrix with rows consisting of vals using rational number arithmetic, this can be computed and any rows consisting of the zero val stripped off. The result is a unique identifier for the abstract temperament which is closely related to the normal val list. The intervals of the abstract temperament may be found in the same way, by applying the mappings (which are fractional vals) to monzos; or put in another way, by matrix multiplication of the monzos by the reduced row echelon form matrix.
If you have a routine which will compute the reduced row echelon form of a matrix with rows consisting of vals using rational number arithmetic, this can be computed and any rows consisting of the zero val stripped off. The result is a unique identifier for the abstract temperament which is closely related to the normal val list. The intervals of the abstract temperament may be found in the same way, by applying the mappings (which are fractional vals) to monzos; or put in another way, by matrix multiplication of the monzos by the reduced row echelon form matrix.