The majority of functions for quadratic fields and orders apply identically to number fields and orders in general. The functions which exist only for quadratic fields and orders are listed here along with those which deserve a special mention.
Procedure to change the name of the generator of a quadratic field F or an order O in a quadratic field to the string s. Elements of the quadratic field Q(Sqrt(d)) with m squarefree will be printed in the form 1/b*(x + y*s), where b, x, y are integers. Similarly, for an order O of conductor f in a quadratic field elements will be printed in the format x + y*s.This procedure only changes the name used in printing the elements of F or O, it does not make an assignment to an identifier s. To do this, use an assignment statement, or angle brackets when creating the field or order: F<s> := QuadraticField(-3);.
Note that since this is a procedure that modifies F or O, it is necessary to have a reference ~ in the call to this function.
Given a quadratic field F or one of its orders O, return the element which has the name attached to it, that is, return Sqrt(d) in the field, or f εd in a suborder of the maximal order or f Sqrt(d) in a suborder of the equation order.
A generator for the unit group of the order O or the maximal order of the quadratic field K.
The discriminant of the field K which is only defined up to squares. The discriminant will be the discriminant of the polynomial or better.
The conductor of the field K which is the order of the smallest cyclotomic field containing K and a sequence containing the ramified real places of K.
The conductor of the order O, which equals the index of O in the maximal order.
The function ClassGroup is available for number fields and orders in general but a different and faster algorithm is used by default for the quadratics. All of the algorithms, except for the sieving method described in [Jac99] which uses the multiple polynomial quadratic sieve (MPQS), are based on binary quadratic forms, see ClassGroup in Chapter BINARY QUADRATIC FORMS for details.
FactorBasisBound: FldReElt Default: 0.1
ProofBound: FldReElt Default: 6
ExtraRelations: RngIntElt Default: 1
Al: MonStgElt Default: "Automatic"
SetVerbose("ClassGroupSieve", n): Maximum: 5
The class group of a maximal order O or the maximal order of the quadratic field K, as an abelian group. The function also returns a map between the group and the power structure of ideals of O or the maximal order of K. The parameter Al can be set to "Sieve" or "NoSieve" to control whether the sieving algorithm is used or not; by default it is used when the discriminant is greater than 1020. For more details on the parameters see ClassGroup in Chapter BINARY QUADRATIC FORMS.
FactorBasisBound: FldReElt Default: 0.1
ProofBound: FldReElt Default: 6
ExtraRelations: RngIntElt Default: 1
Al: MonStgElt Default: "Automatic"
The class number of the maximal order O or the maximal order of the quadratic field K.
FactorBasisBound: FldReElt Default: 0.1
ProofBound: FldReElt Default: 6
ExtraRelations: RngIntElt Default: 1
Al: MonStgElt Default: "Automatic"
The picard group (the group of the invertible ideals of O modulo the principal ones) of the order O or the size of this group. PicardGroup also returns a map from the group to the ideals of O.
> D:=-(10^(30) + 3 ); > K := QuadraticField(D); > time G, m := ClassGroup(K : Al := "Sieve"); Time: 10.750 > G, m; Abelian Group isomorphic to Z/125355959329602 Defined on 1 generator Relations: 125355959329602*G.1 = 0 Mapping from: GrpAb: G to Set of ideals of Maximal Order of K > m(G.1); Ideal Two element generators: 385706622580333 148769598702327446467038390888*$.2 + 307255216496036 > $1 @@ m; G.1And now a field with positive discriminant.
> K := QuadraticField(NextPrime(10^24)); > time G, m := ClassGroup(K : Al := "Sieve"); Time: 3.330 > G, m; Abelian Group isomorphic to Z/3 Defined on 1 generator Relations: 3*$.1 = 0 Mapping from: GrpAb: G to Set of ideals of Maximal Equation Order of K > m(G.1); Ideal Two element generators: 3847 $.2 + 616 > $1 @@ m; G.1 > IsPrincipal($2^3); true
Factorization: RngIntEltFact Default: []
Use the Bosma-Stevenhagen algorithm to compute the 2-part of the class group of a quadratic order. Returned are: an array of forms that generates the 2-part and an array that gives the orders of the respective elements. The Factorization of the given discriminant can be given as additional information.
> G, f := QuadraticClassGroupTwoPart(33923894057872); G; Abelian Group isomorphic to Z/2 + Z/2 + Z/2 + Z/4 + Z/16 + Z/16 > Random(G); 11*G.1 + 2*G.2 + G.3 + G.4 + G.6 > f($1); <-1212992,3947508,3780131> > G, f := QuadraticClassGroupTwoPart(QuadraticField(33923894057872)); G; Abelian Group isomorphic to Z/2 + Z/8 + Z/16
For imaginary quadratic fields, (that is, for quadratic fields Q(√m) with m < 0), the function NormEquation is provided specially for quadratics to find integral elements of a given norm. For real quadratic fields conics are used, see Section Finding Points for details.
Factorization: [<RngIntElt, RngIntElt>] Default:
All: BoolElt Default: true
Solutions: RngIntElt Default: All
Exact: BoolElt Default: false
Ineq: BoolElt Default: false
SetVerbose("NormEquation", n): Maximum: 1
Given quadratic field F and a non-negative integer m, return true if there exists an element α in the ring of integers OF of F with norm m, and false otherwise. Instead of searching the maximal order OF it is possible to search any suborder O of OF for such element α by supplying O as a first argument.For imaginary quadratic fields the method used is constructive (it uses Cornacchia's algorithm, see [Coh93] section 1.5.2), and if the value true is returned then a solution [x] is also returned as a second return value.
Note that if the discriminant F=Q(Sqrt(d)) with d ≡ 1bmod4 (and squarefree) this function searches for a solution in integers to x2 + y2d=4m (and the solution α=(x + ySqrt(d)/2) is returned), whereas for d ≡ 2, 3bmod4 a solution α=x + ySqrt(d) with x2 + y2d=m in integers x, y is returned, if it exists. In an order of conductor f a search is conducted for a solution to the same equation with d replaced by f2d. Note that a version of NormEquation with integer arguments d and m also exists (see Section The Solution of Modular Equations).
Unless m is the square of an integer, the factorization of m is used by the algorithm; if it is known, it may be supplied as the value of the optional parameter Factorization to speed up the calculation.
A verbose flag can be set to obtain some information on progress with the computation (see SetVerbose).
For real quadratic fields the same algorithm is used as for the general number fields. The last 4 parameters refer to this algorithm. See Section Solving Norm Equations for a description.
> d := 302401481761723680; > m := 76814814791186002463716; > Q<z> := QuadraticField(-d); > O<w> := sub< MaximalOrder(Q) | 6 >; > f, s := NormEquation(O, m); > s, Norm(s[1]); 406 + 1008*w 76814814791186002463716