Singular
https://www.singular.uni-kl.de/forum/

Using ring map to transfer a list?
https://www.singular.uni-kl.de/forum/viewtopic.php?f=10&t=1768
Page 1 of 1

Author:  Ravi [ Sun Aug 16, 2009 10:12 am ]
Post subject:  Using ring map to transfer a list?

Hello,
I have calculated a list of (constant) matrices in one ring and now want to calculate their characteristic polynomials for which I need to define another ring but the list is not available in this new ring. How do I access the list in the new ring?
The documentation for the map function does not say how to transfer a list from one ring to another...

Code:
LIB "finvar.lib";
LIB "linalg.lib";

ring R = (0,a), (x,y), dp;
minpoly = a2-3;

matrix A[2][2] = -1/2,-a/2, a/2,-1/2;
matrix B[2][2] = 1,0, 0,-1;

list L = group_reynolds(A,B);

print(size(L));

ring S = 0, t, dp;

for (int i=2; i<=7; i=i+1) {   
   print(charpoly(L[i], "t"); // L not accessible here
}

-------------------
One more elementary question: How do I do arithmetic on rational functions in Singular? For example calculate that

Code:
           1/(t+1) + 1/(t-1) = 2t/(t2-1)

Author:  hannes [ Tue Aug 18, 2009 10:30 am ]
Post subject:  Re: Using ring map to transfer a list?

To map list from R to S, define a map, for example:
map phi=R,0;
and use phi(L) instead of L in S:
print(charpoly(phi(L)[i],"t");

For rational funktions: in a ring
ring R=(0,t),x,dp;
are the objects of type number rational functions, see (transcedental extension):
http://www.singular.uni-kl.de/Manual/3-1-0/sing_29.html

Author:  Ravi [ Tue Aug 18, 2009 11:41 am ]
Post subject:  Re: Using ring map to transfer a list?

The ring map suggested does not work. Here is the suggested code:

Code:
LIB "finvar.lib";
LIB "linalg.lib";

ring R = (0,a), (x,y), dp;
minpoly = a2-3;

matrix A[2][2] = -1/2,-a/2, a/2,-1/2;
matrix B[2][2] = 1,0, 0,-1;

list L = group_reynolds(A,B);

print(size(L));

ring S = 0, t, dp;

map phi = R, 0;

for (int i=2; i<=7; i=i+1) {   
   print(charpoly(phi(L)[i], "t"); // L not accessible here
}


And here is the error:

Code:
   ? can not map from ground field of R to current ground field
   ? error occurred in try1.sing line 19: `   print(charpoly(phi(L)[i], "t");


The suggestion about using a trancendental extension for working with rational functions was just what I wanted - Thanks!
Any ideas about the problem with the ring map above?

Author:  hannes [ Tue Aug 18, 2009 3:13 pm ]
Post subject:  Re: Using ring map to transfer a list?

The problem is that there are no (canonical) mappings from
the coefficient field of R (Q(a)) to the the coeff. field of S (Q).
It should work with the following definition of S as a ring over Q(a):
ring S=(0,a),t,dp;

Author:  Ravi [ Tue Aug 18, 2009 4:45 pm ]
Post subject:  Re: Using ring map to transfer a list?

Ok, that worked. Of course, I had to define "minpoly" again for the ring S.

Thank you very much. But I have not noticed this use of "map":

Code:
map map-name = ring-name, 0;

in the documentation or in the Decker-Lossen book...(?)
Thanks again :)

Page 1 of 1 All times are UTC + 1 hour [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/