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.
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).
Creation of the order Z[Sqrt(d)] in the quadratic field F=Q(Sqrt(d)), with d squarefree.
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.
Given a quadratic order, this returns the quadratic field of which it is an order.
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.
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.
> 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
> 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