Question? I must be misunderstanding what you are saying, because it
seems to me that in Sage the unit group is O_K^*:
sage: K.<a> = QuadraticField(-3)
sage: UK = K.unit_group(); UK
Unit group with structure C6 of Number Field in a with
defining polynomial x^2 + 3
sage: UK.gens()
[-1/2*a + 1/2]
Best,
Alex
--
Alex Ghitza -- http://aghitza.org/
Lecturer in Mathematics -- The University of Melbourne -- Australia
I'm confused by what you mean by "former" and "later" above, since it
seems you got things
mixed up. Just for clarification, in Sage "the unit group of a number
field K" is O_K^*.
sage: K.<a> = NumberField(x^3 + x+1)
sage: K.unit_group()
Unit group with structure C2 x Z of Number Field in a with defining
polynomial x^3 + x + 1
which is the same as in Magma:
sage: Km = magma(K)
sage: Km.UnitGroup()
Abelian Group isomorphic to Z/2 + Z
Defined on 2 generators
Relations:
2*$.1 = 0
http://www.sagemath.org/doc/reference/sage/rings/number_field/unit_group.html
It's *definitely* indisputably the case that any paper I've ever seen
in number theory that used the phrase "unit group of a number
field..." means O_K^*. However, obviously, if the paper wrote "K^*",
that would mean the nonzero elements of K, which may be a useful
object to support as well.
If Sage didn't already have K.unit_group() mean "O_K^*" for several
years now, I would be more interesting in discussing this. As is, it
would be a little scary to change this and hence break code.
What about the following compromise:
sage: K.<a> = NumberField(x^3 + x+1)
sage: K.unit_group()
Unit group with structure C2 x Z of Number Field in a with defining
polynomial x^3 + x + 1
sage: K.multiplicative_group()
Multiplicative group of nonzero elements of Number Field in a with
defining polynomial x^3 + x + 1
Moreover, the docstrings for unit_group and multiplicative_group would
both immediately explain the "situation".
-- William
> Opinions? Comments?
>
> --David
>
> --
> You received this message because you are subscribed to the Google Groups "sage-nt" group.
> To post to this group, send an email to sag...@googlegroups.com.
> To unsubscribe from this group, send email to sage-nt+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/sage-nt?hl=en-GB.
>
>
--
William Stein
Professor of Mathematics
University of Washington
http://wstein.org
For this to be absolutely clear and mathematically correct, replace
"of" by "of the maximal order of" (and do the same throughout the
documentation).
Shouldn't there also be a function unit_group() for orders? Then we
could have K.unit_group() and K.maximal_order().unit_group() give the
same output.
ps. I would have also said that K.unit_group() should return K^* (and
was surprised when I found out for the first time that it didn't), but
agree with WiIliam's argument about not breaking code.
I explained in detail in my post how to create K^*. Please reread it.
-- William
I think it would be more consistent to move things pertaining to the
ring of integers (or more generally an order) of a number field into
the objects we have for that purpose. So:
sage: K = NumberField(x^2 - 2, 'a')
sage: K.unit_group()
K^*
sage: K.maximal_order().unit_group()
O_K^*
But that may not be possible due to backward compatibility.
Nick