[Next] [Prev] [_____] [Left] [Up] [Index] [Root]
Functions Relating to Forms

Functions Relating to Forms

Subsections

The Discriminant

Discriminant(f) : MagFormElt -> RngIntElt
The discriminant b^2 - 4ac of a quadratic form f=aX^2 + bXY + cY^2.
IsDiscriminant(d) : RngIntElt -> BoolElt
True if d is the discriminant of some quadratic form; false otherwise.
FundamentalDiscriminant(d) : RngIntElt -> RngIntElt
The fundamental discriminant corresponding to d.
IsFundamental(d) : RngIntElt -> BoolElt
True if d is a fundamental discriminant; false otherwise.
WeberPolynomial(d) : RngIntElt -> RngUPolElt
The Weber polynomial for the fundamental discriminant d, which must be negative.

Arithmetic

f * g : MagFormElt, MagFormElt -> MagFormElt
Composition(f, g) : MagFormElt, MagFormElt -> MagFormElt
    Al: MonStrngElt                     Default: "Shanks"
    Reduction: BoolElt                  Default: Reduction
The composition of two binary quadratic forms f and g.

The optional argument Al can be used on the Composition function to specify whether the algorithm of Gauss or that of Shanks is to be used -- the latter is the default (and requires f and g to have the same discriminant.

The other optional argument must be Reduction (default) or NoReduction, and can be used to indicate whether or not a reduced composite is required.

f ^ n : MagFormElt, RngIntElt -> MagFormElt
Power(f, n) : MagFormElt, RngIntElt -> MagFormElt
    Al: MonStrngElt                     Default: "Shanks"
    Reduction: BoolElt                  Default: Reduction
The n-fold composition of a form f. The optional arguments are as in composition.
Reduction(f) : MagFormElt -> MagFormElt
Returns a binary form equivalent to f that is reduced.
ReductionStep(f) : MagFormElt -> MagFormElt
Returns the result of applying one reduction step to the quadratic form f.
IsReduced(f) : MagFormElt -> BoolElt
True if the quadratic form f is reduced; false otherwise.

Example FldQuad_Forms (H34E4)

We give an example of some computations in the class group of a real quadratic field. Elements in the class group are not represented by single reduced forms but by cycles of equivalent reduced forms.

> Q<z> := QuadraticField(7537543);                        // arbitrary choice
> C, m := ClassGroup(Q);
> C;
Abelian Group isomorphic to Z/2 + Z/76
Defined on 2 generators
Relations:
    76*C.1 = 0
    2*C.2 = 0
>                                    // get the generators as quadratic forms:
> f := m(C.1);
> g := m(C.2);
> h := g^2;
> g, h;
<-1038,4894,1493> <-887,4340,3189>
> c := [];                     // create the cycle of forms equivalent to g^2:
> repeat 
>     h := ReductionStep(h);
>     Append( c, h);
> until h eq g^2;
> P := Parent(g);
> One(P) in c;
true                 // this proves that the second class has order dividing 2
> for d in Divisors(76) do
>     c := [];
>     h := f^d;
>     repeat h := ReductionStep(h); Append( c, h);
>     until h eq f^d;
>     print d, One(P) in c, #c;
> end for;
1 false 16
2 false 14
4 false 12                           // the cycle lengths vary
19 false 18
38 false 16
76 true 14                           // so the true order of this class is 76

Matrix Action on Forms

f * M : MagFormElt, GrpMatElt -> MagFormElt
The action of SL(2, Z) on forms.

Example FldQuad_Represent (H34E5)

The following example checks for primes p with 65 <= p <= 1000 and p equiv1 mod 4 a result that was conjectured by Euler and proved by Gauss, namely that z^4 = 2 mod p has a solution iff p=x^2 + 64y^2 for some x, y.

We use the function NormEquation to find the prime above p in the Gaussian integers, and we build the set of such primes for which 2 is a biquadratic residue (which means that z^4 = 2 mod p for some z).

> s := { };
> Q := QuadraticField(-1);
> for p := 65 to 1000 by 4 do
>    if IsPrime(p) then
>       _, x := NormEquation(Q, p);
>       if BiquadraticResidueSymbol(2, Primary(x)) eq 1 then
>          Include(~s, p);
>       end if;
>    end if;
> end for;
> s;
{ 73, 89, 113, 233, 257, 281, 337, 353, 577, 593, 601, 617, 881, 937 }
Next we create the set of all primes as above that are of the form x^2 + 64y^2. Note that we have to use the integer version of NormEquation

now, because we want to solve x^2 + 64y^2=p, while QuadraticField(-64 returns just Q(i) in which we can only solve x^2 + y^2=p (in other words: we use the integer version to solve the equation in a suborder of Q(i)).

> t := { };
> for p := 65 to 1000 by 4 do
>    if IsPrime(p) then
>       if NormEquation(64, p) then
>       Include(~t, p);
>       end if;
>    end if;
> end for;
> t;
{ 73, 89, 113, 233, 257, 281, 337, 353, 577, 593, 601, 617, 881, 937 }
[Next] [Prev] [_____] [Left] [Up] [Index] [Root]