Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implement more functionality for class groups of number fields #1052

Closed
williamstein opened this issue Nov 1, 2007 · 7 comments
Closed

implement more functionality for class groups of number fields #1052

williamstein opened this issue Nov 1, 2007 · 7 comments

Comments

@williamstein
Copy link
Contributor

There are some feature requests in this email.

On 11/1/07, Utpal Sarkar 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. 



 -- William}}}

Component: number fields

Reviewer: John Cremona

Issue created by migration from https://trac.sagemath.org/ticket/1052

@williamstein williamstein added this to the sage-4.6 milestone Nov 1, 2007
@williamstein williamstein self-assigned this Nov 1, 2007
@williamstein
Copy link
Contributor Author

comment:1

NOTE: The AbelianGroup class needs to be refactored, so there is an abstract base class, with lots of NotImplementedErrors, then AbelianGroup_that_David_implemented derives from that as does ClassGroup. Same with elements. This will avoid a lot of the confusion in evidence in the above email.

@ncalexan
Copy link
Mannequin

ncalexan mannequin commented Nov 5, 2007

comment:2
sage: K.<a> = NumberField(x^3 + 1838)
sage: C = K.class_group(); C
Class group of order 27 with structure C9 x C3 of Number Field in a with defining polynomial x^3 + 1838
sage: C.gens()
[Fractional ideal class (50, a - 8), Fractional ideal class (26, a - 2)]
sage: I = C.gen(0)
sage: I^-1
---------------------------------------------------------------------------
<type 'exceptions.AttributeError'>        Traceback (most recent call last)

/Users/ncalexan/sage-2.7.2/devel/sage-bugday2/<ipython console> in <module>()

/Users/ncalexan/sage-2.7.2/devel/sage-bugday2/element.pyx in sage.structure.element.MonoidElement.__pow__()

/Users/ncalexan/sage-2.7.2/devel/sage-bugday2/element.pyx in sage.structure.element.generic_power_c()

/Users/ncalexan/sage-2.7.2/devel/sage-bugday2/element.pyx in sage.structure.element.MultiplicativeGroupElement.__invert__()

/Users/ncalexan/sage-2.7.2/devel/sage-bugday2/element.pyx in sage.structure.element.MultiplicativeGroupElement.__div__()

/Users/ncalexan/sage-2.7.2/devel/sage-bugday2/coerce.pyx in sage.structure.coerce.CoercionModel_cache_maps.bin_op_c()

/Users/ncalexan/sage-2.7.2/devel/sage-bugday2/element.pyx in sage.structure.element.MultiplicativeGroupElement.__div__()

/Users/ncalexan/sage-2.7.2/devel/sage-bugday2/element.pyx in sage.structure.element.MultiplicativeGroupElement._div_()

/Users/ncalexan/sage-2.7.2/devel/sage-bugday2/element.pyx in sage.structure.element.MultiplicativeGroupElement._div_c_impl()

<type 'exceptions.AttributeError'>: 'ClassGroup' object has no attribute 'fraction_field'

@loefflerd loefflerd mannequin assigned loefflerd and unassigned williamstein Jul 20, 2009
@jdemeyer
Copy link

comment:4

The following works for me in sage-4.6.alpha3, so needs_review as "already fixed".

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.0).order()
3
sage: list(G)
[Trivial principal fractional ideal class, Fractional ideal class (2, 1/2*a - 1/2), Fractional ideal class (2, 1/2*a + 1/2)]

@jdemeyer jdemeyer removed this from the sage-4.6 milestone Oct 10, 2010
@JohnCremona
Copy link
Member

comment:5

I agree with Jeroen, and Nick A's example also now works, so I have made the "positive review" and the next release manager can mark it as fixed.

@jdemeyer
Copy link

jdemeyer commented Nov 1, 2010

Merged: sage-4.6.1.alpha0

@jdemeyer
Copy link

jdemeyer commented Nov 1, 2010

Reviewer: John Cremona

@jdemeyer
Copy link

jdemeyer commented Nov 1, 2010

Changed merged from sage-4.6.1.alpha0 to none

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants