An element of a class group is stored as a pair consisting of both an explicit ideal in that ideal class, and a list of exponents giving that ideal class in terms of the generators of the parent class group. These can be accessed with the ideal() and list() methods respectively.
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: J.list()
[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)
Bases: sage.groups.abelian_gps.abelian_group.AbelianGroup_class
The class group of a number field.
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) # random
Fractional ideal class (130, 1/2*a + 137/2)
sage: C.gen(1) # random
Fractional ideal class (7, a)
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)]
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
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
Bases: sage.groups.abelian_gps.abelian_group_element.AbelianGroupElement
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)
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)
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)
Return the multiplicative inverse of this ideal class.
EXAMPLE:
sage: K.<a> = NumberField(x^3 - 3*x + 8); G = K.class_group()
sage: G(2, a).inverse()
Fractional ideal class (2, a^2 + 2*a - 1)
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
Alias for order().
EXAMPLE:
sage: K.<w>=QuadraticField(-23)
sage: K.class_group()(K.primes_above(2)[0]).multiplicative_order()
3
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]
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, 1/2*a + 5)
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)
Bases: sage.rings.number_field.class_group.ClassGroup
The S-class group of a number field.
Return the set (or rather tuple) of primes used to define this class group.
EXAMPLES:
sage: K.<a> = QuadraticField(-14)
sage: I = K.ideal(2,a)
sage: S = (I,)
sage: CS = K.S_class_group(S);CS
Class group of order 2 with structure C2 of Number Field in a with defining polynomial x^2 + 14
sage: T = tuple([])
sage: CT = K.S_class_group(T);CT
Class group of order 4 with structure C4 of Number Field in a with defining polynomial x^2 + 14
sage: CS.S()
(Fractional ideal (2, a),)
sage: CT.S()
()
Bases: sage.groups.abelian_gps.abelian_group_element.AbelianGroupElement
An S-fractional ideal class in a number field for a tuple of primes S.
Returns a representative ideal for this S-ideal class.
EXAMPLES:
sage: K.<a> = QuadraticField(-14)
sage: I = K.ideal(2,a)
sage: S = (I,)
sage: CS = K.S_class_group(S)
sage: J = K.ideal(7,a)
sage: G = K.ideal(3,a+1)
sage: CS(I).ideal()
Fractional ideal (2, a)
sage: CS(J).ideal()
Fractional ideal (7, a)
sage: CS(G).ideal()
Fractional ideal (3, a + 1)
Finds the inverse of the given S-ideal class.
EXAMPLES:
sage: K.<a> = QuadraticField(-14)
sage: I = K.ideal(2,a)
sage: S = (I,)
sage: CS = K.S_class_group(S)
sage: G = K.ideal(3,a+1)
sage: CS(G).inverse()
Class of the Fractional ideal class (3, a + 2) in the S-class group of Number Field in a with defining polynomial x^2 + 14
Finds the order of the given S-ideal class.
EXAMPLES:
sage: K.<a> = QuadraticField(-14)
sage: I = K.ideal(2,a)
sage: S = (I,)
sage: CS = K.S_class_group(S)
sage: J = K.ideal(7,a)
sage: G = K.ideal(3,a+1)
sage: CS(I).order()
1
sage: CS(J).order()
1
sage: CS(G).order()
2