Douglas Blumeyer's RTT How-To: Difference between revisions
Cmloegcmluin (talk | contribs) →multimaps: minors |
Cmloegcmluin (talk | contribs) update explanation of integer canonical form per Dave's requests, and update Wolfram code (though it's not checked yet, and no longer consistent with the statements in the text) |
||
Line 1,087: | Line 1,087: | ||
To be clear, canonical form isn’t necessary to avoid ambiguity: you will never find a comma basis that could represent more than one temperament. | To be clear, canonical form isn’t necessary to avoid ambiguity: you will never find a comma basis that could represent more than one temperament. | ||
I've seen many specialized matrix forms used in RTT for problems like this, such as [https://en.wikipedia.org/wiki/Smith_normal_form Smith normal form | I've seen many specialized matrix forms used in RTT for problems like this, such as [https://en.wikipedia.org/wiki/Smith_normal_form Smith normal form], [https://en.wikipedia.org/wiki/Hermite_normal_form Hermite Normal Form], [http://home.iitk.ac.in/~rksr/html/03CANONICALFACTORIZATIONS.htm Hermite Canonical Form], and maybe others. What we will be using here is "[[IRREF|integer canonical form]]".<ref>Historically, Hermite Normal Form was used as if it gave a unique identifier for each temperament, when in fact it did not. It failed to remove possibly-hidden common factors in the columns of comma bases and rows of map bases, leading to situations which were named "[[torsion]]" and "[[contorsion]]", respectively. Hermite Canonical Form goes too far it reduces the matrix's diagonals to all 1's or 0's, which loses important information for temperaments with non-octave periods. Integer canonical form removes such common factors without compromising non-octave periods, therefore truly giving a unique identifier, and also eliminating the need to deal with torsion or contorsion.</ref>. | ||
For example, the canonical form of meantone is: | For example, the canonical form of meantone is: | ||
Line 1,109: | Line 1,109: | ||
!output | !output | ||
|- | |- | ||
|<code> | |<code>antiTranspose[m_]:=Transpose[Reverse[m,{1,2}]]</code> | ||
<code> | <code>multByLcd[row_]:=Apply[LCM,Denominator[row]]*row</code> | ||
<code> | <code>canonicalForm[m_]:=Map[multByLcd,RowReduce[m]]</code> | ||
<code> | <code>columnCanonicalForm[m_]:=antiTranspose[canonicalForm[antiTranspose[m]]]</code> | ||
<code> | <code>canonicalForm[{{5,8,12},{7,11,16}}]</code> | ||
<code> | <code>columnCanonicalForm[{{-4,-10},{4,-1},{-1,5}}]</code> | ||
|{{1,0,-4},{0,1,4}} | |{{1,0,-4},{0,1,4}} | ||
{{-44,-30},{0,19},{19,0}} | {{-44,-30},{0,19},{19,0}} |