Let K be an imaginary quadratic field and OK its ring of integers.
What's the best way of creating the complex-conjugation automorphism
of OK in Sage?

I tried
sage: K.<a> = QuadraticField(-5)
sage: OK = K.ring_of_integers()
sage: OK.ring_generators()
[a]
sage: OK.hom([-a], OK)
TypeError: images do not define a valid homomorphism

Trying

sage: OK.hom([-a], OK, check=False)

gives an IndexError, but that seems to be in the _repr_ routine,
since

sage: sigma = OK.hom([-a], OK, check=False)

works fine.

Then calling sigma(foo) for foo an element of OK works fine and gives
the right answer, but when I ask foo to print itself, funny things
happen.

Clearly the hom constructor wants to know the images of the ring
generators, not the module generators, since OK.hom([1, -a], OK,
check=False) returns the map sending r + sa to r + s; but perhaps the
check and repr routines are getting confused between ring and module
generators?

David
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to