That's exactly what I wanted to do f = F([omega],check=False)
Thank you :) Le jeudi 8 mai 2014 08:16:41 UTC+2, Martin Albrecht a écrit : > > Hi Nils, > > On Wednesday 07 May 2014 16:43:03 Nils Bruin wrote: > > On Wednesday, May 7, 2014 9:58:48 AM UTC-7, François Colas wrote: > > > What I want to do is a way to evaluate polynomials of K in a power of > a > > > primitive square root of unity: > > > > > > omega = CC(e^(2*I*pi/m)) > > > F = Hom(K, CC) > > > f = F([omega]) > > > TypeError: images do not define a valid homomorphism > > > > > > Does anyone see another way to do this? > > > > Have you tried using CyclotomicField(m) ? I think that uses specialized > > code, which should handle high degrees much better than generic number > > field code: > > unfortunately that's not the case for the OP, see: > > https://groups.google.com/forum/#!searchin/sage-devel/QuotientRing| > sort:date/sage-devel/qxGMiYDF4eQ/zDcTmXWJH9UJ<https://groups.google.com/forum/#!searchin/sage-devel/QuotientRing%7Csort:date/sage-devel/qxGMiYDF4eQ/zDcTmXWJH9UJ> > > > > sage: K=CyclotomicField(3*5*7*11) > > sage: K.coerce_embedding() > > Generic morphism: > > From: Cyclotomic Field of order 1155 and degree 480 > > To: Complex Lazy Field > > Defn: zeta1155 -> 0.9999852033056930? + 0.00543996044764063?*I > > > > Alternatively, if you really want to use an explicit quotient ring > > construction: > > > > f = F([omega],check=False) > > > > The error you run into otherwise is: > > > > sage: sage.rings.morphism.RingHomomorphism_im_gens(H,[omega]) > > ValueError: relations do not all (canonically) map to 0 under map > > determined by images of generators. > > > > i.e., the cyclotomic polynomial evaluated at omega doesn't return an > exact > > zero, because CC uses float arithmetic. > > Cheers, > Martin -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at http://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.