Class Groups of Number Fields

EXAMPLES:

sage: K.<a> = NumberField(x^2 + 23)
sage: I = K.class_group().gen(); I
Fractional ideal class (2, 1/2*a - 1/2)
sage: J = I * I; J
Fractional ideal class (2, 1/2*a + 1/2)
sage: O = K.OK(); O
Maximal Order in Number Field in a with defining polynomial x^2 + 23
sage: O*(2, 1/2*a + 1/2)
Fractional ideal (2, 1/2*a + 1/2)
sage: (O*(2, 1/2*a + 1/2)).is_principal()
False
sage: (O*(2, 1/2*a + 1/2))^3
Fractional ideal (1/2*a - 3/2)
class sage.rings.number_field.class_group.ClassGroup(invariants, names, number_field, gens)

Bases: sage.groups.abelian_gps.abelian_group.AbelianGroup_class

The class group of a number field.

gen(i=0)

Return the i-th generator for this class group.

EXAMPLES:

sage: C = NumberField(x^2 + 120071, 'a').class_group(); C
Class group of order 500 with structure C250 x C2 of Number Field in a with defining polynomial x^2 + 120071
sage: C.gen(0)
Fractional ideal class (130, 1/2*a + 137/2)
sage: C.gen(1)
Fractional ideal class (7, a)
gens()

Return generators for the class group.

EXAMPLES:

sage: K.<a> = NumberField(x^4 + 23)
sage: K.class_group().gens()   # random gens (platform dependent)
[Fractional ideal class (2, 1/2*a^2 - a + 3/2)]
ngens()

Return the number of generators of the class group.

EXAMPLES:

sage: C = NumberField(x^2 + x + 23899, 'a').class_group(); C
Class group of order 68 with structure C34 x C2 of Number Field in a with defining polynomial x^2 + x + 23899
sage: C.ngens()
2
number_field()

Return the number field that this class group is attached to.

EXAMPLES:

sage: C = NumberField(x^2 + 23, 'w').class_group(); C
Class group of order 3 with structure C3 of Number Field in w with defining polynomial x^2 + 23
sage: C.number_field()
Number Field in w with defining polynomial x^2 + 23
class sage.rings.number_field.class_group.FractionalIdealClass(ideal, class_group)

Bases: sage.structure.element.MultiplicativeGroupElement

A fractional ideal class in a number field.

EXAMPLES:

sage: G = NumberField(x^2 + 23,'a').class_group(); G
Class group of order 3 with structure C3 of Number Field in a with defining polynomial x^2 + 23
sage: I = G.0; I
Fractional ideal class (2, 1/2*a - 1/2)
sage: I*I
Fractional ideal class (2, 1/2*a + 1/2)
sage: I*I*I
Trivial principal fractional ideal class
gens()

Return generators for a representative ideal in this ideal class.

EXAMPLES:

sage: K.<w>=QuadraticField(-23)
sage: OK=K.ring_of_integers()
sage: C=OK.class_group()
sage: P2a,P2b=[P for P,e in (2*OK).factor()]
sage: c=C(P2a); c
Fractional ideal class (2, 1/2*w - 1/2)
sage: c.gens()
(2, 1/2*w - 1/2)
ideal()

Return a representative ideal in this ideal class.

EXAMPLE:

sage: K.<w>=QuadraticField(-23)
sage: OK=K.ring_of_integers()
sage: C=OK.class_group()
sage: P2a,P2b=[P for P,e in (2*OK).factor()]
sage: c=C(P2a); c
Fractional ideal class (2, 1/2*w - 1/2)
sage: c.ideal()
Fractional ideal (2, 1/2*w - 1/2)
is_principal()

Returns True iff this ideal class is the trivial (principal) class

EXAMPLES:

sage: K.<w>=QuadraticField(-23)
sage: OK=K.ring_of_integers()
sage: C=OK.class_group()
sage: P2a,P2b=[P for P,e in (2*OK).factor()]
sage: c=C(P2a)
sage: c.is_principal()    
False
sage: (c^2).is_principal()
False
sage: (c^3).is_principal()
True
multiplicative_order()

Return the order of this ideal class in the class group.

EXAMPLE:

sage: K.<w>=QuadraticField(-23)
sage: OK=K.ring_of_integers()
sage: C=OK.class_group()
sage: h=C.order(); h
3
sage: P2a,P2b=[P for P,e in (2*OK).factor()]
sage: c=C(P2a); c
Fractional ideal class (2, 1/2*w - 1/2)
sage: c.order()
3

sage: k.<a> = NumberField(x^2 + 20072); G = k.class_group(); G
Class group of order 76 with structure C38 x C2 of Number Field in a with defining polynomial x^2 + 20072
sage: [c.order() for c in G.gens()]
[38, 2]
order()

Return the order of this ideal class in the class group.

EXAMPLE:

sage: K.<w>=QuadraticField(-23)
sage: OK=K.ring_of_integers()
sage: C=OK.class_group()
sage: h=C.order(); h
3
sage: P2a,P2b=[P for P,e in (2*OK).factor()]
sage: c=C(P2a); c
Fractional ideal class (2, 1/2*w - 1/2)
sage: c.order()
3

sage: k.<a> = NumberField(x^2 + 20072); G = k.class_group(); G
Class group of order 76 with structure C38 x C2 of Number Field in a with defining polynomial x^2 + 20072
sage: [c.order() for c in G.gens()]
[38, 2]
reduce()

Return representative for this ideal class that has been reduced using PARI’s idealred.

EXAMPLES:

sage: k.<a> = NumberField(x^2 + 20072); G = k.class_group(); G
Class group of order 76 with structure C38 x C2 of Number Field in a with defining polynomial x^2 + 20072
sage: I = G.0; I
Fractional ideal class (41, a + 10)
sage: J = G(I.ideal()^5); J
Fractional ideal class (115856201, 1/2*a + 40407883) 
sage: J.reduce()
Fractional ideal class (57, 1/2*a + 44)

Previous topic

Relative Number Field Ideals

Next topic

Galois Groups of Number Fields

This Page