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.
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.
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.
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.
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.
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).
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).
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).
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)).
The conjugate x - ySqrt(d) of a=x + ySqrt(d) in the quadratic field Q(Sqrt(d)).
For the ring of integers of Q(i) the biquadratic residue symbol (generalizing the Legendre symbol) is available.
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.
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.
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 }