Re: [sage-support] Convolution

2012-09-17 Thread David Joyner
On Mon, Sep 17, 2012 at 5:55 PM, Dan Aldrich  wrote:
> Can't seem to get the convolution of these two functions.
>
> f(t) = unit_step(t) - unit_step(t-3)
>
> g(t) = unit_step(t) - unit_step(t-1)


Sorry, the Piecewise class is very clunky and old.

Is something like this helpful?

sage: x = PolynomialRing(QQ,'x').gen()
sage: f1 = 1*x^0
sage: f2 = -x^0
sage: f = Piecewise([[(0,3),f1],[(3,100),f2]])
sage: g = Piecewise([[(0,1),f1],[(1,100),f2]])
sage: f.convolution(g)
Piecewise defined function with 7 parts, [[(0, 1), x], [(1, 3), -x +
4], [(3, 4), -3*x + 8], [(4, 100), x - 200], [(100, 101), 3*x - 208],
[(101, 103), x - 4], [(103, 200), -x + 200]]
sage:

I think maxima has this capability but I've forgotten which libraries
to load for it.

>
> Matlab (argghh...) does it simply: conv(f,g). I tried the methods in the
> documentation: z = f.convolution(g), but no no luck getting it to work in
> sage.
>
> Thanks,
> -d
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-support" group.
> To post to this group, send email to sage-support@googlegroups.com.
> To unsubscribe from this group, send email to
> sage-support+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/sage-support?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




[sage-support] Convolution

2012-09-17 Thread Dan Aldrich

Can't seem to get the convolution of these two functions.

f(t) = unit_step(t) - unit_step(t-3)

g(t) = unit_step(t) - unit_step(t-1)

Matlab (argghh...) does it simply: conv(f,g). I tried the methods 
in the documentation: z = f.convolution(g), but no no luck getting it 
to work in sage.


Thanks,
-d


--
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




Re: [sage-support] Re: axes move when graphing large 2D polytopes

2012-09-17 Thread Ursula Whitcher

On 9/17/2012 4:28 PM, Volker Braun wrote:


Incidentally, I've been working on an alternative implementation of
lattice polytopes. The alternative code has support for 2-d plots of
polygons. Here is an example (click on "Run" to execute):

http://sagepad.org/sp/pad/505488a186b72107de3c1080


Pretty!  (It ran in Firefox, too, which Jmol never does.)

UAW

--
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




[sage-support] Re: power representation of finite field elements

2012-09-17 Thread Oleksandr Kazymyrov
Today is easiest way and *secure* to use multiplicative_generator function:

sage: K=GF(2^4,'a')
sage: K
Finite Field in a of size 2^4
sage: b=K.random_element()
sage: b.log(K.multiplicative_generator())
14
sage: K.multiplib.log(K.multiplicative_generator())
K.multiplication_table  K.multiplicative_generator
sage: K.multiplicative_generator()^b.log(K.multiplicative_generator()) == b
True

Because the function log_repr() works only in some special cases. 
sage: K=GF(2^4,'a',modulus=ZZ['x']('x^4 + x^3 + x^2 + x + 1'));
sage: K.list()
[0, a + 1, a^2 + 1, a^3 + a^2 + a + 1, a^3 + a^2 + a, a^3 + a^2 + 1, a^3, 
a^2 + a + 1, a^3 + 1, a^2, a^3 + a^2, a^3 + a + 1, a, a^2 + a, a^3 + a, 1]
sage: b=K.random_element()
sage: b
a^3 + a
sage: b.log_repr() 
'14'
sage: b^ZZ(b.log_repr()) == b
False
sage: K.multiplicative_generator() 

a^2 + a + 1
sage: K.multiplicative_generator()^ZZ(b.log(K.multiplicative_generator())) 
== b
True

