Creation of Structures

Squarefree integers determine quadratic fields. Associated with any quadratic field is its ring of integers (maximal order) and an equation order, and for every positive integer f there exists an order of conductor f inside the maximal order.

For information on creating elements see Section Creation of Elements.

QuadraticField(m) : RngIntElt -> FldQuad
Given an integer m that is not a square, create the field Q(Sqrt(d)), where d is the squarefree part of m. It is possible to assign a name to Sqrt(d) using angle brackets: R<s> := QuadraticField(m).
EquationOrder(F) : FldQuad -> RngQuad
Creation of the order Z[Sqrt(d)] in the quadratic field F=Q(Sqrt(d)), with d squarefree.
MaximalOrder(F) : FldQuad -> RngQuad
IntegerRing(F) : FldQuad -> RngQuad
RingOfIntegers(F) : FldQuad -> RngQuad
Given a quadratic field F=Q(Sqrt(d)), with d squarefree, create its maximal order. This order is Z[Sqrt(d)] if d ≡ 2, 3 mod 4 and Z[(1 + Sqrt(d)/2)] if d ≡ 1bmod4.
NumberField(O) : RngQuad -> FldQuad
Given a quadratic order, this returns the quadratic field of which it is an order.
sub< O | f > : RngQuad, RngIntElt ->
Create the sub-order of index f in the order O of a quadratic field. If O is maximal, this will be the unique order of conductor f.
IsQuadratic(K) : FldNum -> BoolElt, FldQuad
IsQuadratic(O) : RngOrd -> BoolElt, RngQuad
Return true if the field K or order O can be created as a quadratic field or order and the quadratic field or order if so.

Example FldQuad_creation (H37E1)

We create the quadratic field Q(Sqrt(5)) and an order in it, and display some elements of the order in their representation as order element and as field element.
> Q<z> := QuadraticField(5);
> Q eq QuadraticField(45);
true
> O<w> := sub< MaximalOrder(Q) | 7 >;
> O;
Order of conductor 7 in Q
> w;
w
> Q ! w;
1/2*(7*z + 7)
> Eltseq(w), Eltseq(Q ! w);
[ 0, 1 ]
[ 7/2, 7/2 ]
> ( (7/2)+(7/2)*z )^2;
1/2*(49*z + 147)
>  Q ! w^2;
1/2*(49*z + 147)
> w^2;
7*w + 49

Example FldQuad_hom (H37E2)

We define an injection φ:Q(Sqrt(5)) -> Q(ζ5). First a square root of 5 is identified in Q(ζ5).
> Q<w> := QuadraticField(5);
> F<z> := CyclotomicField(5);
> C<c> := PolynomialRing(F);
> Factorization(c^2-5);
[
   <c - 2*z^3 - 2*z^2 - 1, 1>,
   <c + 2*z^3 + 2*z^2 + 1, 1>
]
> h := hom< Q -> F | -2*z^3 - 2*z^2 - 1 >;
> h(w)^2;
5
V2.28, 13 July 2023