[sage-support] Re: Calculating with primitive roots of unity in sage

2012-04-15 Thread Volker Braun
In characteristic zero there is a dedicated CyclotomicField. Presumably this is the most efficient implementation. On Sunday, April 15, 2012 9:53:41 AM UTC-4, Andrew Mathas wrote: Hi, I was wondering if some one can tell me the most efficient way of doing calculations with roots of

[sage-support] Re: Calculating with primitive roots of unity in sage

2012-04-15 Thread John Cremona
As Volker said, over Q specifically the right thing to do is use CyclotomicField(): sage: K.z = CyclotomicField(5) sage: z^5 1 sage: CC(z) 0.309016994374947 + 0.951056516295154*I sage: CC(z) == CC(exp(2*pi*i/5)) True Note that the latter is True because Sage constructs Cyclotomic fields with a

[sage-support] Re: to_poly_solve inconsistency for periodic functions

2012-04-15 Thread Duc Trung Ha
OK, I WILL try strive to do my best... BTW By Maxima list is meant Maxima Google support group or something else? On Tuesday, April 10, 2012 5:03:13 PM UTC+2, kcrisman wrote: On Saturday, April 7, 2012 1:49:22 PM UTC-4, Duc Trung Ha wrote: Hola, I was wondering

Re: [sage-support] Random Polynomials with restricted coefficients and homogeneous.

2012-04-15 Thread PavelY
Thank You Robert. That really helped out! Although, I'm not sure what (x/y) * y^10 means in : sage: S.random_element(x=-9,y=0, degree=10)(x/y) * y^10 On Friday, April 13, 2012 10:15:48 PM UTC-4, Robert Bradshaw wrote: Doing sage: ZZ.random_element? tells you that ZZ takes x and y

[sage-support] Re: Calculating with primitive roots of unity in sage

2012-04-15 Thread Andrew Mathas
Thanks for the replies! Over other fields it's no good just extending by a root of the n'th cyclotomic polynomial, since that need not be irreducible! The example you gave was particularly unfortunate since over GF(5) the 5th cyclotomic poly has only 1 root with multiplicity 4. So it's