On Monday, September 17, 2012 11:07:58 PM UTC+2, Mike OS wrote:
>
> HI
>
> I was asking myself this question and couldn't find an answer in the 
> documentation, not
> in past posts (which is how I found this email).
>
> So I re-ask the question  is there a way to have finite field elements
> printed as powers of the primitive element?
>
> Thanks
>
> Mike
>
> On Saturday, October 31, 2009 2:34:38 AM UTC-7, Kwankyu wrote:
>>
>> Hi, 
>>
>> Is it possible to get elements of a finite field printed as powers of 
>> a primitive element if the modulus is a primitive polynomial? That 
>> will save a lot of screen space. 
>>
>>
>> Kwankyu
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




[sage-support] Re: axes move when graphing large 2D polytopes

2012-09-17 Thread Volker Braun
I think thats a limitation of jmol, it just wants to draw axes somewhere in 
the center and if the object is too far away from the origin then that 
means that they don't pass through the origin.

Incidentally, I've been working on an alternative implementation of lattice 
polytopes. The alternative code has support for 2-d plots of polygons. Here 
is an example (click on "Run" to execute):

http://sagepad.org/sp/pad/505488a186b72107de3c1080




On Monday, September 17, 2012 8:40:27 PM UTC+1, Ursula Whitcher wrote:
>
> I've been graphing some 2D lattice polytopes using a trick I learned from 
> Andrey Novoseltsev a while ago: plot the polytopes in 3D, then rotate into 
> the xy plane for a two-dimensional image.  I discovered that when I graph a 
> larger lattice polytope, the intersection of the x and y axes moves away 
> from (0,0).  Is there a command to force the axes to intersect at the 
> origin?  Or have I discovered a bug?
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




[sage-support] Re: power representation of finite field elements

2012-09-17 Thread Mike OS
HI

I was asking myself this question and couldn't find an answer in the 
documentation, not
in past posts (which is how I found this email).

So I re-ask the question  is there a way to have finite field elements
printed as powers of the primitive element?

Thanks

Mike

On Saturday, October 31, 2009 2:34:38 AM UTC-7, Kwankyu wrote:
>
> Hi, 
>
> Is it possible to get elements of a finite field printed as powers of 
> a primitive element if the modulus is a primitive polynomial? That 
> will save a lot of screen space. 
>
>
> Kwankyu

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




[sage-support] bug in Graph.is_cartesian_product

2012-09-17 Thread Georgi Guninski
sage 5.3 and 5.2 on linux x86_64

G=Graph([(0, 3), (0, 4), (0, 5), (1, 4), (1, 5), (1, 6), (2, 5),
(2, 6), (2, 7), (3, 6), (3, 7), (4, 7)] );G.is_cartesian_product()

ValueError: Something weird happened during the algorithm... Please report the 
bug and give us the graph instance that made it fail !!!

If I comment the exception and compute product of the alleged
factors get a graph of different order which can't be isomorphic to G.

In addition .is_cartesian_product raises IndexError on
1. the empty graph
2. $K_1$

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




[sage-support] Re: Problem with sagecell server installation

2012-09-17 Thread Jason Grout

On 9/17/12 12:29 PM, kcrisman wrote:

Could one of you post a (cleaned up) version of this somewhere on the
wiki, analogous to the Sage server install wiki pages?  This looks like
a fairly circuitous route, with instructions from random tickets, for
someone unfamiliar with the cell server to follow.


I just posted a new sagecell spkg and cleaned up the instructions:

https://github.com/sagemath/sagecell/issues/344

I haven't tested these very well yet, though.

Jason


--
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




[sage-support] axes move when graphing large 2D polytopes

2012-09-17 Thread Ursula Whitcher
I've been graphing some 2D lattice polytopes using a trick I learned from 
Andrey Novoseltsev a while ago: plot the polytopes in 3D, then rotate into 
the xy plane for a two-dimensional image.  I discovered that when I graph a 
larger lattice polytope, the intersection of the x and y axes moves away 
from (0,0).  Is there a command to force the axes to intersect at the 
origin?  Or have I discovered a bug?

Here are some examples.

Here is code I ran yesterday at sagenb.org (using the Chrome browser in 
Windows):

m = lattice_polytope.read_palp_matrix(r"""4 2
-1 0 
1 -2
-1 5
1 5
""")
p = LatticePolytope(m)
pl = p.plot3d(show_vindices=False, show_points=False, edge_color="blue")
size = 4
for i in range(-size, size+1):
for j in range(-size, size+1):
pl += point3d((i,j,0))   
pl.show(frame=False, axes=True)

