[Next][Prev] [Right] [Left] [Up] [Index] [Root]

Operations on Structures

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.

Subsections
AssignNames(~F, [s]) : FldQuad, [ MonStgElt ]) ->
AssignNames(~O, [s]) : RngQuad, [ MonStgElt ]) ->
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.

Name(F, 1) : FldQuad, RngIntElt -> FldQuadElt
Name(O, 1) : RngQuad, RngIntElt -> RngQuadElt
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 epsilon_d in a suborder of the maximal order or f Sqrt(d) in a suborder of the equation order.
FundamentalUnit(K) : FldQuad -> FldQuadElt
FundamentalUnit(O) : RngQuad -> RngQuadElt
A generator for the unit group of the order O or the maximal order of the quadratic field K.
Discriminant(K) : FldQuad -> RngIntElt
The discriminant of the field K which is only defined up to squares. The discriminant will be the discriminant of the polynomial or better.
Conductor(K) : FldQuad -> RngIntElt
The conductor of the field K which is the order of the smallest cyclotomic field containing K.
Conductor(O) : RngQuad -> RngIntElt
The conductor of the order O, which equals the index of O in the maximal order.

Ideal Class Group

The function ClassGroup is available for number fields and orders in general but a different and faster algorithm is used for the quadratics. All of the algorithms are based on binary quadratic forms, see tttRef{QuadBin:ClassGroup} in Chapter BINARY QUADRATIC FORMS for details.

ClassGroup(K) : FldQuad -> GrpAb, Map
ClassGroup(O) : RngQuad -> GrpAb, Map
    FactorBasisBound: FldPrElt          Default: 0.1
    ProofBound: FldPrElt                Default: 6
    ExtraRelations: RngIntElt           Default: 1
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. For details on the parameters see tttRef{QuadBin:ClassGroup} in Chapter BINARY QUADRATIC FORMS.
ClassNumber(K) : FldQuad -> RngIntElt
ClassNumber(O) : RngQuad -> RngIntElt
    FactorBasisBound: FldPrElt          Default: 0.1
    ProofBound: FldPrElt                Default: 6
    ExtraRelations: RngIntElt           Default: 1
The class number of the maximal order O or the maximal order of the quadratic field K.
PicardGroup(O) : RngQuad -> GrpAb, Map
PicardNumber(O) : RngQuad -> RngIntElt
    FactorBasisBound: FldPrElt          Default: 0.1
    ProofBound: FldPrElt                Default: 6
    ExtraRelations: RngIntElt           Default: 1
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.

Norm Equations

For imaginary quadratic fields, (that is, for quadratic fields Q(sqrt 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 on Conics for details.

NormEquation(F, m) : FldQuad, RngIntElt -> BoolElt, SeqEnum
NormEquation(F, m: parameters) : FldQuad, RngIntElt -> BoolElt, SeqEnum
NormEquation(O, m) : RngQuad, RngIntElt -> BoolElt, SeqEnum
NormEquation(O, m: parameters) : RngQuad, RngIntElt -> BoolElt, SeqEnum
    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 alpha in the ring of integers O_F of F with norm m, and false otherwise. Instead of searching the maximal order O_F it is possible to search any suborder O of O_F for such element alpha 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 equiv1bmod4 (and squarefree) this function searches for a solution in integers to x^2 + y^2d=4m (and the solution alpha=(x + ySqrt(d)/2) is returned), whereas for d = 2, 3bmod4 a solution alpha=x + ySqrt(d) with x^2 + y^2d=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 f^2d. 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 tttRef{Env: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 Norm Equations for a description.


Example FldQuad_norm-equation (H54E3)

> 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

 [Next][Prev] [Right] [Left] [Up] [Index] [Root]