Normal forms: Difference between revisions

Wikispaces>genewardsmith
**Imported revision 143888077 - Original comment: **
Wikispaces>genewardsmith
**Imported revision 153447167 - 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:genewardsmith|genewardsmith]] and made on <tt>2010-05-22 03:16:05 UTC</tt>.<br>
: This revision was by author [[User:genewardsmith|genewardsmith]] and made on <tt>2010-07-21 06:14:27 UTC</tt>.<br>
: The original revision id was <tt>143888077</tt>.<br>
: The original revision id was <tt>153447167</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>
Line 29: Line 29:


==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 53: Line 52:


==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:


(1) Hermite reduce the matrix for L
(1) Hermite reduce the matrix for L


(2) Throw away all rows which consist of nothing but zeros
(2) Throw away all rows which consist of nothing but zeros, resulting in a kxm matrix
 
(3) In the resulting kxm matrix, take the first k rows and columns, and test if the matrix is singular


(4) If it is, return the rows of the kxm matrix as the normalized list (in practice you would need to be doing something unusual for this to happen, and at that point you should probably work matters out for yourself.) If it is nonsingular, invert the matrix
(3) Find the [[http://en.wikipedia.org/wiki/Moore%E2%80%93Penrose_pseudoinverse|Moore-Penrose pseudoinverse]] of the kxm matrix, take its transpose, and multiply this from the left by the row vector [1 log2(3) log2(5) ... log2(p)]. If the ith entry in the result is negative, multiply the corresponding val by -1. Return the result as the normalized val list.
and multiply the inverse matrix from the left by the row vector
[1 log2(3) log2(5) ... log2(p)]. If the ith entry in the result is negative, multiply the corresponding val by -1. Return the result as the normalized val list.


The point of steps three and four 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 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.


==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.


with(padic, ordp):
log2 := proc(x) evalf(ln(x)/ln(2)) end:
with(LinearAlgebra):
 
transpos := proc(w)
# transpose of listlist w
local u;
u := Matrix(w);
u := LinearAlgebra[Transpose](u);
convert(u, listlist) end:
 
pseudo := proc(w)
# pseudoinverse of listlist w
local u;
u := Matrix(w);
u := LinearAlgebra[MatrixInverse](u, method='pseudo');
convert(u, listlist) end:


log2 := proc(x) evalf(ln(x)/ln(2)) end:
psu := proc(w) transpos(pseudo(w)) end:


pril := proc(n)
pril := proc(n)
Line 92: Line 99:
convert(convert(v,array),list) end:
convert(convert(v,array),list) end:


plim := proc(q)
orp := proc(w, p) padic[ordp](w, p) end:
  # prime limit of rational number q
 
pim := proc(q)
  # rank of p-limit of q
local r, i, p;
local r, i, p;
r := 1;
r := 1;
Line 100: Line 109:
i := i+1;
i := i+1;
p := ithprime(i);
p := ithprime(i);
r := r*p^ordp(q, p) od;
r := r*p^orp(q, p) od;
if i=0 then RETURN(0) fi;
i end:
i end:
plim := proc(q)
# prime limit of rational number q
ithprime(pim(q)) end:


rat2monz := proc(q, n)
rat2monz := proc(q, n)
Line 147: Line 161:
norv := proc(l)
norv := proc(l)
  # normal val list from list of vals l
  # normal val list from list of vals l
local M, N, u, v, i, j, a;
local u, v, w, i, n, a;
u := herm(l);
u := herm(l);
j := Rank(Matrix(u));
n := rnk(u);
v := NULL:
v := NULL:
for i from 1 to j do
for i from 1 to n do
v := v,u[i] od;
v := v,u[i] od;
v := [v];
v := [v];
M := Matrix(v);
u := psu(v);
N := SubMatrix(M, 1..j, 1..j);
w := pril(n);
N := N^(-1);
a := op(matmul(w, u));
a := Vector[row](pril(j));
a := a.N;
u := NULL;
u := NULL;
for i from 1 to j do
for i from 1 to n do
if a[i] &lt; 0 then u := u,-v[i] fi;
if a[i] &lt; 0 then u := u,-v[i] fi;
if a[i] &gt;= 0 then u := u,v[i] fi od;
if a[i] &gt;= 0 then u := u,v[i] fi od;
[u] end:
[u] end:
</pre></div>
</pre></div>
<h4>Original HTML content:</h4>
<h4>Original HTML content:</h4>
Line 190: Line 201:
&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;
&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;
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;
Line 214: Line 224:
&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;
&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;
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;
&lt;br /&gt;
&lt;br /&gt;
(2) Throw away all rows which consist of nothing but zeros&lt;br /&gt;
(2) Throw away all rows which consist of nothing but zeros, resulting in a kxm matrix&lt;br /&gt;
&lt;br /&gt;
(3) In the resulting kxm matrix, take the first k rows and columns, and test if the matrix is singular&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(4) If it is, return the rows of the kxm matrix as the normalized list (in practice you would need to be doing something unusual for this to happen, and at that point you should probably work matters out for yourself.) If it is nonsingular, invert the matrix&lt;br /&gt;
(3) Find the &lt;a class="wiki_link_ext" href="http://en.wikipedia.org/wiki/Moore%E2%80%93Penrose_pseudoinverse" rel="nofollow"&gt;Moore-Penrose pseudoinverse&lt;/a&gt; of the kxm matrix, take its transpose, and multiply this from the left by the row vector [1 log2(3) log2(5) ... log2(p)]. If the ith entry in the result is negative, multiply the corresponding val by -1. Return the result as the normalized val list.&lt;br /&gt;
and multiply the inverse matrix from the left by the row vector&lt;br /&gt;
[1 log2(3) log2(5) ... log2(p)]. If the ith entry in the result is negative, multiply the corresponding val by -1. Return the result as the normalized val list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The point of steps three and four 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 &lt;a class="wiki_link" href="/Graham%20Breed"&gt;Graham Breed&lt;/a&gt;'s &lt;a class="wiki_link_ext" href="http://x31eq.com/temper/" rel="nofollow"&gt;web site&lt;/a&gt;  is called a &amp;quot;mapping&amp;quot;, put into a canonical form.&lt;br /&gt;
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 &lt;a class="wiki_link" href="/Graham%20Breed"&gt;Graham Breed&lt;/a&gt;'s &lt;a class="wiki_link_ext" href="http://x31eq.com/temper/" rel="nofollow"&gt;web site&lt;/a&gt;  is called a &amp;quot;mapping&amp;quot;, put into a canonical form.&lt;br /&gt;
&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;
with(padic, ordp):&lt;br /&gt;
log2 := proc(x) evalf(ln(x)/ln(2)) end:&lt;br /&gt;
with(LinearAlgebra):&lt;br /&gt;
&lt;br /&gt;
transpos := proc(w)&lt;br /&gt;
# transpose of listlist w&lt;br /&gt;
local u;&lt;br /&gt;
u := Matrix(w);&lt;br /&gt;
u := LinearAlgebra[Transpose](u);&lt;br /&gt;
convert(u, listlist) end:&lt;br /&gt;
&lt;br /&gt;
pseudo := proc(w)&lt;br /&gt;
# pseudoinverse of listlist w&lt;br /&gt;
local u;&lt;br /&gt;
u := Matrix(w);&lt;br /&gt;
u := LinearAlgebra[MatrixInverse](u, method='pseudo');&lt;br /&gt;
convert(u, listlist) end:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
log2 := proc(x) evalf(ln(x)/ln(2)) end:&lt;br /&gt;
psu := proc(w) transpos(pseudo(w)) end:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
pril := proc(n)&lt;br /&gt;
pril := proc(n)&lt;br /&gt;
Line 253: Line 271:
convert(convert(v,array),list) end:&lt;br /&gt;
convert(convert(v,array),list) end:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
plim := proc(q)&lt;br /&gt;
orp := proc(w, p) padic[ordp](w, p) end:&lt;br /&gt;
  # prime limit of rational number q&lt;br /&gt;
&lt;br /&gt;
pim := proc(q)&lt;br /&gt;
  # rank of p-limit of q&lt;br /&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;
Line 261: Line 281:
i := i+1;&lt;br /&gt;
i := i+1;&lt;br /&gt;
p := ithprime(i);&lt;br /&gt;
p := ithprime(i);&lt;br /&gt;
r := r*p^ordp(q, p) od;&lt;br /&gt;
r := r*p^orp(q, p) od;&lt;br /&gt;
if i=0 then RETURN(0) fi;&lt;br /&gt;
i end:&lt;br /&gt;
i end:&lt;br /&gt;
&lt;br /&gt;
plim := proc(q)&lt;br /&gt;
# prime limit of rational number q&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;
Line 308: Line 333:
norv := proc(l)&lt;br /&gt;
norv := proc(l)&lt;br /&gt;
  # normal val list from list of vals l&lt;br /&gt;
  # normal val list from list of vals l&lt;br /&gt;
local M, N, u, v, i, j, 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;
j := Rank(Matrix(u));&lt;br /&gt;
n := rnk(u);&lt;br /&gt;
v := NULL:&lt;br /&gt;
v := NULL:&lt;br /&gt;
for i from 1 to j do&lt;br /&gt;
for i from 1 to n do&lt;br /&gt;
v := v,u[i] od;&lt;br /&gt;
v := v,u[i] od;&lt;br /&gt;
v := [v];&lt;br /&gt;
v := [v];&lt;br /&gt;
M := Matrix(v);&lt;br /&gt;
u := psu(v);&lt;br /&gt;
N := SubMatrix(M, 1..j, 1..j);&lt;br /&gt;
w := pril(n);&lt;br /&gt;
N := N^(-1);&lt;br /&gt;
a := op(matmul(w, u));&lt;br /&gt;
a := Vector[row](pril(j));&lt;br /&gt;
a := a.N;&lt;br /&gt;
u := NULL;&lt;br /&gt;
u := NULL;&lt;br /&gt;
for i from 1 to j do&lt;br /&gt;
for i from 1 to n do&lt;br /&gt;
if a[i] &amp;lt; 0 then u := u,-v[i] fi;&lt;br /&gt;
if a[i] &amp;lt; 0 then u := u,-v[i] fi;&lt;br /&gt;
if a[i] &amp;gt;= 0 then u := u,v[i] fi od;&lt;br /&gt;
if a[i] &amp;gt;= 0 then u := u,v[i] fi od;&lt;br /&gt;
[u] end:&lt;/body&gt;&lt;/html&gt;</pre></div>
[u] end:&lt;/body&gt;&lt;/html&gt;</pre></div>