Here is the resulting image:

http://www.flickr.com/photos/ursulageorges/7997105568/in/photostream

You'll see that the polytope appears to have a vertex at (-1,-1), when it 
should have a vertex at (-1,0).

Today, sagenb.org is running slowly, so I tried the virtual version on my 
Windows machine.  I think it's a slightly earlier version of Sage (I 
installed it last spring).

Here's code for the same polytope without blue dots on the integer points:

m = lattice_polytope.read_palp_matrix(r"""4 2
-1 0 
1 -2
-1 5
1 5
""")
p = LatticePolytope(m)
pl = p.plot3d(show_vindices=False, show_points=True, edge_color="blue")  
pl.show(frame=False, axes=True)

Here is the image that resulted.  This time the axes don't even seem to be 
passing through a point with integer coordinates!

http://www.flickr.com/photos/ursulageorges/7997110398/in/photostream

UAW

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




[sage-support] Re: Problem with sagecell server installation

2012-09-17 Thread Jason Grout

On 9/17/12 12:29 PM, kcrisman wrote:



On Monday, September 17, 2012 8:50:32 AM UTC-4, Jason Grout wrote:

On 9/16/12 8:53 AM, ma...@mendelu.cz  wrote:
 > Solved, I have to run make to generate new *.js and *.css files.

Exactly.  I'm glad you got it up and running!


Could one of you post a (cleaned up) version of this somewhere on the
wiki, analogous to the Sage server install wiki pages?  This looks like
a fairly circuitous route, with instructions from random tickets, for
someone unfamiliar with the cell server to follow.


Yes, I know.  We hadn't meant to (officially) support other 
installations besides the "main" one at aleph, but we're happy to oblige.


I made a start at https://github.com/sagemath/sagecell/issues/344, but I 
just merged a big pull request which changes the directory structure. 
So...it's not ready for widespread use and everyone to install it, but 
if someone wants to dive into it (like Robert did), we're happy to help.


Thanks,

Jason



--
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




[sage-support] Workaround: Sage 5.2 fails to build (mpir-2.4.0.p6) on Fedora 16 32-bit

2012-09-17 Thread rickhg12hs
On Wednesday, September 12, 2012 9:33:56 AM UTC-4, rickhg12hs wrote:
>
> On Monday, September 10, 2012 2:16:02 PM UTC-4, rickhg12hs wrote:
>>
>> After failing an upgrade from Sage v. 4.8, the Sage v. 5.2 source was 
>> downloaded (md5sum checked fine) and the build started.  The build 
>> failed with mpir-2.4.0.p6 complaining that "configure: error: ABI=32 
>> is not among the following valid choices: standard". 
>>
>
> Not done testing yet, and it's not ideal, but this workaround built 
> completely without error.
>
> $ MPIR_CONFIGURE='ABI=standard' make
>
>
Assigning  MPIR_CONFIGURE as above before executing make does seem to be an 
effective workaround.  Everything was built and all the tests (./sage 
-testall) passed.

Perhaps there's a configuration detection problem that requires this 
workaround?

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




[sage-support] Re: Problem with sagecell server installation

2012-09-17 Thread kcrisman


On Monday, September 17, 2012 8:50:32 AM UTC-4, Jason Grout wrote:
>
> On 9/16/12 8:53 AM, ma...@mendelu.cz  wrote: 
> > Solved, I have to run make to generate new *.js and *.css files. 
>
> Exactly.  I'm glad you got it up and running! 
>

Could one of you post a (cleaned up) version of this somewhere on the wiki, 
analogous to the Sage server install wiki pages?  This looks like a fairly 
circuitous route, with instructions from random tickets, for someone 
unfamiliar with the cell server to follow. 

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




[sage-support] Re: 2nd try: Integer solutions for systems of linear equations

2012-09-17 Thread moritz
Thanks for the reference to Hermite normal forms. I haven't quite figured 
out how to use it to solve the problem. Either I misunderstood something or 
it is not quite as easy as you describe it. Take this example

