Normal forms: Difference between revisions

Wikispaces>clumma
**Imported revision 287870288 - Original comment: **
Wikispaces>mbattaglia1
**Imported revision 355646652 - Original comment: **
Line 1: Line 1:
<h2>IMPORTED REVISION FROM WIKISPACES</h2>
<h2>IMPORTED REVISION FROM WIKISPACES</h2>
This is an imported revision from Wikispaces. The revision metadata is included below for reference:<br>
This is an imported revision from Wikispaces. The revision metadata is included below for reference:<br>
: This revision was by author [[User:clumma|clumma]] and made on <tt>2011-12-21 05:53:16 UTC</tt>.<br>
: This revision was by author [[User:mbattaglia1|mbattaglia1]] and made on <tt>2012-07-31 03:19:59 UTC</tt>.<br>
: The original revision id was <tt>287870288</tt>.<br>
: The original revision id was <tt>355646652</tt>.<br>
: The revision comment was: <tt></tt><br>
: The revision comment was: <tt></tt><br>
The revision contents are below, presented both in the original Wikispaces Wikitext format, and in HTML exactly as Wikispaces rendered it.<br>
The revision contents are below, presented both in the original Wikispaces Wikitext format, and in HTML exactly as Wikispaces rendered it.<br>
<h4>Original Wikitext content:</h4>
<h4>Original Wikitext content:</h4>
<div style="width:100%; max-height:400pt; overflow:auto; background-color:#f8f9fa; border: 1px solid #eaecf0; padding:0em"><pre style="margin:0px;border:none;background:none;word-wrap:break-word;white-space: pre-wrap ! important" class="old-revision-html">[[toc]]
<div style="width:100%; max-height:400pt; overflow:auto; background-color:#f8f9fa; border: 1px solid #eaecf0; padding:0em"><pre style="margin:0px;border:none;background:none;word-wrap:break-word;white-space: pre-wrap ! important" class="old-revision-html">[[toc]]
An integral matrix is a matrix whose entries are all integers. An important normalized form for integral matrices is [[http://en.wikipedia.org/wiki/Hermite_normal_form|Hermite normal form]], and by using Hermite normal form we may define normalized forms of lists of [[Harmonic Limit|p-limit]] musical intervals (or [[Monzos and Interval Space|monzos]]) or lists of [[Vals and Tuning Space|vals]], the normal interval (or monzo) list and the normal val list.


An integral matrix is a matrix whose entries are all integers. An important normalized form for integral matricies is [[http://en.wikipedia.org/wiki/Hermite_normal_form|Hermite normal form]], and by using Hermite normal form we may define normalized forms of lists of [[Harmonic Limit|p-limit]] musical intervals (or [[Monzos and Interval Space|monzos]]) or lists of [[Vals and Tuning Space|vals]], the normal interval (or monzo) list and the normal val list.
There are slightly different definitions of Hermite normal form in use, and if you are using a computer program to compute it, you should take care that the same normal monzo or val list is finally achieved. The definition used by the Wikipedia article on Hermite form, probably the most standard, works as follows.
 
There are slightly different definitions of Hermite normal form in use, and if you are using a computer program to compute it, you should take care that the same normal monzo or val list is finally achieved. The definition used by the Wikipedia article on Hermite form, probably the most standard, works as follows.  


An n by m integral matrix H is in Hermite normal form if when we define a function F such that F(i) = 0 if all of the entries in the ith column of H are 0, and otherwise F(i) is equal to the row number of the first nonzero entry in the ith column, checking up from the bottom, ie from the nth row, we have
An n by m integral matrix H is in Hermite normal form if when we define a function F such that F(i) = 0 if all of the entries in the ith column of H are 0, and otherwise F(i) is equal to the row number of the first nonzero entry in the ith column, checking up from the bottom, ie from the nth row, we have
Line 30: Line 29:
There is some redundancy in the statement of these conditions, but that does no harm.
There is some redundancy in the statement of these conditions, but that does no harm.


==Normal interval lists==
==Normal interval lists==  
Given a list of p-limit intervals, we can convert it to a normal list by the following procedure:
Given a list of p-limit intervals, we can convert it to a normal list by the following procedure:


Line 41: Line 40:
(4) Hermite reduce this matrix to Hermite normal form
(4) Hermite reduce this matrix to Hermite normal form


(5) Reverse (once again) the entries in each row of the Hermite normal form matrix, and use these re-reversed rows to form a new list of monzos  
(5) Reverse (once again) the entries in each row of the Hermite normal form matrix, and use these re-reversed rows to form a new list of monzos


(6) Discard all of the all-zero monzos, corresponding to the unison 1/1
(6) Discard all of the all-zero monzos, corresponding to the unison 1/1
Line 55: Line 54:
Normal interval lists can also be used to characterize the [[just intonation subgroups]] on which subgroup temperaments are defined and using which subgroup scales may be constructed. On the pages [[Chromatic pairs]], [[Subgroup temperaments]] and [[Just intonation subgroups]] can be found many examples; the subgroup lists are given in a form where generators of the subgroup are separated by periods so as to flag the fact that the list defines a subgroup. An example would be the Barbados subgroup, 2.3.13/5.
Normal interval lists can also be used to characterize the [[just intonation subgroups]] on which subgroup temperaments are defined and using which subgroup scales may be constructed. On the pages [[Chromatic pairs]], [[Subgroup temperaments]] and [[Just intonation subgroups]] can be found many examples; the subgroup lists are given in a form where generators of the subgroup are separated by periods so as to flag the fact that the list defines a subgroup. An example would be the Barbados subgroup, 2.3.13/5.


==Normal val lists==
==Normal val lists==  
If L is a list of n vals, we may write it as an nxm matrix, where the rows of the matrix are the vals, and m = pi(p), where p is the prime limit. To get the normal val list, we do the following:
If L is a list of n vals, we may write it as an nxm matrix, where the rows of the matrix are the vals, and m = pi(p), where p is the prime limit. To get the normal val list, we do the following:


Line 66: Line 65:
The point of steps two and three is that now the vals on the list correspond to a list of generators which are all positive (written additively) or equivalently greater than 1 (written multiplicatively.) Just as a normal comma list can be used to classify an [[abstract regular temperament]], so can a normal val list. The val list is what on [[Graham Breed]]'s [[http://x31eq.com/temper/|web site]] is called a "mapping", put into a canonical form. The "Maps" (though not the "Map to lattice") listed on temperament pages of this wiki are all normal val lists; an example would be [&lt;1 0 -4 -13|, &lt;0 1 4 10|], the normal val list for septimal meantone.
The point of steps two and three is that now the vals on the list correspond to a list of generators which are all positive (written additively) or equivalently greater than 1 (written multiplicatively.) Just as a normal comma list can be used to classify an [[abstract regular temperament]], so can a normal val list. The val list is what on [[Graham Breed]]'s [[http://x31eq.com/temper/|web site]] is called a "mapping", put into a canonical form. The "Maps" (though not the "Map to lattice") listed on temperament pages of this wiki are all normal val lists; an example would be [&lt;1 0 -4 -13|, &lt;0 1 4 10|], the normal val list for septimal meantone.


==Maple code==
==Maple code==  
Below is Maple code for finding the normal interval and val list, given an interval list or a val list.
Below is Maple code for finding the normal interval and val list, given an interval list or a val list.


Line 72: Line 71:


transpos := proc(w)
transpos := proc(w)
# transpose of listlist w
# transpose of listlist w
local u;
local u;
u := Matrix(w);
u := Matrix(w);
Line 79: Line 78:


pseudo := proc(w)
pseudo := proc(w)
# pseudoinverse of listlist w
# pseudoinverse of listlist w
local u;
local u;
u := Matrix(w);
u := Matrix(w);
Line 88: Line 87:


pril := proc(n)
pril := proc(n)
# log2 of first n primes
# log2 of first n primes
local i, u;
local i, u;
u := NULL;
u := NULL;
Line 96: Line 95:


revlist := proc(l)
revlist := proc(l)
# reverse of list
# reverse of list
local i, v, e;
local i, v, e;
e := nops(l);
e := nops(l);
Line 106: Line 105:


pim := proc(q)
pim := proc(q)
# rank of p-limit of q
# rank of p-limit of q
local r, i, p;
local r, i, p;
r := 1;
r := 1;
Line 118: Line 117:


plim := proc(q)
plim := proc(q)
# prime limit of rational number q
# prime limit of rational number q
ithprime(pim(q)) end:
ithprime(pim(q)) end:


rat2monz := proc(q, n)
rat2monz := proc(q, n)
# converts rational number q to monzo of length n
# converts rational number q to monzo of length n
local v, i;
local v, i;
for i from 1 to n do
for i from 1 to n do
Line 129: Line 128:


monz2rat := proc(m)
monz2rat := proc(m)
# converts monzo to rational number
# converts monzo to rational number
local i, t;
local i, t;
t := 1;
t := 1;
Line 137: Line 136:


herm := proc(l)
herm := proc(l)
# hermite normal form of listlist l
# hermite normal form of listlist l
local M;
local M;
M := Matrix(l);
M := Matrix(l);
Line 143: Line 142:


nori := proc(l)
nori := proc(l)
# normal interval list from list of intervals l
# normal interval list from list of intervals l
local i, p, u, v, w;
local i, p, u, v, w;
p := 1;
p := 1;
Line 164: Line 163:


norv := proc(l)
norv := proc(l)
# normal val list from list of vals l
# normal val list from list of vals l
local u, v, w, i, n, a;
local u, v, w, i, n, a;
u := herm(l);
u := herm(l);
Line 185: Line 184:
&lt;!-- ws:end:WikiTextTocRule:8 --&gt;&lt;!-- ws:start:WikiTextTocRule:9: --&gt;&lt;div style="margin-left: 2em;"&gt;&lt;a href="#x-Maple code"&gt;Maple code&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:8 --&gt;&lt;!-- ws:start:WikiTextTocRule:9: --&gt;&lt;div style="margin-left: 2em;"&gt;&lt;a href="#x-Maple code"&gt;Maple code&lt;/a&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:9 --&gt;&lt;!-- ws:start:WikiTextTocRule:10: --&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:9 --&gt;&lt;!-- ws:start:WikiTextTocRule:10: --&gt;&lt;/div&gt;
&lt;!-- ws:end:WikiTextTocRule:10 --&gt;&lt;br /&gt;
&lt;!-- ws:end:WikiTextTocRule:10 --&gt;An integral matrix is a matrix whose entries are all integers. An important normalized form for integral matrices is &lt;a class="wiki_link_ext" href="http://en.wikipedia.org/wiki/Hermite_normal_form" rel="nofollow"&gt;Hermite normal form&lt;/a&gt;, and by using Hermite normal form we may define normalized forms of lists of &lt;a class="wiki_link" href="/Harmonic%20Limit"&gt;p-limit&lt;/a&gt; musical intervals (or &lt;a class="wiki_link" href="/Monzos%20and%20Interval%20Space"&gt;monzos&lt;/a&gt;) or lists of &lt;a class="wiki_link" href="/Vals%20and%20Tuning%20Space"&gt;vals&lt;/a&gt;, the normal interval (or monzo) list and the normal val list.&lt;br /&gt;
An integral matrix is a matrix whose entries are all integers. An important normalized form for integral matricies is &lt;a class="wiki_link_ext" href="http://en.wikipedia.org/wiki/Hermite_normal_form" rel="nofollow"&gt;Hermite normal form&lt;/a&gt;, and by using Hermite normal form we may define normalized forms of lists of &lt;a class="wiki_link" href="/Harmonic%20Limit"&gt;p-limit&lt;/a&gt; musical intervals (or &lt;a class="wiki_link" href="/Monzos%20and%20Interval%20Space"&gt;monzos&lt;/a&gt;) or lists of &lt;a class="wiki_link" href="/Vals%20and%20Tuning%20Space"&gt;vals&lt;/a&gt;, the normal interval (or monzo) list and the normal val list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There are slightly different definitions of Hermite normal form in use, and if you are using a computer program to compute it, you should take care that the same normal monzo or val list is finally achieved. The definition used by the Wikipedia article on Hermite form, probably the most standard, works as follows. &lt;br /&gt;
There are slightly different definitions of Hermite normal form in use, and if you are using a computer program to compute it, you should take care that the same normal monzo or val list is finally achieved. The definition used by the Wikipedia article on Hermite form, probably the most standard, works as follows.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An n by m integral matrix H is in Hermite normal form if when we define a function F such that F(i) = 0 if all of the entries in the ith column of H are 0, and otherwise F(i) is equal to the row number of the first nonzero entry in the ith column, checking up from the bottom, ie from the nth row, we have&lt;br /&gt;
An n by m integral matrix H is in Hermite normal form if when we define a function F such that F(i) = 0 if all of the entries in the ith column of H are 0, and otherwise F(i) is equal to the row number of the first nonzero entry in the ith column, checking up from the bottom, ie from the nth row, we have&lt;br /&gt;
Line 209: Line 207:
&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:0:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id="toc0"&gt;&lt;a name="x-Normal interval lists"&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:0 --&gt;Normal interval lists&lt;/h2&gt;
&lt;!-- ws:start:WikiTextHeadingRule:0:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id="toc0"&gt;&lt;a name="x-Normal interval lists"&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:0 --&gt;Normal interval lists&lt;/h2&gt;
Given a list of p-limit intervals, we can convert it to a normal list by the following procedure:&lt;br /&gt;
Given a list of p-limit intervals, we can convert it to a normal list by the following procedure:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(1) Convert the list to a list of monzos&lt;br /&gt;
(1) Convert the list to a list of monzos&lt;br /&gt;
Line 219: Line 217:
(4) Hermite reduce this matrix to Hermite normal form&lt;br /&gt;
(4) Hermite reduce this matrix to Hermite normal form&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(5) Reverse (once again) the entries in each row of the Hermite normal form matrix, and use these re-reversed rows to form a new list of monzos &lt;br /&gt;
(5) Reverse (once again) the entries in each row of the Hermite normal form matrix, and use these re-reversed rows to form a new list of monzos&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(6) Discard all of the all-zero monzos, corresponding to the unison 1/1&lt;br /&gt;
(6) Discard all of the all-zero monzos, corresponding to the unison 1/1&lt;br /&gt;
Line 234: Line 232:
&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:2:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id="toc1"&gt;&lt;a name="x-Normal val lists"&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:2 --&gt;Normal val lists&lt;/h2&gt;
&lt;!-- ws:start:WikiTextHeadingRule:2:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id="toc1"&gt;&lt;a name="x-Normal val lists"&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:2 --&gt;Normal val lists&lt;/h2&gt;
If L is a list of n vals, we may write it as an nxm matrix, where the rows of the matrix are the vals, and m = pi(p), where p is the prime limit. To get the normal val list, we do the following:&lt;br /&gt;
If L is a list of n vals, we may write it as an nxm matrix, where the rows of the matrix are the vals, and m = pi(p), where p is the prime limit. To get the normal val list, we do the following:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(1) Hermite reduce the matrix for L&lt;br /&gt;
(1) Hermite reduce the matrix for L&lt;br /&gt;
Line 245: Line 243:
&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:4:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id="toc2"&gt;&lt;a name="x-Maple code"&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:4 --&gt;Maple code&lt;/h2&gt;
&lt;!-- ws:start:WikiTextHeadingRule:4:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id="toc2"&gt;&lt;a name="x-Maple code"&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:4 --&gt;Maple code&lt;/h2&gt;
Below is Maple code for finding the normal interval and val list, given an interval list or a val list.&lt;br /&gt;
Below is Maple code for finding the normal interval and val list, given an interval list or a val list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
log2 := proc(x) evalf(ln(x)/ln(2)) end:&lt;br /&gt;
log2 := proc(x) evalf(ln(x)/ln(2)) end:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
transpos := proc(w)&lt;br /&gt;
transpos := proc(w)&lt;br /&gt;
# transpose of listlist w&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;transpose of listlist w&lt;/li&gt;&lt;/ol&gt;local u;&lt;br /&gt;
local u;&lt;br /&gt;
u := Matrix(w);&lt;br /&gt;
u := Matrix(w);&lt;br /&gt;
u := LinearAlgebra[Transpose](u);&lt;br /&gt;
u := LinearAlgebra[Transpose](u);&lt;br /&gt;
Line 257: Line 254:
&lt;br /&gt;
&lt;br /&gt;
pseudo := proc(w)&lt;br /&gt;
pseudo := proc(w)&lt;br /&gt;
# pseudoinverse of listlist w&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;pseudoinverse of listlist w&lt;/li&gt;&lt;/ol&gt;local u;&lt;br /&gt;
local u;&lt;br /&gt;
u := Matrix(w);&lt;br /&gt;
u := Matrix(w);&lt;br /&gt;
u := LinearAlgebra[MatrixInverse](u, method='pseudo');&lt;br /&gt;
u := LinearAlgebra[MatrixInverse](u, method='pseudo');&lt;br /&gt;
Line 266: Line 262:
&lt;br /&gt;
&lt;br /&gt;
pril := proc(n)&lt;br /&gt;
pril := proc(n)&lt;br /&gt;
# log2 of first n primes&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;log2 of first n primes&lt;/li&gt;&lt;/ol&gt;local i, u;&lt;br /&gt;
local i, u;&lt;br /&gt;
u := NULL;&lt;br /&gt;
u := NULL;&lt;br /&gt;
for i from 1 to n do&lt;br /&gt;
for i from 1 to n do&lt;br /&gt;
Line 274: Line 269:
&lt;br /&gt;
&lt;br /&gt;
revlist := proc(l)&lt;br /&gt;
revlist := proc(l)&lt;br /&gt;
# reverse of list&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;reverse of list&lt;/li&gt;&lt;/ol&gt;local i, v, e;&lt;br /&gt;
local i, v, e;&lt;br /&gt;
e := nops(l);&lt;br /&gt;
e := nops(l);&lt;br /&gt;
for i from 1 to e do&lt;br /&gt;
for i from 1 to e do&lt;br /&gt;
Line 284: Line 278:
&lt;br /&gt;
&lt;br /&gt;
pim := proc(q)&lt;br /&gt;
pim := proc(q)&lt;br /&gt;
# rank of p-limit of q&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;rank of p-limit of q&lt;/li&gt;&lt;/ol&gt;local r, i, p;&lt;br /&gt;
local r, i, p;&lt;br /&gt;
r := 1;&lt;br /&gt;
r := 1;&lt;br /&gt;
i := 0;&lt;br /&gt;
i := 0;&lt;br /&gt;
Line 296: Line 289:
&lt;br /&gt;
&lt;br /&gt;
plim := proc(q)&lt;br /&gt;
plim := proc(q)&lt;br /&gt;
# prime limit of rational number q&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;prime limit of rational number q&lt;/li&gt;&lt;/ol&gt;ithprime(pim(q)) end:&lt;br /&gt;
ithprime(pim(q)) end:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
rat2monz := proc(q, n)&lt;br /&gt;
rat2monz := proc(q, n)&lt;br /&gt;
# converts rational number q to monzo of length n&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;converts rational number q to monzo of length n&lt;/li&gt;&lt;/ol&gt;local v, i;&lt;br /&gt;
local v, i;&lt;br /&gt;
for i from 1 to n do&lt;br /&gt;
for i from 1 to n do&lt;br /&gt;
v[i] := ordp(q, ithprime(i)) od;&lt;br /&gt;
v[i] := ordp(q, ithprime(i)) od;&lt;br /&gt;
Line 307: Line 298:
&lt;br /&gt;
&lt;br /&gt;
monz2rat := proc(m)&lt;br /&gt;
monz2rat := proc(m)&lt;br /&gt;
# converts monzo to rational number&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;converts monzo to rational number&lt;/li&gt;&lt;/ol&gt;local i, t;&lt;br /&gt;
local i, t;&lt;br /&gt;
t := 1;&lt;br /&gt;
t := 1;&lt;br /&gt;
for i from 1 to nops(m) do&lt;br /&gt;
for i from 1 to nops(m) do&lt;br /&gt;
Line 315: Line 305:
&lt;br /&gt;
&lt;br /&gt;
herm := proc(l)&lt;br /&gt;
herm := proc(l)&lt;br /&gt;
# hermite normal form of listlist l&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;hermite normal form of listlist l&lt;/li&gt;&lt;/ol&gt;local M;&lt;br /&gt;
local M;&lt;br /&gt;
M := Matrix(l);&lt;br /&gt;
M := Matrix(l);&lt;br /&gt;
convert(convert(HermiteForm[Z](M), array), listlist) end:&lt;br /&gt;
convert(convert(HermiteForm[Z](M), array), listlist) end:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
nori := proc(l)&lt;br /&gt;
nori := proc(l)&lt;br /&gt;
# normal interval list from list of intervals l&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;normal interval list from list of intervals l&lt;/li&gt;&lt;/ol&gt;local i, p, u, v, w;&lt;br /&gt;
local i, p, u, v, w;&lt;br /&gt;
p := 1;&lt;br /&gt;
p := 1;&lt;br /&gt;
for i from 1 to nops(l) do&lt;br /&gt;
for i from 1 to nops(l) do&lt;br /&gt;
Line 342: Line 330:
&lt;br /&gt;
&lt;br /&gt;
norv := proc(l)&lt;br /&gt;
norv := proc(l)&lt;br /&gt;
# normal val list from list of vals l&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;normal val list from list of vals l&lt;/li&gt;&lt;/ol&gt;local u, v, w, i, n, a;&lt;br /&gt;
local u, v, w, i, n, a;&lt;br /&gt;
u := herm(l);&lt;br /&gt;
u := herm(l);&lt;br /&gt;
n := rnk(u);&lt;br /&gt;
n := rnk(u);&lt;br /&gt;