UserManual

quad

The module `quad' is for computations of imaginary quadratic fields.

Functions

class_formula(disc, uprbd)

Return the approximation of the class number 'h' with the given discriminant by the formula: h = w sqrt(|D|)/(2 π) Π(1 - (D/p)(1/p))^{-1} approximated by computing only prime p's less than uprbd.

class_number(disc, [limit_of_disc])

Return the class number with the given discriminant by counting reduced forms. Not only fundamental discriminant.

class_number_bsgs(disc)

Return the class number with the given discriminant using Shanks's Baby-Step Giant-Step Method.

class_group(disc, [limit_of_disc])

Return the class number and the class group element with the given discriminant by counting reduced forms. Not only fundamental discriminant.

class_group_bsgs(disc, classnum, qin)

Return the construction of the class group of order p**exp with the given discriminant using Shanks's Baby-Step Giant-Step Method, where 'qin' = [p, exp] and p**exp divides 'classnum'.

Example1:

>>>quad.class_group_bsgs(-1200, 12, [2, 2]) 
[12, 0, 25], [3, 0, 100]], [[2], [2, 0]]

This means 2*[12, 0, 25] = 1 and 2*[3, 0, 100] = 1, i.e. group of order 4 is direct sum of cyclic groups of order 2. And [12, 0, 25] and [3, 0, 100] are generators of cyclic groups.

Example2:

>>>quad.class_group_bsgs(-120000, 120, [2, 3])

disc(f)

Return the discriminant of the given quadratic form. f = [a[0], a[1], a[2]].

compositePDF(f_1 ,f_2)

Return the reduced form of composition of the given forms. 'f_1' and 'f_2' are quadratic forms with same disc.

reducePDF(f)

Return the reduced form of the given quadratic form. f = (a[0], a[1], a[2]).

sqrPDF(f)

Return the square of the given quadratic form.

powPDF(f, exp)

Return the powering 'exp' of the given quadratic form.

Classes