Cross-domain temperament merging: Difference between revisions

Cmloegcmluin (talk | contribs)
m Cmloegcmluin moved page Temperament merging across interval bases to Cross-domain temperament merging: terminology reform within Dave Keenan and Douglas Blumeyer's work; interval basis → domain basis, as it better conveys the fact that these intervals have not yet been tempered
Cmloegcmluin (talk | contribs)
significant terminological preference shifts per drafting of Dave Keenan & Douglas Blumeyer's guide to RTT
Line 1: Line 1:
It is possible to [[temperament merging|merge]] [[regular temperament]]s that are defined in separate [[Interval_basis|interval subspaces]].  
It is possible to [[temperament merging|merge]] [[regular temperament]]s that are defined in separate [[Domain_basis|domains]].  


= Steps =
= Steps =


== 1. Determine the interval basis for the output temperament ==
== 1. Determine the domain basis for the output temperament ==


A guiding principle when performing a temperament merge across interval subspaces is [[Temperament_merging#Application|described on the main page for temperament merging]]:
A guiding principle when performing a temperament merge across domains is [[Temperament_merging#Application|described on the main page for temperament merging]]:


<blockquote style="background-color: #fbfbfb; border: 1px solid #eeeeee; padding: 10px 20px;">
<blockquote style="background-color: #fbfbfb; border: 1px solid #eeeeee; padding: 10px 20px;">
Line 15: Line 15:
From this, we can make some helpful statements:
From this, we can make some helpful statements:


''For a comma-merge'', because the output temperament deals with every comma, then its interval basis must be capable of supporting this: specifically, it must include every formal prime from any of the input temperaments' interval bases. Think of it this way: for any given temperament, its interval basis's formal primes are the building blocks for its commas, and so in order to express every comma in the merged temperament, we will need every input temperament's building blocks gathered in one place. In other words, we must find the merge of all the input interval bases.
''For a comma-merge'', because the output temperament deals with every comma, then its domain basis must be capable of supporting this: specifically, it must include every basis element from any of the input temperaments' domain bases. Think of it this way: for any given temperament, its domain basis elements are the building blocks for its commas, and so in order to express every comma in the merged temperament, we will need every input temperament's building blocks gathered in one place. In other words, we must find the merge of all the input domain bases.


''For a map-merge'', then, because the output temperament will deal only with tempered commas shared by every input temperament, then its interval basis only needs to include the formal primes that are present in all of the input interval bases. Here's why: a comma built using a formal prime that isn't shared by all input temperaments couldn't even be ''built'' in all input temperaments, let alone tempered out by all of them. And so, to build the set of commas that are tempered out by all temperaments, we only need the building blocks that can be found in all of them. In mathematical terms, we must find the intersection of the input interval bases.
''For a map-merge'', then, because the output temperament will deal only with tempered commas shared by every input temperament, then its domain basis only needs to include the basis elements that are present in all of the input domain bases. Here's why: a comma built using a basis element that isn't shared by all input temperaments couldn't even be ''built'' in all input temperaments, let alone tempered out by all of them. And so, to build the set of commas that are tempered out by all temperaments, we only need the building blocks that can be found in all of them. In mathematical terms, we must find the intersection of the input domain bases.


<gallery heights=450px widths=450px>
<gallery heights=450px widths=450px>
File:Map-merge across interval bases.png|450px|none|thumb|A map-merge across interval bases gives a comma-intersection and an interval basis intersection (for purposes of illustrating this concept, the results are not being canonicalized).
File:Map-merge across interval bases.png|450px|none|thumb|A map-merge across domain bases gives a comma-intersection and a domain basis intersection (for purposes of illustrating this concept, the results are not being canonicalized).
File:Comma-merge across interval bases.png|450px|none|thumb|A comma-merge across interval bases gives a map-intersection and an interval basis merge (for purposes of illustrating this concept, the results are not being canonicalized).
File:Comma-merge across interval bases.png|450px|none|thumb|A comma-merge across domain bases gives a map-intersection and a domain basis merge (for purposes of illustrating this concept, the results are not being canonicalized).
</gallery>
</gallery>


== 2. Convert the input temperaments to the output interval basis ==
== 2. Convert the input temperaments to the output domain basis ==


After determining the target interval basis, follow the instructions described here to convert the input temperament over: [[Temperament merging across interval bases#Changing interval basis]].
After determining the target domain basis, follow the instructions described here to convert the input temperament over: [[Cross-domain temperament merging#Changing basis]].


== 3. Perform the merge as usual ==
== 3. Perform the merge as usual ==
Line 32: Line 32:
See the instructions described here to perform the temperament merge: [[Temperament merging#Merging]].
See the instructions described here to perform the temperament merge: [[Temperament merging#Merging]].


= Interval subspaces as subspaces of other interval subspaces =
= Domains as subspaces of other domains =


In the same way that an ''sub''space is a part of the full space, a subspace can be seen as a part of another larger subspace. So we can say an interval subspace is itself ''a subspace of'' another interval subspace.  
In the same way that an ''sub''space is a part of the full space, a subspace can be seen as a part of another larger subspace. So we can say a domain is itself ''a subspace of'' another domain.  


Any given interval subspace will be a subspace of infinitely many other interval subspaces.
Any given domain will be a subspace of infinitely many other domains.


== Examples ==
== Examples ==


[[File:Interval subspaces 2.3 vs 2.3.7.png|300px|thumb|right|'''Figure 1.''' The interval subspace 2.3 can be clearly seen to be a subspace of 2.3.7. The latter is simply many copies of the former, separated by 7's.]]
[[File:Interval subspaces 2.3 vs 2.3.7.png|300px|thumb|right|'''Figure 1.''' The domain 2.3 can be clearly seen to be a subspace of 2.3.7. The latter is simply many copies of the former, separated by 7's.]]


For example, the 2.3 interval subspace is a subspace of the 2.3.7 interval subspace; this is clearly apparent, because the 2.3.7 interval subspace is the same as the 2.3 interval subspace except with the addition of a new formal prime, 7 (see Figure 1).  
For example, the 2.3 domain is a subspace of the 2.3.7 domain; this is clearly apparent, because the 2.3.7 domain is the same as the 2.3 domain except with the addition of a new basis element, 7 (see Figure 1).  


[[File:Interval subspaces 2.9 vs 2.3.png|300px|thumb|right|'''Figure 2.''' Here we can see how the interval subspace 2.9 is a subspace of 2.3. The latter is simply two copies of the former, offset by 3.]]
[[File:Interval subspaces 2.9 vs 2.3.png|300px|thumb|right|'''Figure 2.''' Here we can see how the domain 2.9 is a subspace of 2.3. The latter is simply two copies of the former, offset by 3.]]


For a perhaps less obvious example, the 2.9.5 interval subspace is a subspace of the 2.3.5 interval subspace; this may be surprising, because 2.9.5 is the one with a ''larger'' formal prime, but what this actually means is that it spans a ''smaller'' subspace, because while 2.3.5 contains all intervals with ''any'' power of 3, 2.9.5 contains only ''half'' of those, specifically those with ''even'' powers of 3, i.e., powers of 9 (see Figure 2).
For a perhaps less obvious example, the 2.9.5 domain is a subspace of the 2.3.5 domain; this may be surprising, because 2.9.5 is the one with a ''larger'' basis element, but what this actually means is that it spans a ''smaller'' subspace, because while 2.3.5 contains all intervals with ''any'' power of 3, 2.9.5 contains only ''half'' of those, specifically those with ''even'' powers of 3, i.e., powers of 9 (see Figure 2).


Sometimes, neither interval subspace is a subspace of the other. Consider 2.3.5 and 2.3.7: the former lacks a 7, and the latter lacks a 5.
Sometimes, neither domain is a subspace of the other. Consider 2.3.5 and 2.3.7: the former lacks a 7, and the latter lacks a 5.


== Application: determining whether it is possible to change the interval subspace ==
== Application: determining whether it is possible to change the domain ==


Understanding which interval subspaces are subspaces of each other is important when changing the interval subspace for an interval or temperament. This is because only certain changes are possible: specifically, it is only possible to change between interval subspaces where one is a subspace of the other. Otherwise, the interval subspaces are incomparable.  
Understanding which domains are subspaces of each other is important when changing the domain for an interval or temperament. This is because only certain changes are possible: specifically, it is only possible to change between domains where one is a subspace of the other. Otherwise, the domains are incomparable.  


We then have further constraints, depending on which type of object we're changing the interval subspace for:
We then have further constraints, depending on which type of object we're changing the domain for:


* For objects that are made of intervals — such as individual intervals themselves, or comma bases — we can only change in the direction from the subspace to the ''super''space. This is because unless the target interval subspace completely contains the original interval subspace, there's no guarantee that we'll still have all the formal prime building blocks that we need to represent our intervals.
* For objects that are made of intervals — such as individual intervals themselves, or comma bases — we can only change in the direction from the subspace to the ''super''space. This is because unless the target domain completely contains the original domain, there's no guarantee that we'll still have all the basis element building blocks that we need to represent our intervals.
* For objects that are made of [[map]]s, i.e. mappings, the opposite is true: we can only change from the superspace to the subspace. Think of it this way: maps are functions, and they only claim to know what to do with inputs from within their given domain, and their domain is the interval subspace. So we can restrict their behavior just fine, because there's no question about what they do with inputs that don't happen to use every available building block from their domain. But there's no unambiguous way to say what they should do with any inputs that use building blocks from outside that domain, if we were to try to expand it.
* For objects that are made of [[map]]s, i.e. mappings, the opposite is true: we can only change from the superspace to the subspace. Think of it this way: maps are functions, and they only claim to know what to do with inputs from within their given domain, and their domain is the domain. So we can restrict their behavior just fine, because there's no question about what they do with inputs that don't happen to use every available building block from their domain. But there's no unambiguous way to say what they should do with any inputs that use building blocks from outside that domain, if we were to try to expand it.


These two types of objects are in fact the only two types of objects we need to worry about in RTT. The technical term for the difference between these two types of objects is [[variance]]. There are only two variances: contravariant, and covariant. Intervals are contravariant, and maps are covariant.
These two types of objects are in fact the only two types of objects we need to worry about in RTT. The technical term for the difference between these two types of objects is [[variance]]. There are only two variances: contravariant, and covariant. Intervals are contravariant, and maps are covariant.


So from these two opposing bulleted facts above, we can conclude that any for pair of interval subspaces where neither one is a subspace of the other, there would be no way for us to express ''either intervals or maps'' from one in the other. And that's why we could say that they're incomparable interval subspaces.
So from these two opposing bulleted facts above, we can conclude that for any pair of domains where neither one is a subspace of the other, there would be no way for us to express ''either intervals or maps'' from one in the other. And that's why we could say that they're incomparable domains.


== General method to determine whether an interval subspace is a subspace of another ==
Notably, there is still a way to get intervals to a subspace, and maps to a superspace, but it's indirect. To do so, take the [[dual]] of your object, then change basis, then take the [[dual]] again. So for a mapping you would use the nullspace function to convert it to its corresponding comma basis, change domain basis, and then use the antinullspace function to convert it back to its corresponding mapping on the other side.


[[Temperament merging across interval bases#Examples|A couple subsections ago]], we provided a couple examples where we used natural language to explain — between two interval subspaces — which one was a subspace of the other. But we still need to describe a method to determine this in general. Let's do that next.
== General method to determine whether a domain is a subspace of another ==


We can say that an interval subspace <math>\textbf{b}_1</math> is a subspace of another interval subspace <math>\textbf{b}_2</math> if when we merge <math>\textbf{b}_1</math> and <math>\textbf{b}_2</math> we just get <math>\textbf{b}_2</math> again. In layperson's terms, if <math>\textbf{b}_1</math> brings nothing to the table that <math>\textbf{b}_2</math> hasn't already brought, then it is completely contained by <math>\textbf{b}_2</math> and therefore is a subspace of it.
[[Cross-domain temperament merging#Examples|A couple subsections ago]], we provided a couple examples where we used natural language to explain — between two domains — which one was a subspace of the other. But we still need to describe a method to determine this in general. Let's do that next.


For more information on merging interval bases, see [[Temperament merging across interval bases#Merging]].
We can say that a domain with basis <math>B_1</math> is a subspace of another domain with basis <math>B_2</math> if when we merge <math>B_1</math> and <math>B_2</math> we just get <math>B_2</math> again. In layperson's terms, if <math>B_1</math> brings nothing to the table that <math>B_2</math> hasn't already brought, then it is completely contained by <math>B_2</math> and therefore is a subspace of it.
 
For more information on merging domain bases, see [[Cross-domain temperament merging#Merging]].


=== Example ===
=== Example ===
Line 75: Line 77:
For instance, we can demonstrate how 2.25/9.11/7 is a subspace of 2.5/3.7.11 using this approach. If you've really got a knack for this stuff, you may be able to eyeball even this somewhat intense example, but it's obviously good to have a rigorous method like this to fall back on, if only to convince ourselves that we've got the right answer (or to automate things with code, as has been done with these methods in the [[RTT library in Wolfram Language]]).
For instance, we can demonstrate how 2.25/9.11/7 is a subspace of 2.5/3.7.11 using this approach. If you've really got a knack for this stuff, you may be able to eyeball even this somewhat intense example, but it's obviously good to have a rigorous method like this to fall back on, if only to convince ourselves that we've got the right answer (or to automate things with code, as has been done with these methods in the [[RTT library in Wolfram Language]]).


So, first, we do the first step of merging interval bases: concatenate them. That gets us 2.25/9.11/7.2.5/3.7.11.
So, first, we do the first step of merging domain bases: concatenate them. That gets us 2.25/9.11/7.2.5/3.7.11.


The next step of merging is to canonicalize. To begin that, we convert our interval basis to a formal primes matrix <math>F</math>. Here, we've labeled the columns with the number-list representation of the formal primes of this interval basis, to help show the correspondence, as well as the rows with the primes these formal primes factor into:
The next step of merging is to canonicalize. To begin that, we represent our basis as a matrix, naturally called our '''basis matrix''' <math>B</math>. Here, we've labeled the columns with the number-list representation of the basis elements, to help show the correspondence, as well as the rows with the primes these basis elements factor into:




Line 162: Line 164:
And so when we convert this back to the typical list of numbers form, we have 2.5/3.7.11 again. So this tells us that 2.25/9.11/7 is totally contained by 2.5/3.7.11, and so it's a subspace of it.
And so when we convert this back to the typical list of numbers form, we have 2.5/3.7.11 again. So this tells us that 2.25/9.11/7 is totally contained by 2.5/3.7.11, and so it's a subspace of it.


= Interval basis operations =
= Domain basis operations =


== Merging ==
== Merging ==


If you happen to already be familiar with [[temperament merging]], merging<ref>The technical mathematical term for this is "sumset", not "union" as we might expect; in many contexts, "union" is the dual operation to "intersection", but for vector spaces, the dual operation to intersection is "sumset" (see page 4 of https://www2.math.upenn.edu/~siegelch/Notes/linalg.pdf). The difference between union and sumset can be explained like this: if we had two planes in a volume, their union would be both the planes, but their sumset would be the volume.</ref> interval bases follows a similar pattern: concatenate, then canonicalize the result.
If you happen to already be familiar with [[temperament merging]], merging<ref>The technical mathematical term for this is "sumset", not "union" as we might expect; in many contexts, "union" is the dual operation to "intersection", but for vector spaces, the dual operation to intersection is "sumset" (see page 4 of https://www2.math.upenn.edu/~siegelch/Notes/linalg.pdf). The difference between union and sumset can be explained like this: if we had two planes in a volume, their union would be both the planes, but their sumset would be the volume.</ref> domain bases follows a similar pattern: concatenate, then canonicalize the result.


=== But first: a gentle introduction ===
=== But first: a gentle introduction ===


Many times, it's easy to eyeball the merge of two interval bases. The basic idea is to just take everything that's in either one basis or the other. So 2.3.7 merged with 2.3.5 should just be 2.3.5.7, easy. Sometimes it can get kind of tricky, though. Like, what's the merge of 2.3.7/5 and 2.9.21/5? Not so obvious now. Hint: it's not 2.3.9.7/5.21/5!
Many times, it's easy to eyeball the merge of two domain bases. The basic idea is to just take everything that's in either one basis or the other. So 2.3.7 merged with 2.3.5 should just be 2.3.5.7, easy. Sometimes it can get kind of tricky, though. Like, what's the merge of 2.3.7/5 and 2.9.21/5? Not so obvious now. Hint: it's not 2.3.9.7/5.21/5!


=== Concatenate ===
=== Concatenate ===
Line 178: Line 180:
=== Canonicalize ===
=== Canonicalize ===


See [[Interval basis#Canonical form]].
See [[Domain basis#Canonical form]].


=== Notation ===
=== Notation ===


The notation used for merging here is the same as comma-merge: <math>\textbf{b}_1|\textbf{b}_2</math><ref>Using ∩ for intersection, which seems obvious. But the merge notation is tricky. We could use ∪, of course. But technically speaking, it's not a union, but a sumset, and the notation for that is unfortunately just the plus sign +, which could be confusing. Furthermore, in the context of merging temperaments, we don't use either of those symbols. Actually, we use two different symbols there, depending on what we're merging! We use & if it's maps, and | if it's commas. At least, that's the notation used on the [[Meet and join]] and [[Temperament merging]] pages. And because intersections also arise for temperament matrices like mappings and comma bases, this article has gone with consistent notation for interval bases. Interval bases concatenate horizontally, like comma bases, so we use | and consider it a "basis-merge" symbol, i.e. it works on both comma bases and interval bases.</ref>.
The notation used for merging here is the same as comma-merge: <math>B_1|B_2</math><ref>Using ∩ for intersection, which seems obvious. But the merge notation is tricky. We could use ∪, of course. But technically speaking, it's not a union, but a sumset, and the notation for that is unfortunately just the plus sign +, which could be confusing. Furthermore, in the context of merging temperaments, we don't use either of those symbols. Actually, we use two different symbols there, depending on what we're merging! We use & if it's maps, and | if it's commas. At least, that's the notation used on the [[Meet and join]] and [[Temperament merging]] pages. And because intersections also arise for temperament matrices like mappings and comma bases, this article has gone with consistent notation for domain bases. Domain bases concatenate horizontally, like comma bases, so we use | and consider it a "basis-merge" symbol, i.e. it works on both comma bases and domain bases.</ref>.


=== Applications ===
=== Applications ===


Interval basis merging comes up in two key situations:  
Domain merging comes up in two key situations:  
# Determining whether one interval subspace is a subspace of another: <math>\textbf{b}_1</math> is a subspace of <math>\textbf{b}_2</math> if <math>\textbf{b}_1|\textbf{b}_2 = \textbf{b}_2</math>. For more details, see: [[Temperament merging across interval bases#General method to determine whether an interval subspace is a subspace of another]].
# Determining whether one domain is a subspace of another: <math>B_1</math> is a subspace of <math>B_2</math> if <math>B_1|B_2 = B_2</math>. For more details, see: [[Cross-domain temperament merging#General method to determine whether a domain is a subspace of another]].
# Comma-merging temperaments across interval bases, in which case the comma-merged temperament's interval basis will be the merge of the all the input interval bases.
# Comma-merging temperaments across domain bases, in which case the comma-merged temperament's domain basis will be the merge of the all the input domain bases.


== Intersecting ==
== Intersecting ==


Finding the intersection of interval bases is surprisingly tricky<ref>This approach was found by Sintel here: https://math.stackexchange.com/questions/1560411/basis-for-the-intersection-of-two-integer-lattices/2472784#2472784</ref>:
Finding the intersection of domain bases is surprisingly tricky<ref>This approach was found by Sintel here: https://math.stackexchange.com/questions/1560411/basis-for-the-intersection-of-two-integer-lattices/2472784#2472784</ref>:


# Convert the interval bases to formal prime matrices, as with a merge.
# Convert the domain bases to basis matrices, as with a merge.
# Create a [[Wikipedia:Block_matrix|block matrix]] by stacking two copies of one formal prime matrix on the left side, and then setting one copy of the other formal prime matrix on the right side, with the bottom-right quadrant of this block matrix filled in with all zeros.
# Create a [[Wikipedia:Block_matrix|block matrix]] by stacking two copies of one basis matrix on the left side, and then setting one copy of the other basis matrix on the right side, with the bottom-right quadrant of this block matrix filled in with all zeros.
# HNF this.
# HNF this.
# The results we want are in the bottom-right. We take only half-columns, from the bottom half, and only half-columns where their corresponding top-half are all zeros (which will only happen to columns that are sorted to the right side).
# The results we want are in the bottom-right. We take only half-columns, from the bottom half, and only half-columns where their corresponding top-half are all zeros (which will only happen to columns that are sorted to the right side).
# Canonicalize.
# Canonicalize.


The reason this works is that wherever the corresponding top-half columns are all zeros, this was achieved through linear combinations of vectors from both interval bases, which means the information below them represents vectors that are in both of them. In other words, if <math>(x, x) + (y, 0) = (0, z)</math> and <math>x</math> is in <math>\textbf{b}_1</math> and <math>y</math> is in <math>\textbf{b}_2</math>, then we must have <math>x + y = 0</math> and <math>z = x</math><ref>credit this explanation to Tom Price on Discord</ref>. We're sort of abusing HNF as a way to solve a system, kind of like [[Douglas Blumeyer's RTT How-To#Null-space|when we calculate the null-space]]<ref>Credit this explanation to Sintel on Discord</ref>.
The reason this works is that wherever the corresponding top-half columns are all zeros, this was achieved through linear combinations of vectors from both domain bases, which means the information below them represents vectors that are in both of them. In other words, if <math>(x, x) + (y, 0) = (0, z)</math> and <math>x</math> is in <math>B_1</math> and <math>y</math> is in <math>B_2</math>, then we must have <math>x + y = 0</math> and <math>z = x</math><ref>credit this explanation to Tom Price on Discord</ref>. We're sort of abusing HNF as a way to solve a system, kind of like [[Douglas Blumeyer's RTT How-To#Nullspace|when we calculate the nullspace]]<ref>Credit this explanation to Sintel on Discord</ref>.


=== But first: a gentle introduction ===
=== But first: a gentle introduction ===


As with the interval basis merge, it is sometimes practical to eyeball the answer. The basic idea is just to take only formal primes that in both of the interval bases. So the intersection of 2.3.5 and 2.3.7 is plainly just 2.3. But other times the answer may not be so clear. Such as: What is the intersection of 2.5/3.9/7 and 2.9.5? Hint: It's not just 2!
As with the domain basis merge, it is sometimes practical to eyeball the answer. The basic idea is just to take only basis elements that in both of the domain bases. So the intersection of 2.3.5 and 2.3.7 is plainly just 2.3. But other times the answer may not be so clear. Such as: What is the intersection of 2.5/3.9/7 and 2.9.5? Hint: It's not just 2!


=== Example ===
=== Example ===
Line 210: Line 212:
Let's find the intersection of 2.5/3 and 2.9.5.
Let's find the intersection of 2.5/3 and 2.9.5.


First, the two interval bases as formal prime matrices:
First, the two domain bases as basis matrices:




Line 359: Line 361:
=== Notation ===
=== Notation ===


The notation for interval basis intersecting we'll use here is just the intersection symbol: <math>\textbf{b}_1∩\textbf{b}_2</math>.
The notation for domain basis intersecting we'll use here is just the intersection symbol: <math>B_1∩B_2</math>.


=== Applications ===
=== Applications ===


The intersection of interval bases comes up with doing a map-merge of temperaments. The resulting temperament's interval basis will be the intersection of all the input interval bases. For more information, see: [[Temperament merging across interval bases#Map-merge]].
The intersection of domain bases comes up with doing a map-merge of temperaments. The resulting temperament's domain basis will be the intersection of all the input domain bases. For more information, see: [[Cross-domain temperament merging#Map-merge]].


= Changing interval basis =
= Changing basis =


[[File:Two-way bridge.png|400px|right|thumb|An interval rebase forms a two-way bridge between an interval superspace basis <math>\textbf{b}_L</math> and an interval subspace basis <math>\textbf{b}_s</math>. But mappings can only use it to go from the superspace to the subspace, and comma bases can only use it to go from the subspace to the superspace.]]
[[File:Two-way bridge.png|400px|right|thumb|A basis change matrix forms a two-way bridge between an interval superspace basis <math>B_L</math> and a domain basis <math>B_s</math>. But mappings can only use it to go from the superspace to the subspace, and comma bases can only use it to go from the subspace to the superspace.]]


Given an interval, comma basis, or mapping — anything that has an associated interval basis — it is possible to change it from one interval basis to another. We can accomplish this using an '''interval rebase''', an object that works like a two-way bridge between two interval bases.  
Given an interval, comma basis, or mapping — anything that has an associated domain basis — it is possible to change it from one domain basis to another. We can accomplish this using a '''basis change matrix''', an object that works like a two-way bridge between two domain bases.  


Elsewhere, these have been called [[subgroup basis matrices]], but that terminology will not be used here, for the same reasons as are described in the last section of this article (here: [[Interval basis#Terminology: interval basis vs. subgroup]]) as well as the additional reason that such a name can easily be conflated with the interval basis itself. Sometimes the interval superspace's formal prime matrix is an identity matrix, in which case the interval rebase will be the same as the interval subspace's formal prime matrix, but this is not always the case.
In fact, there is no real difference between a ''basis matrix'',' such as we've been using to represent nonstandard domain bases in terms of the primes, and a basis ''change'' matrix. We can think of the basis matrix as a basis change matrix, from whatever domain ''to the simplest prime-only basis''. And so we use the same symbol for both of these objects, <math>B</math>. When the change is from a basis to the simplest prime-only basis, the subscript on <math>B</math> can simply be the basis being described; if however, the basis change matrix is from one nonprime basis to another nonprime basis, such as 2.49/3.5 to 2.7/3.5, then the subscript should contain the names of both bases, ideally with a "↔" symbol between them, and the superspace on the left and the subspace on the right, as that corresponds to their positions as labels on the matrix.


As discussed earlier, only certain interval basis changes are possible: (here: [[Temperament merging across interval bases#Application: determining whether it is possible to change the interval subspace]]). To quickly recap here, it is only possible to change between interval subspaces where one is a subspace of the other. So when we say a given interval rebase works like a two-way bridge, there's a more specific way to say what we mean: an interval rebase allows us to change either ''from the subspace to the superspace'', or ''from the superspace to the subspace''. Which direction we go just depends on which side we enter the bridge from: the right side or the left side.
Elsewhere, these types of matrices have been called [[subgroup basis matrices]], but that terminology will not be used here, for the same reasons as are described in the last section of this article (here: [[Domain basis#Terminology: domain basis vs. subgroup]]).  


== Constructing an interval rebase ==
As discussed earlier, only certain domain basis changes are possible: (here: [[Cross-domain temperament merging#Application: determining whether it is possible to change the domain]]). To quickly recap here, it is only possible to change between domains where one is a subspace of the other. So when we say a given basis change matrix works like a two-way bridge, there's a more specific way to say what we mean: a basis change matrix allows us to change either ''from the subspace to the superspace'', or ''from the superspace to the subspace''. Which direction we go just depends on which side we enter the bridge from: the right side or the left side.
 
== Constructing a basis change matrix ==


Here are the steps:
Here are the steps:
# Set up a matrix with <math>d_L</math> rows, where <math>d_L</math> is the dimensionality of the superspace, and <math>d_s</math> columns, where <math>d_s</math> is the dimensionality of the subspace<ref>We're borrowing <math>L</math> and <math>s</math> from [[MOS]] scale theory; there's no direct conceptual connection here, nor any need to understand anything about such scale theory at this moment, but if you happen to be familiar with the conventional use of <math>L</math> for "Large" and <math>s</math> for "small" in that other xenharmonic topic, then this variable choice may be particularly helpful for you.</ref>.
# Set up a matrix with <math>d_L</math> rows, where <math>d_L</math> is the dimensionality of the superspace, and <math>d_s</math> columns, where <math>d_s</math> is the dimensionality of the subspace<ref>We're borrowing <math>L</math> and <math>s</math> from [[MOS]] scale theory; there's no direct conceptual connection here, nor any need to understand anything about such scale theory at this moment, but if you happen to be familiar with the conventional use of <math>L</math> for "Large" and <math>s</math> for "small" in that other xenharmonic topic, then this variable choice may be particularly helpful for you.</ref>.
# Label the rows with the superspace formal primes.
# Label the rows with the superspace basis elements.
# Label the columns with the subspace formal primes.
# Label the columns with the subspace basis elements.
# Fill in each entry with the count of formal primes from the interval superspace basis for this row that could be used to build the formal primes in the interval subspace basis for this column.
# Fill in each entry with the count of basis elements from the interval superspace basis for this row that could be used to build the basis elements in the domain basis for this column.


=== Example ===  
=== Example ===  


Let's construct the interval rebase <math>R</math> between 2.25/9.11/7 and 2.5/3.7.11. [[Temperament merging across interval bases#Example|As we proved earlier]], the former is a subspace of the latter. So this will be a 4×3 matrix.  
Let's construct the basis change matrix <math>B_{L↔s}</math> between 2.25/9.11/7 and 2.5/3.7.11. [[Cross-domain temperament merging#Example|As we proved earlier]], the former is a subspace of the latter. So this will be a 4×3 matrix.  


* The first column is easy. There's no change to prime 2 between these two interval bases.  
* The first column is easy. There's no change to prime 2 between these two domain bases.  
* The second column isn't so tricky, if you can recognize that 25/9 is simply 5/3 squared. So we need a 2 in the cell connecting those two formal primes, and zeroes elsewhere.
* The second column isn't so tricky, if you can recognize that 25/9 is simply 5/3 squared. So we need a 2 in the cell connecting those two basis elements, and zeroes elsewhere.
* The third column isn't so tricky either. It's just one 11 in the numerator, so that's a +1, and one 7 in the denominator, so that's a -1.
* The third column isn't so tricky either. It's just one 11 in the numerator, so that's a +1, and one 7 in the denominator, so that's a -1.


Line 429: Line 433:
</math>
</math>


== Using the interval rebase ==
== Using the basis change matrix ==


For intervals and comma bases, which can only be changed from a subspace to a superspace, we left-multiply by the interval rebase; this process is identical to the process used when mapping intervals with ordinary temperament mappings, except replacing the mapping with the interval rebase.  
For intervals and comma bases, which can only be changed from a subspace to a superspace, we left-multiply by the basis change matrix; this process is identical to the process used when mapping intervals with ordinary temperament mappings, except replacing the mapping with the basis change matrix.  


As for changing such temperament mapping matrices themselves — which can only be changed the other way, from a superspace to a subspace — we instead ''right''-multiply by the interval rebase. So, strangely, this is also identical to the process used when mapping intervals with ordinary temperament mappings, except replacing the ''intervals'' with the interval rebase.  
As for changing such temperament mapping matrices themselves — which can only be changed the other way, from a superspace to a subspace — we instead ''right''-multiply by the basis change matrix. So, strangely, this is also identical to the process used when mapping intervals with ordinary temperament mappings, except replacing the ''intervals'' with the basis change matrix.  


=== Examples ===
=== Examples ===


Suppose we have the interval rebase <math>R_{L↔s}</math> between 2.3.5.7 <math>\textbf{b}_L</math> and 2.9/7.5/3 <math>\textbf{b}_s</math>. The superspace is 2.3.5.7, so that's the rows, and 2.9/7.5/3 is the subspace, so that's the columns. And so here's our <math>R_{L↔s}</math>:
Suppose we have the basis change matrix <math>B_{L↔s}</math> between 2.3.5.7 <math>B_L</math> and 2.9/7.5/3 <math>B_s</math>. The superspace is 2.3.5.7, so that's the rows, and 2.9/7.5/3 is the subspace, so that's the columns. And so here's our <math>B_{L↔s}</math>:




Line 476: Line 480:




First, let's use this to convert a comma basis <math>C_s</math> (that's in the <math>\textbf{b}_s</math> interval subspace) to the <math>\textbf{b}_L</math>interval subspace, by doing <math>R_{L↔s}.C</math>:
First, let's use this to convert a comma basis <math>\mathrm{C}_s</math> (that's in the <math>B_s</math> domain) to the <math>B_L</math>domain, by doing <math>B_{L↔s}.\mathrm{C}</math>:




Line 500: Line 504:
\begin{array} {ccc}
\begin{array} {ccc}


C_L \\
\mathrm{C}_L \\


\begin{array} {ccc}
\begin{array} {ccc}
Line 506: Line 510:
\end{array} \\
\end{array} \\


\left[ \begin{array} {rrr}
\left[ \begin{array} {r|r}
-8 & -4 \\
-8 & -4 \\
-11 & -3 \\
-11 & -3 \\
Line 540: Line 544:
\begin{array} {ccc}
\begin{array} {ccc}


R_{L↔s} \\
B_{L↔s} \\


\begin{array} {ccc}
\begin{array} {ccc}
Line 583: Line 587:
\begin{array} {ccc}
\begin{array} {ccc}


C_s \\
\mathrm{C}_s \\


\begin{array} {ccc}
\begin{array} {ccc}
Line 589: Line 593:
\end{array} \\
\end{array} \\


\left[ \begin{array} {rrr}
\left[ \begin{array} {r|r}
-8 & -4 \\
-8 & -4 \\
11 & 5 \\
11 & 5 \\
Line 604: Line 608:




And now let's use <math>R_{L↔s}</math> to convert a mapping the other way, from <math>\textbf{b}_L</math> to <math>\textbf{b}_s</math>, by doing <math>M_L.R_{L↔s}</math>:
And now let's use <math>B_{L↔s}</math> to convert a mapping the other way, from <math>B_L</math> to <math>B_s</math>, by doing <math>M_L.B_{L↔s}</math>:




Line 648: Line 652:
\begin{array} {ccc}
\begin{array} {ccc}


R_{L↔s} \\
B_{L↔s} \\


\begin{array} {ccc}
\begin{array} {ccc}
Line 692: Line 696:
== Wolfram implementation ==
== Wolfram implementation ==


Functions for finding interval rebases have been implemented in the [[RTT library in Wolfram Language]] as <code>getRforM</code> and <code>getRforC</code>. Although it also simply contains <code>changeB</code> which you can use directly on any temperament and it will do this step under the hood for you.
The [[RTT library in Wolfram Language]] contains <code>changeBasis[]</code> which you can use directly on any temperament representation.


= Examples =
= Examples =
Line 698: Line 702:
== Comma-merge ==
== Comma-merge ==


First, let's work through an example of a comma-merge across interval bases: meantone <math>T_1</math> with archytas <math>T_2</math>, where meantone is in the 5-limit standard interval basis 2.3.5, which we'll call <math>\textbf{b}_1</math>, and archytas is in the 2.3.7 interval basis, which we'll call <math>\textbf{b}_2</math>.
First, let's work through an example of a comma-merge across domain bases: meantone <math>\mathrm{C}_1</math> with archytas <math>\mathrm{C}_2</math>, where meantone is in the 5-limit standard domain basis 2.3.5, which we'll call <math>B_1</math>, and archytas is in the 2.3.7 domain basis, which we'll call <math>B_2</math>.


First we must merge these two temperaments' interval bases. Concatenate them to 2.3.5.2.3.7, then convert to matrix:
First we must merge these two temperaments' domain bases. Concatenate them to 2.3.5.2.3.7, then convert to matrix:




Line 746: Line 750:




Then remove the columns of all zeros, go back to number list form, and make sure everything's greater than 1, which it is already. And so the merged formal prime matrix <math>F_1|F_2</math> is 2.3.5.7.
Then remove the columns of all zeros, go back to number list form, and make sure everything's greater than 1, which it is already. And so the merged basis matrix <math>B_{1|2}</math> is 2.3.5.7.


Now we change the formal prime matrix for each comma basis to <math>F_1|F_2</math>. Let's do meantone first. First we need to find our interval rebase <math>R_{F_1|F_2↔F_1}</math>.
Now we change the basis matrix for each comma basis to <math>B_{1|2}</math>. Let's do meantone first. First we need to find our basis change matrix <math>B_{1|2↔1}</math>.


Actually, <math>R_{1|2↔1}</math> is easier enough to read, and still clear enough, so we'll use that notation moving forward. And here it is itself:
Actually, <math>B_{1|2↔1}</math> is easier enough to read, and still clear enough, so we'll use that notation moving forward. And here it is itself:




Line 789: Line 793:




Now we take our comma basis <math>C_1</math> and left-multiply it by this <math>R_{1|2↔1}</math>, just like we would left-multiply by a mapping:
Now we take our comma basis <math>\mathrm{C}_1</math> and left-multiply it by this <math>B_{1|2↔1}</math>, just like we would left-multiply by a mapping:




Line 813: Line 817:
\begin{array} {ccc}
\begin{array} {ccc}


(1|2)C_1 \\
(1|2)\mathrm{C}_1 \\


\begin{array} {ccc}
\begin{array} {ccc}
Line 853: Line 857:
\begin{array} {ccc}
\begin{array} {ccc}


R_{1|2↔1} \\
B_{1|2↔1} \\


\begin{array} {ccc}
\begin{array} {ccc}
Line 896: Line 900:
\begin{array} {ccc}
\begin{array} {ccc}


C_1 \\
\mathrm{C}_1 \\


\begin{array} {ccc}
\begin{array} {ccc}
Line 917: Line 921:




Now we find our other <math>R</math>, the one for archytas, i.e. <math>R_{1|2↔2}</math>:
Now we find our other <math>B</math>, the one for archytas, i.e. <math>B_{1|2↔2}</math>:




Line 956: Line 960:




And change the interval basis for the archytas comma basis in the same way:
And change the domain basis for the archytas comma basis in the same way:




Line 1,020: Line 1,024:
\begin{array} {ccc}
\begin{array} {ccc}


R_{1|2↔2} \\
B_{1|2↔2} \\


\begin{array} {ccc}
\begin{array} {ccc}
Line 1,089: Line 1,093:
<math>
<math>


\begin{array} {ccc} (1|2)C_1 \\
\begin{array} {ccc} (1|2)\mathrm{C}_1 \\


\left[ \begin{array} {rrr}
\left[ \begin{array} {rrr}
Line 1,102: Line 1,106:
|
|


\begin{array} {ccc} (1|2)C_2 \\
\begin{array} {ccc} (1|2)\mathrm{C}_2 \\


\left[ \begin{array} {rrr}
\left[ \begin{array} {rrr}
Line 1,115: Line 1,119:
=  
=  


\begin{array} {ccc} (1|2)C_1|C_2 \\
\begin{array} {ccc} (1|2)\mathrm{C}_1|\mathrm{C}_2 \\


\left[ \begin{array} {rrr}
\left[ \begin{array} {r|r}
4 & 6 \\
4 & 6 \\
-4 & -2 \\
-4 & -2 \\
Line 1,128: Line 1,132:
\text{which canonicalizes to}
\text{which canonicalizes to}


\left[ \begin{array} {rrr}
\left[ \begin{array} {r|r}
4 & -6 \\
4 & -6 \\
-4 & 2 \\
-4 & 2 \\
Line 1,138: Line 1,142:




And so {{bra|{{vector|4 -4 1}}}} | (2.3.7){{bra|{{vector|6 -1 -1}}}} = {{bra|{{vector|4 -4 1 0}} {{vector|6 -2 0 -1}}}}.
And so [{{vector|4 -4 1}}] | (2.3.7)[{{vector|6 -1 -1}}] = [{{vector|4 -4 1 0}} {{vector|6 -2 0 -1}}].


== Map-merge ==
== Map-merge ==


Now, let's work through an example of a map-merge of temperaments with different formal primes: 22 equal temperament <math>T_1</math> with 17 equal temperament <math>T_2</math>, where 22-ET has interval basis 2.3.5.11, which we'll call <math>\textbf{b}_1</math>, and 17-ET has interval basis 2.9.7.11, which we'll call <math>\textbf{b}_2</math>.
Now, let's work through an example of a map-merge of temperaments with different basis elements: 22 equal temperament <math>M_1</math> with 17 equal temperament <math>M_2</math>, where 22-ET has domain basis 2.3.5.11, which we'll call <math>B_1</math>, and 17-ET has domain basis 2.9.7.11, which we'll call <math>B_2</math>.


First we must intersect these two temperaments' interval bases. The first step of that is to convert them to formal prime matrices which have the formal primes as columns and the merged set of the primes they factor into as the rows:
First we must intersect these two temperaments' domain bases. The first step of that is to convert them to basis matrices which have the basis elements as columns and the merged set of the primes they factor into as the rows:




Line 1,288: Line 1,292:




Canonicalize (HNF, remove all-zero columns, back to number list form, and make super). So that tells us that the intersected interval basis <math>\textbf{b}_1∩\textbf{b}_2</math> is 2.9.11.
Canonicalize (HNF, remove all-zero columns, back to number list form, and make super). So that tells us that the intersected domain basis <math>B_1∩B_2</math> is 2.9.11.


Now we change the interval basis for each mapping to <math>\textbf{b}_1∩\textbf{b}_2</math>. Let's do 22-ET first. First we need to find our interval rebase <math>R_{1↔1∩2}</math>:
Now we change the domain basis for each mapping to <math>B_1∩B_2</math>. Let's do 22-ET first. First we need to find our basis change matrix <math>B_{1↔1∩2}</math>:




Line 1,329: Line 1,333:




Now we take our mapping <math>M_1</math> and right-multiply it by this <math>R_{1∩2↔1}</math>, just like we would right-multiply it by a list of vectors:
Now we take our mapping <math>M_1</math> and right-multiply it by this <math>B_{1∩2↔1}</math>, just like we would right-multiply it by a list of vectors:




Line 1,379: Line 1,383:
\begin{array} {ccc}
\begin{array} {ccc}


R_{1↔1∩2} \\
B_{1↔1∩2} \\


\begin{array} {ccc}
\begin{array} {ccc}
Line 1,422: Line 1,426:




Now we find our other <math>R</math>, the one for 17-ET, i.e. <math>R_{2↔1∩2}</math>:
Now we find our other <math>B</math>, the one for 17-ET, i.e. <math>B_{2↔1∩2}</math>:




Line 1,461: Line 1,465:




And change the interval basis for the 17-ET mapping in the same way:
And change the domain basis for the 17-ET mapping in the same way:




Line 1,511: Line 1,515:
\begin{array} {ccc}
\begin{array} {ccc}


R_{2↔1∩2} \\
B_{2↔1∩2} \\


\begin{array} {ccc}
\begin{array} {ccc}
Line 1,590: Line 1,594:




And so (2.3.5.11){{ket|{{map|22 35 51 76}}}} & (2.9.7.11){{ket|{{map|17 54 48 59}}}} = (2.9.11){{ket|{{map|1 0 13}} {{map|0 1 -3}}}}.
And so (2.3.5.11){{rket|{{map|22 35 51 76}}}} & (2.9.7.11){{rket|{{map|17 54 48 59}}}} = (2.9.11){{rket|{{map|1 0 13}} {{map|0 1 -3}}}}.


= Footnotes =
= Footnotes =