Defactoring: Difference between revisions
Cmloegcmluin (talk | contribs) |
Cmloegcmluin (talk | contribs) |
||
Line 167: | Line 167: | ||
Sometimes the enfactoring of a mapping is immediately apparent. For example: | Sometimes the enfactoring of a mapping is immediately apparent. For example: | ||
{{ | <math> | ||
\left[ | |||
\begin{array} {r} | |||
24 & 38 & 56 \\ | |||
\end{array} | |||
\right] | |||
</math> | |||
This mapping has only a single row, and we can see that every element in that row is even. Therefore we have a common factor of at least 2. In this case it is in fact exactly 2. So we can say that this is a 2-enfactored mapping. | This mapping has only a single row, and we can see that every element in that row is even. Therefore we have a common factor of at least 2. In this case it is in fact exactly 2. So we can say that this is a 2-enfactored mapping. | ||
Line 181: | Line 187: | ||
Other times, enfactoring is less apparent. Consider this example: | Other times, enfactoring is less apparent. Consider this example: | ||
{{ | <math> | ||
\left[ | |||
\begin{array} {r} | |||
3 & 0 & -1 \\ | |||
0 & 3 & 5 \\ | |||
\end{array} | |||
\right] | |||
</math> | |||
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. | ||
Line 189: | Line 202: | ||
=== well-hidden enfactoring === | === well-hidden enfactoring === | ||
Sometimes the hidden common factor is even harder to find. Consider the mapping {{ | Sometimes the hidden common factor is even harder to find. Consider the mapping: | ||
<math> | |||
\left[ | |||
\begin{array} {r} | |||
6 & 5 & -4 \\ | |||
4 & -4 & 1 \\ | |||
\end{array} | |||
\right] | |||
</math> | |||
To find this common factor, we need to linearly combine two of the first row {{map|6 5 -4}} and negative three of the 2nd row {{map|4 -4 1}} to produce {{map|0 22 -11}}. So we can see here that its common factor is 11. But there's no clear relationship between the numbers 2 and 3 and the number 11. And so we can begin to see that the problem of identifying enfactored mapping may not be very simple or straightforward. | |||
== defactoring methods == | == defactoring methods == |
Revision as of 00:28, 18 September 2021
A regular temperament mapping is in defactored canonical form (DCF) when it is put into Hermite Normal Form (HNF) after being "defactored".
vs. normal form
"normal" vs. "canonical"
A mapping in canonical form uniquely identifies a set of mappings that are equivalent to it. Historically, the xenharmonic community has most often used the word normal for this idea, and evidence of this can be found on many pages across this wiki. And this is not wrong; normal forms are indeed often required to be unique. However, canonical forms are required to be unique even more often that normal forms are[1], and so we prefer the term canonical to normal for this purpose.
Also, using "canonical" helps establish a clear distinction from previous efforts to establish unique representations of equivalent mappings; due to its lack of historical use in RTT, it appears to be safe to simply use "canonical form" for short to refer to matrices in defactored canonical form.
vs. HNF
More importantly, and perhaps partially a result of this weak understanding of the difference between the conventions for normal and canonical forms, the xenharmonic community has mistakenly used HNF as if it provides a unique representation of equivalent mappings. To be more specific, 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.
The critical flaw with HNF is its failure to defactor matrices[2]. The DCF that will be described here, on the other hand, does defactor matrices, and therefore it delivers a truly canonical result.
defactoring
Defactoring a matrix means to perform an operation on it which ensures that it is not "enfactored". And a matrix is considered to be "enfactored" if linear combinations of its rows can produce another row whose elements have a common factor (other than 1). This definition includes matrices whose rows already include a common factor, such as ⟨24 38 56] which has a common factor of 2. Being enfactored is a bad thing. Enfactored matrices — those in the RTT domain, at least — are sick, in a way[3]; it's no accident that "enfactored" sounds sort of like "infected". Fortunately, the remedy is simple: all one has to do is "defactor" it — identify and divide out the common factor — to produce a healthy mapping.
Due to complications associated with enfactored mappings which we'll get into later in this article, we discourage treating them as representations of true temperaments.[4] Instead we recommend that they be considered to represent mere "temperoids": temperament-like structures.
vs. IRREF
Elsewhere, Integer Reduced Row Echelon Form, or IRREF, has been proposed as a normal form for mappings. It has a similar problem as HNF does, however, in that it does not always defactor matrices. Worse, even, sometimes IRREF introduces enfactoring where before there was none! For example, consider this mapping for 5-limit porcupine, [⟨7 11 16] ⟨22 35 51]⟩. This mapping is not enfactored, but its IRREF is [⟨3 0 -1] ⟨0 3 5]⟩, which is 3-enfactored. More on this later.
terminology change proposal
If you've studied RTT extensively, you've probably encountered the terms "saturated" and "contorted" that are sometimes used to describe mappings. These two terms each have several flaws, and so this article presents alternative terms that are clearer and more descriptive: "defactored" and "enfactored", respectively. These new terms were coined by Dave Keenan in collaboration with Douglas Blumeyer in June of 2021[5].
defactored, to replace saturated
Several concerns with the term "saturation" may be identified:
- It does not have any obvious musical or mathematical meaning in this context (whereas enfactored and defactored do have obvious mathematical meaning).
- It has another unrelated meaning within xenharmonics that it would conflict with: https://en.xen.wiki/w/Anomalous_saturated_suspension
- The most common everyday usage of that word is for "saturated fats", which are the bad kind of fats, so it has negative associations, despite "saturation" being the good state for a matrix to be in.
- Research on the tuning list archives suggests that Gene Ward Smith chose the word "saturation" because it was used in the mathematical software he was using at the time, Sage. However, no information about saturation indices has been identified elsewhere online. Certainly, if this mathematical concept of saturation is established outside of this particular piece of software, it is not well-established enough yet such that it's worth deferring to[6]. 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[7].
enfactored, to replace contorted
As for the term "contorsion", the concerns with it are:
- Again, it does not have any obvious musical or mathematical meaning in this context. It's a word that was invented for RTT, so nothing else depends on it[8].
- It was made up due to false assumptions[9]. Through researching on tuning list archives, Dave and Douglas concluded that the associated concept of "torsion" was first described in January of 2002[10], with regards to commas used to form Fokker periodicity blocks. The concept of enfactoring was recognized in temperament mappings (though of course it did not yet go by that name), and — because torsion in lists of commas for Fokker blocks looks the same way as enfactoring looks in temperament comma-bases — torsion got conflated with it[11]. But they can't truly be the same thing; the critical difference is that periodicity blocks do not involve tempering, while temperaments do. In concrete terms, while it can make sense to construct a Fokker block with [-4 4 -1⟩ in the middle and [-8 8 -2⟩ = 2[-4 4 -1⟩ at the edge, it does not make sense to imagine a temperament which tempers out 2[-4 4 -1⟩ but does not temper out [-4 4 -1⟩. Unfortunately, however, this critical difference seems to have been overlooked, and so it seemed that enfactored comma-bases exhibited torsion, and thus because mappings are the dual of comma-bases, then enfactoring of a mapping should be the dual of torsion, and because the prefix co- or con- means "dual" (as in vectors and covectors), the term "con-torsion" was coined for it. "Torsion" already has the problem of being an obscure mathematical term that means nothing to most people, "contorsion" just compounds that problem by being made up, and it is made up in order to convey a duality which is false. So while "torsion" could be preserved as a term for the effect on periodicity blocks (though there's almost certainly something more helpful than that, but that's a battle for another day[12][13][14]), the term "contorsion" must be banished from the RTT community altogether.
- A word with the same spelling was also coined with mathematical meaning outside of RTT, in the field of differential geometry: https://en.wikipedia.org/wiki/Contorsion_tensor[15]
- It is prone to spelling confusion. People commonly refer to temperaments with contorsion as "contorted". But contorted is the adjective form of a different word, contortion, with a t, not an s. The proper adjective form of contorsion would be contorsioned. Would you use "torted" instead of torsioned? Or would people prefer "torsional" and "contorsional", even though that suggests only of or pertaining to in general rather than having the effect applied.[16]
- Due to its similarity with the word "contortion", the word contorsion evokes bending, twisting, and knotting. But there is nothing bendy, twisty, or knotted about the effect it has on JI lattices or tuning space.
conclusion
In accordance with this research and reasoning, this article henceforth will eschew the terms saturation and contorsion in favor of defactored and enfactored.
the pathology of enfactoredness
In this section, we will use lattices to visualize enfactored temperaments, to demonstrate the musical implications of mappings with common factors, and the lack of musical implications of comma-bases with common factors.
unenfactored case

First, let's look at an unenfactored 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 [⟨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: [-3 2⟩, AKA 9/8. And so the comma-basis for this temperament is ⟨[-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 [-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 [0 0⟩, AKA 1/1, to [-3 2⟩, and then runs perpendicularly to infinity in either direction.
There's a couple good ways to interpret this situation:
- We've turned on a teleportation field for every point outside this swath, so that it moves by these (-3,2) intervals until it finds its way inside the swath.
- We've rolled up space, so that the line from 1/1 to 9/8 ₋ the width of our swath ₋ is like the circumference of a tube. In this case, since we're only working with 3-limit JI, "space" was only ever 2D, so we can just think of it as paper that we've rolled up, so the pair of dotted lines visualized here are touching along their entire lengths (and if you wanted to imagine further copies of these dotted lines at every (-3,2) interval farther out in either direction, and the paper is infinitely thin, just stack all the dotted lines on top of each other forever).
Either way, then we just superimpose the new tempered lattice on top. It's drawn in blue.
You can see that in the grey lattice underneath, coordinates have 2 values, e.g. [-1 2⟩. That's because the JI lattice essentially had two generators: the octave and the tritave. But tempering has helped us simplify things by reducing us to a single generator, so here, in the new blue-colored tempered lattice, the coordinates have only 1 value, e.g. [8⟩, and they simply indicate how many iterations of the single generator here that we've taken to reach the given point.
We've superimposed the tempered lattice atop the former JI lattice so we can see which JI intervals map to which tempered intervals. For example, [-1 2⟩, AKA 9/2, maps to [8⟩. That tells us that if we want to use the temperament's approximation of the JI interval 9/2, then we want the tempered pitch arrived at by moving by the generator 8 times.
Note that whenever the path the generator takes leaves the main swath, it wraps around to the point on the opposite side. Again, you can think of this either way you prefer: the world is still flat, and you've just warped over there; or, the world has been curled up, and in reality you've been looping back around toward that point the whole time, and the dotted line in this flat representation just represents the point you cut the tube and unrolled it so it could be better visualized on a screen.
The tempered vector for the generator of this temperament is of course [1⟩, but the JI preimage of the generator of this temperament is [-1 1⟩, or 3/2. It's visually clear why this is the generator. We need to choose an interval which if we repeatedly move by it, while wrapping around the swath, we'll visit every node inside the swath. The best way to do that is to move from the origin to the node that's nearest to the dotted line labelled "tube circumference". We want this node because we want to move away from the tube circumference as little as possible each time, so we avoid skipping any nodes. If it's not obvious, you may want to experiment with drawing the generator line as if it had gone to any other point inside the swath; if you repeated that movement, would you visit every node? No.
All of this so far is actually only just explaining the basic setup for any tempered lattice. But we've got to lay the basics down first in order to discuss the effect of enfactoring. We'll do that now!
enfactored mapping

We are now comparing the previous diagram, which had the mapping [⟨2 3]⟩, with the 2-enfactored version of it, i.e. the mapping 2×[⟨2 3]⟩ = [⟨4 6]⟩, AKA 4-ET.
If you compare this lattice of an enfactored mapping with the previous lattice for a healthy, unenfactored 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.
Starting from the origin, we can see that it takes us 2 moves of the generator to reach the approximation of [-1 1⟩, AKA 3/2, where before we made that step in one go. Then another 2 moves to reach the approximation of [-2 2⟩, AKA 9/4, for a total of 4 moves, where before it only took us 2 steps. As you keep going, you'll see that each node it has taken us 2x as many steps as before to reach it.
And for what? What happens in the steps that are halfway between nodes that were on the JI lattice? These are shown with hollow blue circles instead of filled blue circles, to indicate that there's not JI lattice node underneath them. In other words, while these are legitimate musical intervals, there is no JI interval which would be said to temper to them. In other words, since this is 4-ET, that first generator step is to a node [1⟩ that's about 300¢. But [0 0⟩ tempers to [0⟩ and [-1 1⟩ tempers to [2⟩; nothing tempers to [1⟩. It's an interval that can certainly at least be heard and understood musically, but has no meaning with respect to tempering JI, or in other words, no RTT purpose.
And so this 4-ET doesn't bring anything to the table that isn't already brought by 2-ET. And so it is fitting to consider it only a temperoid, rather than a true temperament. Were this as bad as things got, it might not be worth pushing for distinguishing temperoids from temperaments. But once we look at enfactored comma-bases, we'll see why things get pretty pathological.
enfactored comma-bases

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 unenfactored situation, if our comma-basis was ⟨[-3 2⟩], then 2-enfactoring it produces 2×⟨[-3 2⟩] = ⟨[-6 4⟩].
We know that in the original diagram, the large-labelled [-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 [-6 4⟩ is that point instead. Fine.
But here's the problem. It simply doesn't make sense to double the width of our swath/tube! If [-6 4⟩ is tempered out, then so is [-3 2⟩. That is, while nothing would stop you from drawing a diagram with a double-width swath/tube, the musical reality is that it is impossible to temper out [-6 4⟩ without also tempering out [-3 2⟩. And so there is no meaning or purpose to the comma-basis [-6 4⟩, whether RTT-wise or musically in general. It is garbage.
And so our lattice for an enfactored comma-basis looks almost identical to the original unenfactored lattice. The only difference here is that we've drawn a "supposed (but false)" tube circumference out to [-6 4⟩, while the half of this length which is real is now labelled the "true" circumference.
enfactored comma-bases vs. periodicity blocks with torsion

And now we're prepared to confront the key difference between the enfactored comma-basis of a temperament, and torsion of a periodicity block.
What they have in common is that both take the form of a common factor found somewhere in linear combinations of entries in a list of commas defining a pitch structure, and that these commas can be visualized by slicing the JI lattice into swaths of "periodicity" (that's just a fancy word for the effect we've already been observing for temperaments, where nodes outside the swath related by the size of that comma are considered equivalent and therefore redundant, or repetitions of the same pitch class).
The key difference is that the former (temperaments) tempers the commas out, while the latter (periodicity blocks) does not.
Why is this the key difference? Well, remember how in the previous section, the reason we couldn't actually extend the width of the swath/tube to [-6 4⟩ was because the tempering: if [-6 4⟩ is tempered out, then [-3 2⟩ is as well, so the swath/tube cannot legitimately be extended. Since there is no tempering in the case of periodicity blocks, however, the width can legitimately be extended in this way.
Let's take a look at the example given in Tonalsoft's page for torsion. The diagram there has been reworked here to help clarify things. The origin, 1/1, has been placed in the corner of this parallelogram-shaped block, and the two commas that define it are in two of the other corners: 2048/2025 and 625/324. The value at the fourth corner, 12800/6561, has vector 2×[-8 8 -2⟩. The first 2 is just to octave-reduce it to being positive, but you may recognize the actual vector part as 2 times the meantone comma. The most important part is that the vector is 2-enfactored. You can see that the node at the very center of this block is 160/81, which again is 2×[-4 4 -1⟩, or the octave-reduced non-enfactored version of that same comma.
The red and blue lines that wrap around this block are two different generator paths. The point here is to show that by doubling the size of this periodicity block, we have made it impossible to choose a node to travel to from the origin, i.e. a generator, such that you can reach every node in the block. Instead, the best you can do is reach half of the nodes; that's the red path from the origin 1/1. The blue path is an exact copy of the red path, but offset.
So we can see how tempting the duality can be here. In the case of a 2-enfactored mapping, the generator path reaches twice as many nodes as there were JI nodes. But in the case of a 2-enfactored comma-basis — if we could legitimately extend the width of the block, as we do in untempered periodicity blocks! — we would reach half as many nodes. But this duality just is not musically, audibly real.
enfactored mappings vs. enfactored comma-bases
One may pose the question: what is the relationship between an enfactored mapping and an enfactored comma-basis? Can you have one but not the other? Must you? Or must you not? Or does the question even make sense? Certainly at least some thinkers have suggested these cases are meaningfully independent[17].
The conclusion we arrive at here is that because enfactored comma-bases don't make any sense, or at least don't represent any legitimately new musical information of any kind that their unenfactored version doesn't already represent, it is not generally useful to think of enfactored mappings and enfactored comma-bases as independent phenomena. It only makes sense to speak of enfactored temperaments. Of course, one will often use the term "enfactored mapping" because enfactored mappings are the kind which do have some musical purpose, and often the enfactored mapping will be being used to represent the enfactored temperament — or temperoid, that is.
By the way, DCF is not only for mappings. Comma-bases may also be put into DCF, as long as they are first antitransposed[20], and then antitransposed again at the end, or in other words, you sandwich the defactoring and HNF operations between antitransposes.
conclusion
So due to the high likelihood for confusion when conceptualizing enfactored temperaments, we believe that using HNF as the unique ID for temperaments, i.e. treating temperoids as true temperaments, is a dangerous and unhelpful road. Instead, DCF should be used, essentially HNF but with defactoring built in, so that practitioners of RTT can focus on working with true temperaments.
identifying enfactored mappings
immediately apparent enfactoring
Sometimes the enfactoring of a mapping is immediately apparent. For example:
[math]\displaystyle{ \left[ \begin{array} {r} 24 & 38 & 56 \\ \end{array} \right] }[/math]
This mapping has only a single row, and we can see that every element in that row is even. Therefore we have a common factor of at least 2. In this case it is in fact exactly 2. So we can say that this is a 2-enfactored mapping.
Being enfactored tells us that it's wasteful to use this mapping. Specifically, being 2-enfactored tells us that we have 2x as many pitches as we need. Said another way, half of the pitches in our system are bringing nothing to the table, at least not in terms of approximating intervals built out of the 5-limit primes 2, 3, and 5, which is the primary goal of a temperament.
This is the mapping for 5-limit 24-ET. To be clear, we're not saying there's a major problem with 24 as an EDO. The point here is only that — if you're after a 5-limit temperament — you may as well use 12-ET. So we would consider 24-ET to stand for 24 Equal Temperoid.
Think of it this way: because every element is even, any JI interval you'd map with with the mapping must come out as an even number of steps of 24-ET, by the definition of the dot product, and every even step of 24-ET is just a step of 12-ET. Examples: [1 -2 1⟩.⟨24 38 56] = 24 - 76 + 56 = 4, [1 1 -1⟩.⟨24 38 56] = 24 + 38 - 56 = 6.
Other times, enfactoring is less apparent. Consider this example:
[math]\displaystyle{ \left[ \begin{array} {r} 3 & 0 & -1 \\ 0 & 3 & 5 \\ \end{array} \right] }[/math]
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 ⟨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 ⟨3 -3 -6] matters despite not being in [⟨3 0 -1] ⟨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 ⟨3 0 -1] or ⟨0 3 5] in our original matrix [⟨3 0 -1] ⟨0 3 5]⟩ to get [⟨3 -3 -6] ⟨0 3 5]⟩ or [⟨3 0 -1] ⟨3 -3 -6]⟩ and any of these mappings represent the same temperament.
Sometimes the hidden common factor is even harder to find. Consider the mapping:
[math]\displaystyle{ \left[ \begin{array} {r} 6 & 5 & -4 \\ 4 & -4 & 1 \\ \end{array} \right] }[/math]
To find this common factor, we need to linearly combine two of the first row ⟨6 5 -4] and negative three of the 2nd row ⟨4 -4 1] to produce ⟨0 22 -11]. So we can see here that its common factor is 11. But there's no clear relationship between the numbers 2 and 3 and the number 11. And so we can begin to see that the problem of identifying enfactored mapping may not be very simple or straightforward.
defactoring methods
Even better than identifying enfactored mappings is actually full-on defactoring them. Here are two methods that do just that: Smith defactoring, developed by Gene Ward Smith[18], and column Hermite defactoring, developed by Dave and Douglas (the name comes, of course, from Hermite normal form, which it uses[19]).
Neither of these methods have been rigorously proven to always defactor mappings, but tests Douglas ran on thousands of random mappings strongly suggested that both methods work and give the exact same results as each other.
This article prefers column Hermite defactoring to Smith defactoring because it is:
- Cheaper computationally, wasting less resources computing things irrelevant to the result[20],
- Is easy to understand how it works, and can be worked out by hand (as we will demonstrate below),
- If interested, you can see what the common factor is, if there was any.
Column Hermite defactoring could not have been developed, however, were it not for Gene's pioneering work with the Smith defactoring (what he calls the process of "saturating" a mapping). At first Dave and Douglas had no idea what the right reducing matrix of the Smith decomposition (the process which also provides the Smith normal form) had to do with common factors, only that it somehow magically worked. So they analyzed the Smith decomposition until they isolated its key actions which actually effect the defactoring, and then honed their method down to do only these necessary actions. Again, they wouldn't have known where to start were it not for Gene.
precedent: Smith defactoring
Dave and Douglas did much of their work in Wolfram Language (formerly Mathematica), a popular programming language used for math problems. In this section we'll give examples using it.
An input mapping [math]\displaystyle{ m }[/math], such as the example Gene gives on the xen wiki page for Saturation, [⟨12 19 28 34] ⟨26 41 60 72]⟩, in Wolfram Language you would have to write as a list:
m = {{12,19,28,34},{26,41,60,72}};
The implementation of Gene's method in Wolfram Language is simple. Just two lines:
rightReducingMatrix[m_] := Last[SmithDecomposition[m]] smithDefactor[m_] := Take[Inverse[rightReducingMatrix[m]], MatrixRank[m]]
So the first thing that happens to [math]\displaystyle{ m }[/math] when you pass it in to smithDefactor[]
is that it calls rightReducingMatrix[]
on it. This will find the Smith decomposition (using a function built in to Wolfram Language), which gives you three outputs: the Smith normal form, flanked by its left and right reducing matrices. We're asked only for the right reducing matrix, so we grab that with Last[]
. So that's what the function on the first line, rightReducingMatrix[]
, does.
Then Gene asks us to invert this result and take its first [math]\displaystyle{ r }[/math] rows, where [math]\displaystyle{ r }[/math] is the rank of the temperament. Invert[]
takes care of the inversion, of course. MatrixRank[m]
gives the count of linearly independent rows to the mapping, AKA the rank, or count of generators in this temperament. In this case that's 2. And so Take[list, 2]
simply returns the first 2 entries of the list.
Almost done! Except Gene not only defactors, he also calls for HNF, as we would, to achieve canonical form.
normalize[m_] := Last[HermiteDecomposition[m]]
Similar to the Smith Normal Form, we do a decomposition, which gives you the normal form plus some other bonus results. In this case we actually want the normal form itself, and it happens to be the last element in the result list. So putting it all together, we defactor and then normalize:
rightReducingMatrix[m_] := Last[SmithDecomposition[m]]; smithDefactor[m_] := Take[Inverse[rightReducingMatrix[m]], MatrixRank[m]]; normalize[m_] := Last[HermiteDecomposition[m]]; m = {{12,19,28,34},{26,41,60,72}}; normalize[smithDefactor[m]]
→ {{1,0,-4,-13},{0,1,4,10}}
And that result matches what Gene finds in that xen wiki article. Defactoring and normalizing is equivalent to canonicalization.
new development: column Hermite defactoring
Here is the implementation for column Hermite defactoring:
hermiteUnimodular[m_]:=Transpose[First[HermiteDecomposition[Transpose[m]]]] columnEchelonDefactor[m_]:=Take[Inverse[hermiteUnimodular[m]],MatrixRank[m]]
So this implementation begins by transposing the matrix, so that when it then performs the Hermite Decomposition, it is doing a column decomposition. We then take the unimodular matrix from the decomposition using First[]
, and Transpose[]
it to in effect undo the transposition we did at the beginning.
by hand
In an effort to demystify the effects of column Hermite defactoring, we will here walk though an example manually. It's a silly example, but suppose we have the mapping [⟨6 5 4] ⟨4 -4 1]⟩. Spoiler alert: it is 11-enfactored.
This is pretty long so I've put it in a collapsible section. Just click "expand" if you're interested:
other stuff to report
The rest of the material in this article is not strictly necessary to understand canonical form and defactoring, but for posterity the work Dave and Douglas did to attain their insights has been summarized here in case it may be helpful to anyone else who might want to iterate on this later.
criteria
In addition to being canonical and defactored, DCF has other important properties, which probably go without saying in the context of RTT mappings, but here they are just in case:
- integer: contains only integer terms.
- full-rank: removes rank deficiencies, or in other words, rows that are all zeros
- preserves genuine unit-fraction-of-an-prime periods: 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, [⟨5 8 0] ⟨0 0 1]⟩, which divides the octave into 5 parts.[21]
exclusion of generator size target criteria; mingen form
Initially, Dave and Douglas considered the proposal of a new standard RTT mapping form as an opportunity to include everything and the kitchen sink — in this case, to additionally massage generator sizes to fit a desirable rubric. It was ultimately decided to stay conceptually focused when drafting the proposal, leaving generator size out of the mix. Also, the particular generator size target they sought — named "mingen" — turned out to be a bit of a rabbit hole, especially above rank-2, both in terms of mathematical reality and engineering practicality. The results of those efforts are documented here: Generator size manipulation#mingen_form
relationship between various matrix echelon forms
There are several well-known echelon forms for matrices that predate DCF. Let's review them and their properties.
The most general form, with the fewest constraints, is simply called Row Echelon Form, or REF. Its only constraint is echelon[22] form: each row's pivot, or first nonzero entry, is strictly to the right of the preceding row's pivot. This single constraint is fairly weak, and therefore REF does not produce a unique representation. This constraint is shared by every matrix form discussed here.[23][24]
In the below example, [math]\displaystyle{ x_{ij} }[/math] represents any number.
x₁₁ | x₁₂ | x₁₃ | x₁₄ | x₁₅ |
0 | x₂₂ | x₂₃ | x₂₄ | x₂₅ |
0 | 0 | 0 | x₃₄ | x₃₅ |
Integer Row Echelon Form, or IREF, is, unsurprisingly, any REF which meets an additional integer constraint, or in other words, that all of its entries are integers. This is still not a sufficiently strict set of constraints to ensure a unique representation.
In the below example, [math]\displaystyle{ n_{ij} }[/math] represents any number.
n₁₁ | n₁₂ | n₁₃ | n₁₄ | n₁₅ |
0 | n₂₂ | n₂₃ | n₂₄ | n₂₅ |
0 | 0 | 0 | n₃₄ | n₃₅ |
Reduced Row Echelon Form, or RREF, takes REF in a different direction than IREF. Instead of stipulating anything about integers, it requires that the matrix is reduced, i.e. that the pivots are exactly equal to 1. This may require dividing rows by a number such that some resulting entries are no longer integers. Actually, there's a second part to the "reduced" constraint: each pivot column (a column which contains any row's pivot) has zeros for all other entries besides the pivot it contains. Due to these strict constraints, the RREF of a matrix is the first one we've looked at so far here which does ensure uniqueness.
1 | 0 | x₁₃ | 0 | x₁₅ |
0 | 1 | x₂₃ | 0 | x₂₅ |
0 | 0 | 0 | 1 | x₃₅ |
So IREF and RREF make a Venn diagram inside the category of REF: some IREF are RREF, but there are some RREF that are not IREF and some IREF that are not RREF. When we scope the situation to a specific matrix, however, because RREF is a unique form, this means that one or the other sector of the Venn diagram for RREF will be empty; either the unique RREF will also be IREF (and therefore the RREF-but-not-IREF sector will be empty), or it will not be IREF (and vice versa).
Integer Reduced Row Echelon Form, or IRREF is the next form to discuss. Based on the name, one might expect this form to be a combination of the constraints for RREF and IREF, and therefore if represented in an Euler diagram (generalization of Venn diagram) would only exist within their intersection. However this is not the case. That's because the IRREF does not include the key constraint of RREF which is that all of the pivots must be 1. IRREF is produced by simply taking the unique RREF and multiplying each row by whatever minimum value is necessary to make all of the entries integers[25]. Of course, this sometimes results in the pivots no longer being 1, so sometimes it is no longer RREF. It is always still REF, though[26], and because it is also always integer, that makes it always IREF; therefore, IRREF is strictly a subcategory of IREF. And because the RREF is unique, and the conversion process does not alter that, the IRREF is also unique.
n₁₁ | 0 | n₁₃ | 0 | n₁₅ |
0 | n₂₂ | n₂₃ | 0 | n₂₅ |
0 | 0 | 0 | n₃₄ | n₃₅ |
The multiplication of rows by whatever integer is required to clear the denominators of the RREF form is the action which is responsible for causing enfactoring, whenever the IRREF produces an enfactored mapping from a defactored one.
It is not possible for an RREF to be IREF without also being IRREF.
Hermite Normal Form, or HNF, is the last form to discuss. This one's constraints begin with echelon form and integer, therefore every HNF is also IREF. But HNF is not exactly reduced; instead, it is normalized, which — similarly to reduced — is a two-part constraint. Where reduced requires that all pivots be exactly equal to 1, normalized requires only that all pivots be positive (positive integers, of course, due to the other integer constraint). And where reduced requires that all entries in pivot columns besides the pivots are exactly equal to 0, normalized requires only that all entries in pivot columns below the pivots are exactly equal to 0, while entries in pivot columns above the pivots only have to be strictly less than the pivot in the respective column (while still being non-negative).[27][28][29] The normalization HNF uses is cool because this constraint, while strictly less strict than the reduced constraint used by RREF, is still strict enough to ensure uniqueness, but loose enough to ensure the integer constraint can be simultaneously satisfied, where RREF cannot ensure that.
So HNF has a lot in common with IRREF, which is the IREF you find by converting the RREF, but it is not always the same as IRREF.
Defactored Canonical Form, or DCF is closely related to HNF, because the second step of finding the DCF is taking the HNF. So the DCF is always a HNF, and therefore it has all the same properties of being echelon, integer, and normalized, and in turn therefore it also provides a unique representation. However it is not necessary the same HNF of the original mapping, due to the first step being defactoring; it is the same as as HNF except when the original mapping is enfactored.
In the below example, [math]\displaystyle{ p_{ij} }[/math] represents any positive integer, and [math]\displaystyle{ a_{ij} }[/math] represents any nonnegative integer less than the [math]\displaystyle{ p }[/math] in its column.
p₁₁ | a₁₂ | n₁₃ | a₁₄ | n₁₅ |
0 | p₂₂ | n₂₃ | a₂₄ | n₂₅ |
0 | 0 | 0 | p₃₄ | n₃₅ |
There is also the Smith Normal Form, or SNF, but we won't be discussing it in this context, because putting a mapping into SNF obliterates a lot of meaningful RTT information. SNF is also echelon, and integer, so like HNF it is also always IREF. But SNF requires that every single entry other than the pivots are zero, and that the pivots all fall exactly along the main diagonal of the matrix. The SNF essentially reduces a matrix down to the information of what its rank is and whether it is enfactored. For example, all 5-limit rank-2 temperaments such as meantone, porcupine, mavila, hanson, etc. have the same SNF: [⟨1 0 0] ⟨0 1 0]⟩. Or, if you 2-enfactor them, they will all have the SNF [⟨1 0 0] ⟨0 2 0]⟩. So while the SNF is closely related to defactoring, it is not itself a useful form to put mappings into.[30]
p₁₁ | 0 | 0 | 0 | 0 |
0 | p₂₂ | 0 | 0 | 0 |
0 | 0 | p₃₃ | 0 | 0 |
cases temperaments can be regarding which of their mapping forms equal each other

Considering only full-rank, integer mappings, we find three cases for a given temperament which is not enfactored. In all three cases, HNF is the same as DCF:
- The RREF, IRREF, and HNF are all different. Example: porcupine with RREF of [⟨1 0 [math]\displaystyle{ -\frac13 }[/math]] ⟨0 1 [math]\displaystyle{ \frac53 }[/math]]⟩, IRREF of [⟨3 0 -1] ⟨0 3 5]⟩, and HNF of [⟨1 2 3] ⟨0 3 5]⟩.
- The RREF, IRREF, HNF are all the same. Example: meantone with all equal to [⟨1 0 -4] ⟨0 1 4]⟩. This case is quite rare.
- The IRREF and HNF are the same, but the RREF is different. Example: hanson with IRREF and HNF of [⟨1 0 1] ⟨0 6 5]⟩ but RREF of [⟨1 0 1] ⟨0 1 [math]\displaystyle{ \frac56 }[/math]]⟩.
And there are three corresponding cases when a temperament is enfactored. In all three cases, the key difference is that HNF is no longer the same as DCF, with the only difference being that the common factor is not removed. In all cases below, the examples are shown with a common factor of 2 introduced in their second row, which stays behind in the second row of the HNF:
- Now all four are different. Example: enfactored porcupine, e.g. [⟨15 24 35] ⟨14 22 32]⟩ causes the HNF to be [⟨1 2 3] ⟨0 6 10]⟩.
- Everything is still the same now, except HNF. Example: enfactored meantone, e.g. [⟨5 8 12] ⟨14 22 32]⟩ causes the HNF to be [⟨1 0 -4] ⟨0 2 8]⟩. This case, like the corresponding unenfactored state, is also quite rare.
- The only match now is between IRREF and DCF. In other words, the HNF and DCF diverged, and it was the DCF which remained the same as IRREF. Example: enfactored hanson, e.g. [⟨15 24 35] ⟨38 60 88]⟩ causes the HNF to be [⟨1 0 1] ⟨0 12 10]⟩.
There is also a final case which is incredibly rare. It can be compared to the #3 cases above, the ones using hanson as their example. The idea here is that when the HNF and DCF diverge, instead of DCF remaining the same as IRREF, it's the HNF that remains the same as IRREF. There may be no practical temperoids with this case, but [⟨165 264 393] ⟨231 363 524]⟩ will do it[31], with IRREF and HNF of [⟨33 0 -131] ⟨0 33 131]⟩, DCF of [⟨1 1 0] ⟨0 33 131]⟩, and RREF of [⟨1 0 [math]\displaystyle{ \frac{-131}{33} }[/math]] ⟨0 1 [math]\displaystyle{ \frac{131}{33} }[/math]]⟩.
That accounts for 7 of the 15 total possible cases for a system of equalities between 4 entities. The remaining 9 cases are impossible due to properties of the domain:
- If HNF equals RREF, then the pivots of HNF are all 1's, which means the temperament is not enfactored, which means HNF also equals DCF. This eliminates 3 cases: HNF=RREF; HNF=RREF,HNF=IRREF,RREF=IRREF; HNF=RREF,IRREF=DCF.
- If RREF equals DCF, then RREF must be integer, which means RREF must also equal IRREF. This eliminates 3 cases: RREF=DCF; RREF=DCF,HNF=RREF,HNF=DCF; RREF=DCF,HNF=IRREF.
- The case where the only equality is between RREF and IRREF would only be possible when the temperament is both enfactored and rank-deficient, such as [⟨0 0 0] ⟨2 4 6]⟩ which gives to HNF, RREF, IRREF, and DCF of [⟨2 4 6] ⟨0 0 0]⟩, [⟨1 2 3] ⟨0 0 0]⟩, [⟨1 2 3] ⟨0 0 0]⟩, and [⟨1 2 3]⟩, respectively.
- The case where the only equalities are between RREF and IRREF and between HNF and DCF is impossible, because if RREF=IRREF that suggests that all entries are multiples of their pivots, which is easy if the temperament is enfactored, but if HNF=DCF then it is not.
sum-and-difference defactoring
When in development on an ideal defactoring method — the effort which culminated in column Hermite defactoring — Dave and Douglas invested a great deal of time in a defactoring method which still has some advantages over column Hermite defactoring but was ultimately rejected. This other method is called "sum-and-difference" defactoring, or SAD defactor (it is sad partially because it didn't work out).
SAD defactoring's key advantage over column Hermite defactoring is that its mechanism for removing common factors is more straightforward to see and understand, as we will see in the next section.
SAD defactoring's key reason for rejection is that a number of edge cases were discovered that caused its algorithm to balloon in complexity, both insofar as it could be implemented in code as well as understood by humans.
how it works
Originally Dave was inspired by what Paul Erlich wrote on the article for torsion on the Tonalsoft site. The algorithm simply checks every possible combination of sums and differences of rows. You have to check all [math]\displaystyle{ \frac{3^r - 1}{2} }[/math] sums and differences where [math]\displaystyle{ r }[/math] is the rank of the mapping. For example, for a rank-3 mapping with rows [A B C⟩, you would need to check
- A
- B
- C
- A+B
- A-B
- A+C
- A-C
- B+C
- B-C
- A+B+C
- A+B-C
- A-B+C
- A-B-C
In other words, for each of A, B, and C, you have to check -1 of it, 0 of it, or 1 of it. You don't need to check any counts less than -1 or greater than 1, because then you'd of course be introducing a common factor to the mapping!
Anyway, the point is, if any of these combinations has a common factor, you simply remove the common factor, then replace a row in the mapping with this combined-and-defactored row.
problem 1. edge case: multiple common factors
Some matrices can have multiple common factors, such as {{vector|⟨17 16 -4} ⟨4 -4 1]]. The SNF of this mapping is [⟨1 0 0] ⟨0 33 0]⟩, and that 33 is actually a double common factor because it's not prime, but the product of 3 and 11. SAD defactoring unfortunately only removes one of these factors at a time, and so it therefore needs to be designed to perform recursively until no change occurs in an iteration, at which point all common factors have been removed.
SAD defactoring was found to fail in the case of well-hidden common factors, i.e. ones where there are no common factors to be found in sums or differences of the rows, but are to be found in sums or differences of multiples of these rows. In order to solve this problem, SAD defactoring would need to be reworked to check every possible combination of integer multiples of each row, potentially up to the largest absolute value of integer in the given mapping, which would cause it to become intractably slow to compute.
Fortunately this did not turn out to be necessary. The solution here was to do one pass of HNF before doing the defactoring (and still do the HNF pass at the end too, when going for a canonical form). This pre-pass of HNF doesn't manage to remove the common factor, but it does at least reveal it. For example, in the case of [⟨6 5 -4] ⟨4 -4 1]⟩, the HNF is [⟨2 9 -5] ⟨0 22 -11]⟩, so that hidden common factor of 11 has now been revealed, put in a form where SAD is capable of removing it.
So this is better than initially thought. But still not great to have to add another HNF pass at the onset.
problem 3. picking the correct row to replace
Initially it was thought that, upon finding a common factor in a combination of rows and removing it, it would be acceptable to replace any row of the mapping with the fixed row, and that we could then simply replace the first row. However this is not the case. When replacing a row with a defactored sum or difference, the replaced row has to be one of those involved in the sum or difference. It can always be the topmost one of those, but it can't always be the topmost row of the matrix. So this increases the complexity of the algorithm.
problem 4. failure to remove rank-deficient rows
The way Smith defactoring works, and column Hermite defactoring works, a step which ensures that the final number of rows of the output is equal to the rank is built into how the core of the implementation works already. However, for SAD defactoring, a special extra pass is required to ensure this.
At this point, SAD defactor was considered "a mess".
Wolfram Language implementation
This is the furthest progress that was made on SAD defactor before efforts were shifted to column Hermite defactor. This implementation still exhibits problems 2, 3, and 4; only problem 1 was solved here.
sadDefactor[m_] := Module[{reduced, linCombs,linCombsDisarmed, maybeDisarmedRow, thing}, linCombs = linCombsToCheck[m]; linCombsDisarmed = Map[extractGcd, linCombs]; maybeDisarmedRow = Complement[linCombsDisarmed, linCombs]; If[Length[maybeDisarmedRow]==0, m, sadDefactor[Join[{m[[1]]},{ maybeDisarmedRow[[1]]}]]] ]
minors'n'back defactoring
Another technique which was experimented with took advantage of the fact that the list of minor determinants (or simply "minors") of a mapping is guaranteed to include any common factor as its entries' GCD. So, if one simply converted a mapping to its list of minors, removed the GCD (at which point you would have what in RTT is called a canonical multimap, or wedgie), and then performed an "anti-minors" operation to get back to a mapping form, any common factors should be removed.
Following Gene Ward Smith's method for computing anti-minors as described here and here, the anti-minors method was developed. Unfortunately it required defactoring to work. So it couldn't be used as part of a defactoring solution itself.
duality in LA and VEA
RTT could be said to be practiced in two major flavors: LA, or Linear Algebra, and VEA, or Varianced Exterior Algebra. The former uses only vectors, covectors, and matrices. The latter uses multivectors and multicovectors instead of matrices, where a key example of a multivector is a "wedgie". Each RTT flavor has a notion of a dual.
LA's dual it is the null-space operation, which takes you back and forth between the two matrix representations of a temperament: its mapping and its comma-basis[32]. VEA's dual, on the other hand, is closely related to the Grassman/orthogonal complement in exterior algebra as well as the complement operation from MLA (multilinear algebra) which is sometimes referred to as the "Hodge dual" or "Hodge star", and it takes you back and forth between the two multi(co)vector representations of a temperament: the multimap and the multicomma.
One of the primary motivations for developing a canonical form for mappings (and comma-bases) was to achieve for the LA flavor of RTT a key thing it was missing that the VEA flavor had: a way to uniquely identify temperaments. In VEA, this was easy, because any enfactoring would be readily identifiable as a GCD>1 in the multimap or multicomma. In fact, the definition of the "wedgie" calls for removing such GCDs when computing it from a mapping.
Something that was observed while developing the canonical form for LA was that the dual operation for LA, null-space, eliminated any enfactoring. On the other hand, the dual operation for VEA preserves it. This might be another strike against VEA.
However, because the VEA wedgie calls for removing GCDs, we can assume that its dual would also build in the removal of any GCD. So it's not really an additional strike.
It could be construed as an extra point for LA, however, because it shows how its dual operation automatically eliminates the pathological aspect of enfactoring. This captures the truth of how an enfactored mapping has no effect on tempered commas, and vice versa.
references
- ↑ According to the Wikipedia page for 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 because dividing rows is not a permitted elementary row operation when computing the HNF. See: https://math.stackexchange.com/a/685922
- ↑ According to saturation, "...if [an RTT matrix] isn't saturated the supposed temperament it defines may be regarded as pathological..."
- ↑ As Graham Breed writes here, "Whether temperaments with contorsion should even be thought of as temperaments is a matter of debate."
- ↑ Many, many other terms were considered before arriving at defactored and enfactored, including but not limited to: repeated, (up/down)sampled, decimated, divided/multiplied, divisive/multiplicative, completed/depleted/repleted/pleated, efficient, brown, dry, spongy/holey, fluffy, corrugated, copied, shredded, tupled, tupletted, enphactored (where the ph stood for possibly hidden)...
- ↑ See: https://yahootuninggroupsultimatebackup.github.io/tuning-math/topicId_18026.html and https://doc.sagemath.org/html/en/reference/search.html?q=index_in_saturation. There's also https://doc.sagemath.org/html/en/reference/matrices/sage/matrix/matrix_integer_dense_saturation.html, which refers to an "index in saturation" which appears to be the common factor:
sage: C
[11 16 21]
[19 26 33]
sage: C.index_in_saturation()
18
sage: S = saturation(C); S
[11 16 21]
[-2 -3 -4]
sage: S.index_in_saturation()
1
Indeed 18 is the common factor in [⟨11 16 21] ⟨19 26 33]⟩. - ↑ See https://math.stackexchange.com/questions/1964814/linear-transformation-of-a-saturated-vector and https://faculty.uml.edu//thu/tcs01-june.pdf
- ↑ Here is the tuning list post where it was coined by Paul Erlich: https://yahootuninggroupsultimatebackup.github.io/tuning-math/topicId_2033.html#2456
- ↑ Authors note: to be absolutely clear, I don’t care who said what or how misconceptions arose (except insofar as it helps dispel any further misconceptions, some of which certainly may be my own). I have basically infinite sympathy for anyone who gets confused over this topic. It took my good friend Dave and I months of back and forth theorization, argumentation, and diagramming before we were able to settle on an explanation we both understood and agreed upon. I am not intending to get in the business of slinging blame (or credit) around. As far as I’m concerned, as long as we can have meaningful discussion with each other, and hopefully eventually arrive at conclusions that are more musically and intellectually empowering than we had previously, then we’re doing well together. Would I have make these mistakes myself? Yes! I have literally dozens of recent emails proving that I would have gone for the same duality myself, due to a case of asymmetry-phobia.
- ↑ See: https://yahootuninggroupsultimatebackup.github.io/tuning-math/topicId_2937 which is also referred to here http://tonalsoft.com/enc/t/torsion.aspx
- ↑ See: https://yahootuninggroupsultimatebackup.github.io/tuning-math/topicId_2033.html#2405
- ↑ Perhaps we call it a "shredded periodicity block", due to the way how the paths that the multiple parallel generators take around the block look like shreds of paper, were the periodicity block imagined as a sheet of paper run through a paper shredder.
- ↑ Furthermore, care should be taken to recognize the difference in behavior between, say
[math]\displaystyle{ \left[ \begin{array} {r} -8 & -30 \\ 8 & -3 \\ -2 & 15\\ \end{array} \right] }[/math]
when it is used as a list of 5-limit commas defining a periodicity block versus when it is used as a comma basis for a temperament, namely, that in the first case the fact that the first column has a common factor of 2 and the second column has a common factor of 3 is meaningful, i.e. the 2-enfactorment will affect one dimension of the block and the 3-enfactorment will affect a different dimension of the block, or in other words, we can say that the commas here are individually enfactored rather than the entire list being enfactored, while in the second case there is no such meaning to the individual columns' factors of 2 and 3, respectively, because it would be equivalent of any form where the product of all the column factors was 6, or in other words, all that matters is that the comma-basis as a whole is 6-enfactored here. So perhaps it would be best if, for periodicity blocks, the term "enfactored" was avoided altogether, and instead commas were described as "2-torted". - ↑ The explanation for "why 'torsion' in the first place?" is interesting. It comes from group theory (see: https://en.wikipedia.org/wiki/Group_(mathematics)#Uniqueness_of_identity_element). In group theory, to have torsion, a group must have an element that comes back to zero after being chained 2 or more times. The number of times before coming back to zero is called the "order" of the element, sometimes also called the "period length" or "period". When the order is greater than 1 (and less than infinity), the element is said to have torsion, or to be a torsion element, and so the group it is an identity element of is said to have torsion. See also: https://en.wikipedia.org/wiki/Order_(group_theory). Clearly we can't use period (length) because period has another firmly established meaning in xenharmonics. But we could refer to torsion as "finite order greater than one", but that's quite the mouthful while still nearly as obscure.
- ↑ In this field, it does definitely represent twisting, like in a Möbius strip. Also, DG contorsion is related to DG torsion by subtraction, not duality.
- ↑ If it was meant to most strongly evoke duality with torsion, it should have been spelled "cotorsion". Naming it "contorsion" is an annoying step toward "contortion" but stopping halfway there. But this isn't a strong point, because duality with torsion was the false assumption mentioned above.
- ↑ such as in Kite Giedraitis's writings on color notation, which read "it's possible that there is both torsion and contorsion"
- ↑ but the name comes from a different Smith: Henry John Stephen Smith, for whom the Smith normal form is named, which this method uses
- ↑ named for Charles Hermite, who was French, by the way, and so his name is pronounced more like err-MEET, not like HER-might
- ↑
Using the following code in Wolfram Language:
hermiteUnimodular[m_]:=Transpose[First[HermiteDecomposition[Transpose[m]]]]
columnEchelonDefactor[m_]:=Take[Inverse[hermiteUnimodular[m]],MatrixRank[m]]
rightReducingMatrix[m_] := Last[SmithDecomposition[m]]
smithDefactor[m_] := Take[Inverse[rightReducingMatrix[m]], MatrixRank[m]]
ms = {};
Do[
d = RandomInteger[{2,6}];
r = RandomInteger[{1,d}];
m = RandomInteger[{-99,99},{r,d}];
ms = Join[ms, {m}],
1000
]
AbsoluteTiming[Do[smithDefactor[m],{m,ms}]]
The first several results for Smith defactoring took (in ms) 3.55919, 3.45199, 3.58493, 3.63464, 3.80917, 3.77151, while the first several results for column Hermite defactoring took 3.30063, 3.39137, 3.33808, 3.21195, 3.16469, 3.20419. So this suggests a slight edge for column Hermite defactoring. - ↑ Any form that enforces pivots all be 1's would fail this criteria.
- ↑ The name "echelon" is a French word for a military troop formation with a similar triangular shape: https://en.wikipedia.org/wiki/Echelon_formation.
- ↑ Note that the definition of REF is inconsistent and sometimes it includes some of the constraints of RREF, discussed further below. See: https://www.statisticshowto.com/matrices-and-matrix-algebra/reduced-row-echelon-form-2/
- ↑ REF also requires that all rows that are entirely zeros should appear at the bottom of the matrix. However this rule is only relevant for rank-deficient matrices. We'll be assuming all matrices here are full-rank, so we don't have to worry about this.
- ↑ Alternatively, IRREF can be computed by finding the null-space of a mapping, or in other words, the corresponding comma-basis for the temperament represented by the mapping, and then in turn taking the null-space of the comma-basis to get back to an equivalent mapping. The relationship between the process for finding the IRREF from the RREF and this process is not proven, but thousands of automated tests run as an experiment strongly suggest that these two techniques are equivalent.
rref[m_] := RowReduce[m]
multByLcd[row_] := Apply[LCM,Denominator[row]]*row
irref[m_] := Map[multByLcd,rref[m]]
nullSpaceAndBack[m_]:=Reverse[NullSpace[Reverse[NullSpace[m],2]],2]
output = "";
Do[
d = RandomInteger[{2,6}];
r = RandomInteger[{1,d-1}];
m = RandomInteger[{-99,99},{r,d}];
n = nullSpaceAndBack[m];
i = irref[m];
If[n!=i,output = output <> "bad" <> n <> i, output = output <> "ok "],
10000
]
Print[output]
There is a difference in that IRREF does not remove rows of zeros in the end for rank-deficient mappings, while this "nullspace'n'back" does, but for most normal cases, they're the same. - ↑ Also, it will always still satisfy the second aspect of reduced, i.e. that all other entries in pivot columns besides the pivots are zeroes.
- ↑ The exact criteria for HNF are not always consistently agreed upon, however.
- ↑ 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 normalization constraint and the 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. 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.
- ↑ We are using "row-style" Hermite Normal Form here, not "column-style"; the latter would involve simply flipping everything 90 degrees so that the echelon requirement was that pivots be strictly below the pivots in the previous column, and that pivot rows are considered for the normalization constraint rather than pivot columns.
- ↑ Here is a useful resource for computing the Smith Normal Form manually, if you are interested: https://math.stackexchange.com/questions/133076/computing-the-smith-normal-form
- ↑ AKA 165b⁴c¹⁹&231b⁶c²⁴, which tempers out the 7.753¢ comma [-131 131 -33⟩!
- ↑ with the stipulation that the anti-null-space operation that gets you from the comma-basis back to the mapping requires an anti-transpose sandwich.