Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Using ring map to transfer a list?
PostPosted: Sun Aug 16, 2009 10:12 am 

Joined: Wed Jul 15, 2009 3:38 pm
Posts: 10
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)


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Re: Using ring map to transfer a list?
PostPosted: Tue Aug 18, 2009 10:30 am 

Joined: Wed May 25, 2005 4:16 pm
Posts: 275
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Re: Using ring map to transfer a list?
PostPosted: Tue Aug 18, 2009 11:41 am 

Joined: Wed Jul 15, 2009 3:38 pm
Posts: 10
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?


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Re: Using ring map to transfer a list?
PostPosted: Tue Aug 18, 2009 3:13 pm 

Joined: Wed May 25, 2005 4:16 pm
Posts: 275
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;


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Re: Using ring map to transfer a list?
PostPosted: Tue Aug 18, 2009 4:45 pm 

Joined: Wed Jul 15, 2009 3:38 pm
Posts: 10
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 :)


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

It is currently Fri May 13, 2022 11:06 am
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group