A=matrix(([1,5,0],[0,6,4]))
b=vector([3,1])
c=vector([5,2])

and consider Ax=b and Ax=c
so A is already in Hnf. But simple back solving does not do the trick: For 
Ax=b in the last row the equation becomes
0*x[0]+6*x[1]+4*x[2]==1
and according to your method, we get no solution (which is true), since we 
get a non-integer by dividing by 6.
For Ax=c, the last row reads:
0*x[0]+6*x[1]+4*x[2]==2
and again we could think that there is no solution since 2/6 is not an 
integer, but if we allow x[2] to be non-zero, we get the solution x[1] = 1, 
x[2] = -1.
(This can't be done for Ax=b, since the equation has no solution mod 2)
In generally, when "back solving" the equations maybe one has to calculate 
the gcd of the rows, and then find an integer solution, using some kind of 
extended Euclid's algorithm, if the gcd is 1. (Then a solution exists 
according to the Chinese remainder theorem..)

Anyhow I found a different solution: the smith normal form! (Which is 
already implemented in sage..)


def smithsolve(A,b):
D,U,V=A.smith_form()
c=U*b
d=D.diagonal()
y=vector(ZZ,D.ncols())
for i in [len(d),..,D.nrows()-1]:
if c[i]:
return 'no integer solution'
for i in range(len(d)):
if d[i]==0:
if c[i]==0:
y[i]=0
else:
return 'no integer solution'
else:
q=c[i]/d[i]
if q in ZZ:
y[i]=q
else:
return 'no integer solution'
x=V*y
return x

n=3
m=6
A=random_matrix(ZZ,n,m)
b=random_vector(ZZ,n)
x=smithsolve(A,b)
print A,b, x, A*x==b


Maybe an algorithm that uses the Hermite normal form would be faster.

One questions remains:

Should sage provide the functionality to give integer solutions of 
linear Diophantine equations if one asked for it, e.g. in the solve_right 
command? Wouldn't it be nice if the solve_right command could take an extra 
argument like "base ring" and try to solve it in that ring. For example 
something along the lines:
A.solve_right(b,base_ring=ZZ)

moritz

On Friday, September 14, 2012 5:18:15 PM UTC+2, Victor Miller wrote:
>
> Since the OP's problem has no inequalities (such as requiring that all 
> integers in question are non-negative), it is solved by using Hermite 
> normal form.
>
> If A is an m by n integer matrix, the Hermite normal form of A is an upper 
> triangular integer matrix H (also m by n), along with an m by m integer 
> matrix of determinant 1 (i.e. it's invertible) so that H = U A.  So the 
> original equation A x = b becomes (after multiplying by U): H x = U b, for 
> which it's easy to get the general solution (just back solve.  If you ever 
> get a non-integer by dividing there are no solutions).  Since U is 
> invertible, multiplying the equation by U doesn't introduce spurious 
> solutions.
>
> Victor
>
> On Friday, September 14, 2012 5:46:01 AM UTC-4, Nathann Cohen wrote:
>>
>> Helloo !!!
>>
>> To consider the problem as linear program and use 
>>> MixedIntegerLinearProgram()  with integer constrains works, but it is very 
>>> very slow for larger systems.
>>>
>>
>> Well, your problem is *precisely* what Integer Linear Program solvers are 
>> written for, so I guess that using them is the good way to go unless you 
>> plan on using some properties of the matrices you generate (and that the LP 
>> solvers would not notice) to solve your equation.
>>
>> They are indeed slow in some cases, but we have to work with the tools 
>> available, or rather those we know about. ILP's what I would try to do 
>> myself -- if you find some other way to solve these equations please let me 
>> know, for I use them very often and I would be delighted to solve my graph 
>> problems faster too :-)
>>
>> By the way, in Sage MixedIntegerLinearProgram uses GLPK by default to 
>> solve these problems, but you can also ask it to solve them with Gurobi or 
>> CPLEX, which are usually *MUCH* faster.
>>
>> Good luck ! :-)
>>
>> Nathann
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




