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

Special Element Operations

There are a number of functions available only for elements of certain maximal orders. Conjugate is provided to return a quadratic element (instead of a real) as well as ComplexConjugate.

Subsections
a mod b : RngQuadElt, RngQuadElt -> RngQuadElt
The remainder on dividing a by b where a and b lie in the maximal order of Q(Sqrt(d)) for d = - 1, - 2, - 3, - 7, - 11, 2, 3, 5, 13. div is provided for order elements in general, but for discriminants not in the above list div will fail if the division is not exact.

Greatest Common Divisors

Gcd(a, b) : RngQuadElt, RngQuadElt -> RngQuadElt
GCD(a, b) : RngQuadElt, RngQuadElt -> RngQuadElt
GreatestCommonDivisor(a, b) : RngQuadElt, RngQuadElt -> RngQuadElt
The greatest common divisor of a and b in the maximal order of Q(Sqrt(d)), where d must be one of the following values: -1, - 2, - 3, - 7, - 11, 2, 3, 5, 13.
Lcm(a, b) : RngQuadElt, RngQuadElt -> RngQuadElt
LCM(a, b) : RngQuadElt, RngQuadElt -> RngQuadElt
LeastCommonMultiple(a, b) : RngQuadElt, RngQuadElt -> RngQuadElt
The least common multiple of a and b in the maximal order of Q(Sqrt(d)), where d must be one of the following values: -1, - 2, - 3, - 7, - 11, 2, 3, 5, 13.

Modular Arithmetic

Modexp(a, e, n) : RngQuadElt, RngInt, RngQuadElt -> RngQuadElt
The computation of ae mod n in the maximal order of Q(Sqrt(d)), where d is one of the following values: -1, - 2, - 3, - 7, - 11, 2, 3, 5, 13.

Factorization

Magma's factorization in maximal orders of quadratic number fields is based upon factoring the norm in the integers. Thus, the comments that are made about the Factorization command in the integers also apply here. Moreover, since the factorization may be off by a unit power, that power is also returned (the unit being -1, Sqrt( - 1), or (1 + Sqrt( - 3))/2).

Factorization(n) : RngQuadElt -> SeqEnum, Tup
Factorisation(n) : RngQuadElt -> SeqEnum, Tup
The factorization of n in the maximal order of the quadratic number field Q(Sqrt(d)), where d is one of: -1, -2, -3, -7, or -11. Returns the factorization along with the appropriate power of a unit (the unit being -1, Sqrt( - 1), or (1 + Sqrt( - 3))/2).
TrialDivision(n, B) : RngQuadElt, RngIntElt -> SeqEnum, SeqEnum, Tup
Trial division of n by primes of relative norm ≤ B in the maximal order of Q(Sqrt(d)), where d is one of: -1, -2, -3, -7, or -11. Returns the factored part, the unfactored part, and the power of the unit that the factorization is off by (the unit being -1, Sqrt( - 1), or (1 + Sqrt( - 3))/2).

Conjugates

ComplexConjugate(a) : FldQuadElt -> FldQuadElt
ComplexConjugate(a) : RngQuadElt -> RngQuadElt
The complex conjugate of quadratic field element a; returns a in a real quadratic field and bar a=x - ySqrt(d) if a=x + ySqrt(d) in an imaginary quadratic field Q(Sqrt(d)).
Conjugate(a) : FldQuadElt -> FldQuadElt
Conjugate(a) : RngQuadElt -> RngQuadElt
The conjugate x - ySqrt(d) of a=x + ySqrt(d) in the quadratic field Q(Sqrt(d)).

Other Element Functions

For the ring of integers of Q(i) the biquadratic residue symbol (generalizing the Legendre symbol) is available.

BiquadraticResidueSymbol(a, b) : RngQuadElt, RngQuadElt -> RngQuadElt
Given a Gaussian integer a and a primary, non-unit Gaussian integer b, where a and b are coprime, return the value of the biquadratic character ( (a/b))4. The value of this character is equal to ik, for some k∈{0, 1, 2, 3}. If a and b have a factor in common, the function returns 0, if b is not primary or b is a unit an error results.
Primary(a) : RngQuadElt -> RngQuadElt
Return the unique associate bar a of the Gaussian integer a that satisfies bar a = 1 mod (1 + i)3,

or 0 in case a is divisible by 1 + i.


Example FldQuad_Represent (H35E6)

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 z4 = 2 mod p has a solution iff p=x2 + 64y2 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 z4 = 2 mod p for some z).

> s := { };
> Q := QuadraticField(-1);
> M := RingOfIntegers(Q);
> for p := 65 to 1000 by 4 do
>    if IsPrime(p) then
>       _, x := NormEquation(Q, p);
>       if BiquadraticResidueSymbol(2, Primary(M!x[1])) 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 x2 + 64y2. Note that we have to use NormEquation on a suborder of Q now, because we want to solve x2 + 64y2=p, while QuadraticField(-64) returns just Q(i) in which we can only solve x2 + y2=p.

> S := sub<MaximalOrder(Q) | 8>;
> t := { };
> for p := 65 to 1000 by 4 do
>    if IsPrime(p) then
>       if NormEquation(S, 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] [Right] [Left] [Up] [Index] [Root]

Version: V2.19 of Mon Dec 17 14:40:36 EST 2012