Douglas Blumeyer's RTT How-To: Difference between revisions

Cmloegcmluin (talk | contribs)
m rank and nullity: link up nullity
Cmloegcmluin (talk | contribs)
m multi(co)vectors: improve formatting
Line 1,029: Line 1,029:
First I’ll list the steps. Don’t worry if it doesn’t all make sense the first time. We’ll work through an example and go into more detail as we do.
First I’ll list the steps. Don’t worry if it doesn’t all make sense the first time. We’ll work through an example and go into more detail as we do.


Take each combination of <span><math>r</math></span> primes where <span><math>r</math></span> is the rank, sorted in lexicographic order, e.g. (2,3,5), (2,3,7), (2,5,7), (3,5,7). Now convert each of those combinations to a square <span><math>r×r</math></span> matrix by slicing a column for each prime out of the mapping and putting them together. Now take each matrix's determinant. Extract the GCD from the resulting sequence of scalars, then set them inside <span><math>r</math></span> brackets, and you've got your multicovector.
Take each combination of <span><math>r</math></span> primes where <span><math>r</math></span> is the rank, sorted in lexicographic order, e.g. <span><math>(2,3,5)</math></span>, <span><math>(2,3,7)</math></span>, <span><math>(2,5,7)</math></span>, <span><math>(3,5,7)</math></span>. Now convert each of those combinations to a square <span><math>r×r</math></span> matrix by slicing a column for each prime out of the mapping and putting them together. Now take each matrix's determinant. Extract the GCD from the resulting sequence of scalars, then set them inside <span><math>r</math></span> brackets, and you've got your multicovector.


Let’s work through the meantone example.
Let’s work through the meantone example.
Line 1,035: Line 1,035:
We have rank <span><math>r</math></span> = 2, so we’re looking for every combination of two primes. That’s out of the three total primes we have in the 5-limit: 2, 3, and 5. So those combinations are <span><math>(2,3)</math></span>, <span><math>(2,5)</math></span>, and <span><math>(3,5)</math></span>. Those are already in lexicographic order, or in other words, just like how alphabetic order works, but generalized to work for size of numbers too (so that 11 comes after 2, not before).
We have rank <span><math>r</math></span> = 2, so we’re looking for every combination of two primes. That’s out of the three total primes we have in the 5-limit: 2, 3, and 5. So those combinations are <span><math>(2,3)</math></span>, <span><math>(2,5)</math></span>, and <span><math>(3,5)</math></span>. Those are already in lexicographic order, or in other words, just like how alphabetic order works, but generalized to work for size of numbers too (so that 11 comes after 2, not before).


Now each of those combinations becomes a square matrix, made out of bits from the mapping:
Here's the meantone mapping again, with some color applied which should help identify the combinations:
 
<math>
\begin{bmatrix}
\color{red}1 & \color{lime}0 & \color{blue}-4 \\
\color{red}0 & \color{lime}1 & \color{blue}4 \\
\end{bmatrix}
</math>
 
So now each of those combinations becomes a square matrix, made out of bits from the mapping, which again is:


<math>
<math>
\begin{array}{ccc}
\begin{array}{ccc}
   \text{(2,3)} & \text{(2,5)} & \text{(3,5)} \\
   \text{(2,3)} & \text{(2,5)} & \text{(3,5)} \\
   \begin{bmatrix}1 & 0 \\ 0 & 1 \end{bmatrix} & \begin{bmatrix}1 & -4 \\ 0 & 4 \end{bmatrix} & \begin{bmatrix}0 & -4 \\ 1 & 4 \end{bmatrix}
   \begin{bmatrix}\color{red}1 & \color{lime}0 \\ \color{red}0 & \color{lime}1 \end{bmatrix} & \begin{bmatrix}\color{red}1 & \color{blue}-4 \\ \color{red}0 & \color{blue}4 \end{bmatrix} & \begin{bmatrix}\color{lime}0 & \color{blue}-4 \\ \color{lime}1 & \color{blue}4 \end{bmatrix}