[sage-support] Re: Problem with Windows version (Sage 5.1) and international keyboard

2012-09-17 Thread Socius
Hi Volker.

Sincerely at first I directly used the browser integrated in Virtual Box, 
with the problem I described. 
By changing and using instead my external browser, connected at 
http://localhost:8000, the keyboard layout is correctly recognized, so 
problem solved.

Thanks

S.


On Monday, September 17, 2012 11:00:18 AM UTC+2, Volker Braun wrote:
>
> Did you try this:
>
> http://wiki.sagemath.org/SageAppliance#Changing_the_keyboard_layout
>
>
>
>
> On Monday, September 17, 2012 1:50:35 AM UTC+1, Socius wrote:
>>
>> I installed it, but I have a serious problem. I am italian, and this new 
>> version doesn't correctly recognize the keyboard, for many important keys, 
>> as (, ) and so on.
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




[sage-support] Re: Problem with sagecell server installation

2012-09-17 Thread Jason Grout

On 9/16/12 8:53 AM, ma...@mendelu.cz wrote:

Solved, I have to run make to generate new *.js and *.css files.


Exactly.  I'm glad you got it up and running!

Thanks,

Jason


--
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




[sage-support] Re: finance.TimeSeries SIGSEGV

2012-09-17 Thread Rolandb
Hi, I followed the instructions of Jan Groenewald  and ... it works!

All thank for considering this item. Roland

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




Re: [sage-support] Re: finance.TimeSeries SIGSEGV

2012-09-17 Thread Jori Mantysalo

On Mon, 17 Sep 2012, Volker Braun wrote:


On Fedora: sudo yum install libgfortran

Or build from source, then Sage will built its own fortran.


Do it? To my experience this has failed and fortran is needed from host 
system.


--
Jori Mäntysalo

--
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




[sage-support] Re: finance.TimeSeries SIGSEGV

2012-09-17 Thread Volker Braun
On Fedora: sudo yum install libgfortran

Or build from source, then Sage will built its own fortran.



On Monday, September 17, 2012 10:44:24 AM UTC+1, Rolandb wrote:
>
> Hi all, thanks for the support!
>
> Version 5.0: no problem
>
> Versions 5.1 and 5.3: 
>
> ImportError: libgfortran.so.3: cannot open shared object file: No such file 
> or directory
>
> It boils down to how to install libgfortran... 
>
> Roland
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




[sage-support] Re: finance.TimeSeries SIGSEGV

2012-09-17 Thread Rolandb
Hi all, thanks for the support!

Version 5.0: no problem

Versions 5.1 and 5.3: 

ImportError: libgfortran.so.3: cannot open shared object file: No such file or 
directory

It boils down to how to install libgfortran... 

Roland

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




[sage-support] Re: Problem with Windows version (Sage 5.1) and international keyboard

2012-09-17 Thread Volker Braun
Did you try this:

http://wiki.sagemath.org/SageAppliance#Changing_the_keyboard_layout




On Monday, September 17, 2012 1:50:35 AM UTC+1, Socius wrote:
>
> I installed it, but I have a serious problem. I am italian, and this new 
> version doesn't correctly recognize the keyboard, for many important keys, 
> as (, ) and so on.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




Re: [sage-support] Field automorphism, root r1 as function of r2

2012-09-17 Thread David Loeffler
On 16 September 2012 05:29, Jori Mantysalo  wrote:
> For example x^3-3*x-1 has Galois group C_3, and galois_group(type="pari")
> can tell it. But how to get roots as function of others? In this example, if
> r1 is one of the roots, others are r^2-r-2 and -r^2+2.

sage: K. = NumberField(x^3-3*x-1)
sage: [s(a) for s in K.galois_group()]
[a, a^2 - a - 2, -a^2 + 2]

(The interface for Galois groups is rather confusing because there are
actually two independent implementations: one which calculates the
Galois group as an abstract group, and one which actually calculates
it as an explicit group of automorphisms of an explicitly given
splitting field, which is much slower. It would be a good coding
project to get the two to play a bit more nicely together, and improve
the docs, but nobody's done this so far.)

Hope this helps,

David

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.