I only just saw this thread. I wrote the units functionality (of course pari does the hard work); I think Francis Clarke made some changes so that things work for relative extensions too. [If anything for relative extensions works properly in Sage, it is usually Francis who takes the credit].
As this has been fixed in 4.0.2 which will be released soon, I suggest that mac8090 waits. I would not recommend picking a single patch and expecting it to work on its own as patches tend to depend on one another. Anyway, neither bonzerpotato nor mac8090 ever said which version they were running (that I can see), which is surely a normal prerequisite for getting any help at all! John Cremona On Jun 17, 8:22 pm, Craig Citro <craigci...@gmail.com> wrote: > Hi, > > > thanks! however, not quite there - how do I get the units in terms of > > q? > > So I just tried this in sage 4.0.2.rc2, and here's what I got: > > sage: K.<q> = NumberField(x^2+2) ; K > Number Field in q with defining polynomial x^2 + 2 > sage: B.<x> = K[] > sage: A.<c> = K.extension(x^3+(q^3)*x^2+(2*q^2)*x-3*q) > sage: A.unit > A.unit_group A.unit_ideal A.units > sage: A.unit_group() > Unit group with structure C2 x Z x Z of Number Field in c with > defining polynomial x^3 - 2*q*x^2 - 4*x - 3*q over its base field > sage: A.units() > [q*c - 1, (-405*q - 1845)*c^2 + (674*q - 3960)*c - 2058*q - 1465] > > Is that what you were looking for? You could also do this (continuing > the above session): > > sage: U = A.unit_group() > sage: U.gens() > [-1, q*c - 1, (-405*q - 1845)*c^2 + (674*q - 3960)*c - 2058*q - 1465] > > To be honest, I haven't thought at all about what new patches made > this work (as the .units() call clearly failed before) -- but I bet > the patch was by either Nick Alexander or John Cremona, so maybe one > of them can pipe in and say "oh, I fixed that" to earn their fame and > glory. ;) > > -cc --~--~---------~--~----~------------~-------~--~----~ 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 For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---