In the list below, a and b are quadratic field elements; however, automatic coercion will ensure that +, *, -, /, eq, ne and in will also work if a or b is an integer or rational number.
The complex conjugate of quadratic field element a; returns a in a real quadratic field and bar a=x - y sqrt(d) if a=x + y sqrt(d) in an imaginary quadratic field Q(sqrt(d)).
The conjugate x - y sqrt(d) of a=x + y sqrt(d) in the quadratic field Q(sqrt(d)).
The minimal polynomial of the quadratic field element a. The resulting (monic) polynomial will have coefficients in Q (which may all be integers).
The norm a bar a of a quadratic field element a (as an element of the rational field), where bar a is the conjugate of a.
The trace a + bar a of a quadratic field element a (as an element of the rational field), where bar a is the conjugate of a.
For imaginary quadratic fields, (that is, for quadratic fields
Q(sqrt m) with m < 0), the function NormEquation is provided
to find integral elements of a given norm.
NormEquation(F, m) : FldQuad, RngIntElt -> BoolElt, FldQuadElt
Factorization: [RngIntElt] Default: [ ]
Given a imaginary 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.The method used is constructive (it uses Cornacchia's algorithm, see [H. Cohen, A course in computational algebraic number theory, Graduate Texts in Mathematics 138, Berlin: Springer 1993, 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 + y sqrt(d)/2) is returned), whereas for d = 2, 3bmod4 a solution alpha=x + y sqrt(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.
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 the example below).
> SetVerbose("NormEquation", true); > d := 302401481761723680; > m := 76814814791186002463716; > Q<z> := QuadraticField(-d); > O<w> := sub< MaximalOrder(Q) | 6 >; > f, s := NormEquation(O, m); NormEquation(75600370440430920, 76814814791186002463716) (d, m) = 28 Solution: x = 406, y = 1008 > s, Norm(s); 406 + 1008*w 76814814791186002463716
For the ring of integers of Q(i) the biquadratic residue symbol
(generalizing the Legendre symbol) is available.
BiquadraticResidueSymbol(a, b) : FldQuadElt, FldQuadElt -> FldQuadElt
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 i^k, for some k in {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 then 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.[Next] [Prev] [Right] [Left] [Up] [Index] [Root]