\end{array}
\end{array}
</math>
</math>
Line 1,109: Line 1,118:
In natural language, that’s each element of the first row times the determinant of the square matrix from the other two columns and the other two rows, summed but with an alternating pattern of negation beginning with positive. If you ever need to do determinants of matrices bigger than 3×3, see [https://www.mathsisfun.com/algebra/matrix-determinant.html this webpage]. Or, you can just use an online calculator. Type <code>determinant[{{1,0,1},{0,1,1},{0,0,-2}}]</code> into [https://wolframalpha.com wolframalpha.com] and it’ll spit out -2 at you.
In natural language, that’s each element of the first row times the determinant of the square matrix from the other two columns and the other two rows, summed but with an alternating pattern of negation beginning with positive. If you ever need to do determinants of matrices bigger than 3×3, see [https://www.mathsisfun.com/algebra/matrix-determinant.html this webpage]. Or, you can just use an online calculator. Type <code>determinant[{{1,0,1},{0,1,1},{0,0,-2}}]</code> into [https://wolframalpha.com wolframalpha.com] and it’ll spit out -2 at you.


And so our results are <span><math>-2</math></span>, <span><math>3</math></span>, <span><math>1</math></span>, <span><math>-11</math></span>. At first glance we don’t have a GCD, but there is a slight trick here. We prefer for the first term to be positive. It doesn’t make a difference, but is a way to normalize things (we could have found the result where the first term came out positive by simply changing the order of the rows of our mapping, which doesn’t affect how the mapping works at all). So, we can simply think of this as extracting a GCD of -1, and our list ends up as 2, -3, -1, 11. Finally, set these inside triply-nested brackets, because it’s a tricovector for a rank-3 temperament, and we get {{multival|rank=3|2 -3 -1 11}}.
And so our results are <span><math>-2</math></span>, <span><math>3</math></span>, <span><math>1</math></span>, <span><math>-11</math></span>. At first glance we don’t have a GCD, but there is a slight trick here. We prefer for the first term to be positive. It doesn’t make a difference, but is a way to normalize things (we could have found the result where the first term came out positive by simply changing the order of the rows of our mapping, which doesn’t affect how the mapping works at all). So, we can simply think of this as extracting a GCD of -1, and our list ends up as <span><math>2</math></span>, <span><math>-3</math></span>, <span><math>-1</math></span>, <span><math>11</math></span>. Finally, set these inside triply-nested brackets, because it’s a tricovector for a rank-3 temperament, and we get {{multival|rank=3|2 -3 -1 11}}.


As for getting from the multicovector back to the mapping, you can solve a system of equations for that. Though it’s not easy and there may not be a unique solution. And you probably will never have the multicovector without the mapping anyway.
As for getting from the multicovector back to the mapping, you can solve a system of equations for that. Though it’s not easy and there may not be a unique solution. And you probably will never have the multicovector without the mapping anyway.
Line 1,127: Line 1,136:
To demonstrate these points, let’s first calculate the multivector from a comma basis, and then confirm it by calculating the same multivector as the complement of its dual multicovector.
To demonstrate these points, let’s first calculate the multivector from a comma basis, and then confirm it by calculating the same multivector as the complement of its dual multicovector.


Here’s the comma basis for meantone: {{val|{{monzo|-4 4 -1}}}}. Calculating the multivector is almost the same as calculating the multicovector. The only difference is that as a preliminary step you must transpose the matrix, or in other words, exchange rows and columns. In our bracket notation, that just looks like replacing {{val|{{monzo|-4 4 -1}}}} with {{monzo|{{val|-4 4 -1}}}}. Now we can see that this is just like our ET map example from the previous section: basically an identity operation, breaking the thing up into three 1×1 matrices [-4] [4] [-1] which are their own determinants and then nesting back inside one layer of brackets because nullity is 1. So we have {{monzo|-4 4 -1}}. Except, be careful! We can’t skip the step where we extract the GCD, which in this case is -1 again, so the multivector (a monovector) is actually {{monzo|4 -4 1}}. By the way, we write this operation with a different symbol; it’s upside down from the exterior product, and so is called the interior product, and uses ∨, which is great because that’s also the logical operator for “or” which matches with the intersection of commas using the “|” operator which also means “or”.
Here’s the comma basis for meantone: {{val|{{monzo|-4 4 -1}}}}. Calculating the multivector is almost the same as calculating the multicovector. The only difference is that as a preliminary step you must transpose the matrix, or in other words, exchange rows and columns. In our bracket notation, that just looks like replacing {{val|{{monzo|-4 4 -1}}}} with {{monzo|{{val|-4 4 -1}}}}. Now we can see that this is just like our ET map example from the previous section: basically an identity operation, breaking the thing up into three 1×1 matrices <span><math>\begin{bmatrix}-4\end{bmatrix} \begin{bmatrix}4\end{bmatrix} \begin{bmatrix}-1\end{bmatrix}</math></span> which are their own determinants and then nesting back inside one layer of brackets because nullity is 1. So we have {{monzo|-4 4 -1}}. Except, be careful! We can’t skip the step where we extract the GCD, which in this case is -1 again, so the multivector (a monovector) is actually {{monzo|4 -4 1}}. By the way, we write this operation with a different symbol; it’s upside down from the exterior product, and so is called the interior product, and uses ∨, which is great because that’s also the logical operator for “or” which matches with the intersection of commas using the “|” operator which also means “or”.


Now let’s see how to do the complement operation.
Now let’s see how to do the complement operation.


# Find the rank, halved, rounded up. In our case, ceil(r/2) = ceil(2/2) = ceil(1) = 1. Save that result for later. Let’s call it <span><math>x</math></span>.
# Find the rank, halved, rounded up. In our case, <span><math>ceil(r/2) = ceil(2/2) = ceil(1) = 1</math></span>. Save that result for later. Let’s call it <span><math>x</math></span>.
# Find the lexicographic combinations of <span><math>r</math></span> primes again: (2,3), (2,5), (3,5). Except this time we don’t want the primes themselves, but their indices in the list of primes. So: (1,2), (1,3), (2,3).
# Find the lexicographic combinations of <span><math>r</math></span> primes again: (2,3), (2,5), (3,5). Except this time we don’t want the primes themselves, but their indices in the list of primes. So: <span><math>(1,2)</math></span>, <span><math>(1,3)</math></span>, <span><math>(2,3)</math></span>.
# Take the sums of these sets of indices, and to each sum, also add x. So 1+2+x, 1+3+x, 2+3+x = 1+2+1, 1+3+1, 2+3+1 = 4, 5, 6.
# Take the sums of these sets of indices, and to each sum, also add <span><math>x</math></span>. So <span><math>1+2+x</math></span>, <span><math>1+3+x</math></span>, <span><math>2+3+x</math></span> = <span><math>1+2+1</math></span>, <span><math>1+3+1</math></span>, <span><math>2+3+1</math></span> = <span><math>4</math></span>, <span><math>5</math></span>, <span><math>6</math></span>.
# Raise -1 to the exponent of these values. -1⁴, -1⁵, -1⁶ = 1, -1, 1.
# Raise -1 to the exponent of these values. -1⁴, -1⁵, -1⁶ = 1, -1, 1.
# Multiply each term of the multicovector by these values. 1×1, 4×-1, 4×1, = 1, -4, 4.
# Multiply each term of the multicovector by these values. 1×1, 4×-1, 4×1, = 1, -4, 4.
Line 1,345: Line 1,354:
So we now understand how to get to multicovectors. And we understand that they uniquely identify the temperament. But what about the individual terms — do they mean anything in and of themselves? It turns out: yes!
So we now understand how to get to multicovectors. And we understand that they uniquely identify the temperament. But what about the individual terms — do they mean anything in and of themselves? It turns out: yes!


The first thing to understand is that each term of the multicovector pertains to a different combination of primes. We already know this: it’s how we calculated it from the mapping matrix. For example, in the multicovector for meantone, {{multival|1 4 4}}, the 1 is for (2,3), the first 4 is for (2,5), and the second 4 is for (3,5).
The first thing to understand is that each term of the multicovector pertains to a different combination of primes. We already know this: it’s how we calculated it from the mapping matrix. For example, in the multicovector for meantone, {{multival|1 4 4}}, the 1 is for <span><math>(2,3)</math></span>, the first 4 is for <span><math>(2,5)</math></span>, and the second 4 is for <span><math>(3,5)</math></span>.


Now, let’s convert every term of the multicovector by taking its absolute value and its inverse. In this case, all of our terms are already positive, so that has no effect. But taking the inverse converts us to 1/1, 1/4, 1/4. These values tell us what fraction of the tempered lattice we can generate using the corresponding combination of primes.
Now, let’s convert every term of the multicovector by taking its absolute value and its inverse. In this case, all of our terms are already positive, so that has no effect. But taking the inverse converts us to 1/1, 1/4, 1/4. These values tell us what fraction of the tempered lattice we can generate using the corresponding combination of primes.
Line 1,361: Line 1,370:


[[File:RTT clean 3.png|800px|center|thumb|'''Figure 5b.''' Diagram of core RTT concepts.]]
[[File:RTT clean 3.png|800px|center|thumb|'''Figure 5b.''' Diagram of core RTT concepts.]]


== lattices (TBD) ==
== lattices (TBD) ==