On 11/1/07, Utpal Sarkar <[EMAIL PROTECTED]> wrote:
> I'm doing some simple things with class groups, and some things don't
> work as expected.
> Let G be a class group of a number field.

sage: K.<a> = NumberField(x^2 + 23)
sage: G = K.class_group(); G
Class group of order 3 with structure C3 of Number Field in a with
defining polynomial x^2 + 23

> I am interested in obtaining
> the actual ideal classes
> (is there an easy direct way? list(G) returns abstract elements. Is it
> possible to obtain a map from the class group to the ideal group,
> mapping class group elements to representatives?)

This is not implemented yet (the function list is just
something implemented in the base abstract abelian
group class, which is inherited -- it doesn't do anything
useful in this case, really.)   Class groups were only
added to sage very recently, and aren't fully implemented.
Adding code to enumerate all elements will show up in Sage
soon, but it will take some work.

> Since generators of G can be obtained as ideal classes, to obtain all
> of them you just have to multiply powers of the generators, and for
> that it would be useful to know the orders of the generators.
> When I call
> (G.0).order()
> it shows an error message saying that it is not implemented (which
> seems strange).

It isn't implemented.  You could implement a dumb order
function though:

sage: K.<a> = NumberField(x^2 + 23)
sage: G = K.class_group(); G
Class group of order 3 with structure C3 of Number Field in a with
defining polynomial x^2 + 23
sage: G.gens()
[Fractional ideal class (2, 1/2*a - 1/2)]
sage: a = G.0
sage: def myorder(I):
...       n = 1
...       J = I
...       while J != 1:
...           J = J * I
...           n += 1
...       return n
sage: myorder(a)
3

--

I don't recommend doing this -- it's much better to understand
how fractional ideals, etc. are represented using the PARI
C library in Sage, then use a call to PARI to determine the
order of the fractional ideal class.   This is what I'll do
when I implement this in the Sage library.

>  I tried to work around this by generating the
> subgroups of G generated by these generators of G in turn to obtain
> their orders, but when I say
> G.subgroup([G.0])
> or
> G.subgroup(G.gens())
> an error results, saying that the elements passed don't belong to G.

That's because creating subgroups of ideal class groups is not
implemented.  Sage should produce a NotImplementedError in this case
too.

I've created trac ticket #1052

   http://trac.sagemath.org/sage_trac/ticket/1052

which is to implement more functionality for class groups
of number fields in Sage.    The class I'm teaching
right now starts on class groups tomorrow, incidentally...
   http://wiki.wstein.org/ant07/sched


 -- William

--~--~---------~--~----~------------~-------~--~----~
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://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/
-~----------~----~----~----~------~----~------~--~---

Reply via email to