Skip to content

Quaternion algebras ​

We provide a model for quaternion algebras over a field K in standard form, which is parametrized by two elements a,b∈K. The corresponding quaternion algebra has a basis 1,i,j,k satisfying i2=a, j2=b and ij=−ji=k.

This functionality is currently restricted to fields of characteristic not equal to two.

Creation ​

quaternion_algebra Method
julia
quaternion_algebra(K::Field, a, b) -> QuaternionAlgebra

If the characteristic of K isn't 2, return the quaternion algebra (a,b)K defined by i2=a, j2=b, and ij=−ji.

If the characteristic of K is 2, return the quaternion algebra [a,b)K defined by i2+i=a, j2=b, and ij=ji+j.

Examples

julia
julia> Q = quaternion_algebra(QQ, -1, -1)
Quaternion algebra
  over rational field
  defined by i^2 = -1, j^2 = -1, ij = -ji

julia> K, sqrt2 = quadratic_field(2);

julia> Q = quaternion_algebra(K, sqrt2, -1)
Quaternion algebra
  over real quadratic field defined by x^2 - 2
  defined by i^2 = sqrt(2), j^2 = -1, ij = -ji

julia> R, x = polynomial_ring(GF(2), "x"); F=fraction_field(R);

julia> Q = quaternion_algebra(F, 0, x)
Quaternion algebra
  over fraction field of R
  defined by i^2 = i+0, j^2 = x, ij = ji+j
source
quaternion_algebra_ramified_at Method
julia
quaternion_algebra_ramified_at(K::QQField, p::IntegerUnion;
                               check::Bool = true)
  -> QuaternionAlgebra{QQFieldElem}

Return the quaternion algebra over Q that is ramified exactly at the prime p and at infinity, presented as (−p,−q)Q, so i2=−p and j2=−q, where q is the least prime with q≡3mod8 and (pq)=−1.

The algebra carries the maximal order, which maximal_order returns,

Z+Z1+j2+Zi(1+j)2+Z(r+i)jq,

where r is the square root of −p modulo q in (0,q/2]. Both q and r are determined by p, so the algebra and its maximal order are the same on every call.

If check is true, it is tested that p is prime.

The presentation and the order are those of [1], Lemmas 1.1 and 1.2, with the least admissible q, which exists by Dirichlet's theorem.

Examples

julia
julia> A = quaternion_algebra_ramified_at(QQ, 97)
Quaternion algebra
  over rational field
  defined by i^2 = -97, j^2 = -19, ij = -ji

julia> abs(discriminant(maximal_order(A))) == 97^2
true
source

Arithmetic of elements ​

conj Method
julia
conj(a::AssociativeAlgebraElem{_, QuaternionAlgebra})
                             -> AssociativeAlgebraElem{_, QuaternionAlgebra}

Return the image of a under the canonical involution of the quaternion algebra.

Examples

julia
julia> Q = quaternion_algebra(QQ, -1, -1); a = Q([1, 1, 1, 1])
1 + i + j + k

julia> conj(a)
1 - i - j - k
source
trred Method
julia
trred(x::AbstractAssociativeAlgebraElem{T}) where T -> T

Returns the reduced trace of x.

source
normred Method
julia
normred(x::AbstractAssociativeAlgebraElem{T}) where T -> T

Returns the reduced norm of x.

source
reduced_charpoly Method
julia
reduced_charpoly(a::AbstractAssociativeAlgebraElem) -> PolyRingElem

Returns the reduced characteristic polynomial of a as a polynomial over base_ring(algebra(a)).

source

Example ​

julia
julia> Q = quaternion_algebra(QQ, -1, -1)
Quaternion algebra
  over rational field
  defined by i^2 = -1, j^2 = -1, ij = -ji

julia> z = Q([1, 2, 0, 1//3])
1 + 2*i + 1//3*k

julia> trred(z)
2

julia> normred(z)
46//9

julia> reduced_charpoly(z)
x^2 - 2*x + 46//9

julia> m = reduced_charpoly(z)
x^2 - 2*x + 46//9

julia> m(z)
0

Eichler orders ​

is_eichler Method
julia
is_eichler(O::Union{AlgAssAbsOrd, AlgAssRelOrd}) -> Bool

Return whether the order O of a quaternion algebra is an Eichler order, that is, the intersection of two maximal orders.

source
eichler_level Method
julia
eichler_level(O::AlgAssAbsOrd{<:QuaternionAlgebra}) -> ZZRingElem
eichler_level(O::AlgAssRelOrd{<:Any, <:Any, <:QuaternionAlgebra})
  -> AbsNumFieldOrderIdeal

Return the level of the Eichler order O of a quaternion algebra A over K: the ideal M of the ring of integers of K, coprime to the discriminant D of A, with discrd(O)=DM [2], 23.4.19. Over Q it is returned as a positive integer.

An ArgumentError is thrown if O is not an Eichler order, see is_eichler.

Examples

The order of the matrices (ab6cd), with a,b,c,d∈Z, in M2(Q)≅(1,1)Q, spanned by the matrix units (1±i)/2, (j+k)/2 and 6 times (j−k)/2:

julia
julia> A = quaternion_algebra(QQ, 1, 1);

julia> e, i, j, k = basis(A);

julia> h = QQ(1, 2);

julia> O = order(A, [h * (e + i), h * (e - i), h * (j + k), 3 * (j - k)]);

julia> eichler_level(O)
6

julia> eichler_level(maximal_order(A))
1
source

Right ideal classes and types ​

right_class_set Method
julia
right_class_set(O::Union{AlgAssAbsOrd, AlgAssRelOrd}) -> Vector

Return representatives of the classes of locally principal right ideals of the order O of a quaternion algebra A over Q or a number field. Two ideals I and J lie in the same class if J=αI for some α∈A×.

The representatives are integral right ideals of O.

Examples

julia
julia> O = maximal_order(quaternion_algebra_ramified_at(QQ, 97));

julia> C = right_class_set(O);

julia> length(C), all(I -> right_order(I) == O, C)
(8, true)

julia> length(right_class_set(maximal_order(quaternion_algebra(QQ, -1, 3))))
1
source
type_set Method
julia
type_set(O::Union{AlgAssAbsOrd, AlgAssRelOrd}) -> Vector

Return representatives of the types of the order O of a quaternion algebra A over Q or a number field: one order for each isomorphism class of orders locally isomorphic to O.

If A is not totally definite, O must be an Eichler order.

Examples

julia
julia> O = maximal_order(quaternion_algebra_ramified_at(QQ, 97));

julia> length(type_set(O)), length(right_class_set(O))
(5, 8)
source
type_number Method
julia
type_number(O::Union{AlgAssAbsOrd, AlgAssRelOrd}) -> Int

Return the number of types of the order O, that is, the length of type_set.

source

Splitting of quaternion algebras ​

is_split_with_zero_divisor Function
julia
is_split_with_zero_divisor(A::QuaternionAlgebra) -> Bool, AssociativeAlgebraElem

Given a quaternion algebra A, return whether A is split together with an element, which is a zero-divisor in case A is split.

Examples

julia
julia> A = quaternion_algebra(QQ, 1, 4);

julia> is_split_with_zero_divisor(A)
(true, 1 + i)

julia> A = quaternion_algebra(QQ, -1, -1);

julia> is_split_with_zero_divisor(A)
(false, 0)
source

Gross lattices ​

gross_lattice Method
julia
gross_lattice(O::AlgAssAbsOrd{<:QuaternionAlgebra{QQFieldElem}}) -> ZZLat

Return the Gross lattice of an order O of Bp, the quaternion algebra over Q ramified exactly at a prime p and infinity: the image of O under x↦2x−trd(x), which is the set of elements of reduced trace zero in Z+2O [3, 4]. It is a positive definite lattice of rank 3, with the reduced norm as its quadratic form. The order need not be maximal; an ArgumentError is thrown if the algebra of O is not of the form Bp.

It lies in the quadratic space on the coordinates with respect to basis(A) whose bilinear form is (x,y)↦trd(xy¯)/2, so that the norm of a vector is the reduced norm of the element and not twice it. Its basis consists of the coordinates of gross_lattice_basis and its Gram matrix is gross_gram_matrix of that basis.

For a maximal order of Bp, the determinant of the Gram matrix is 4p2 [3], and two maximal orders of Bp are isomorphic if and only if their Gross lattices are isometric [4].

Examples

julia
julia> A = quaternion_algebra(QQ, -1, -3);

julia> L = gross_lattice(maximal_order(A));

julia> rank(L), det(L)
(3, 36)
source
gross_lattice_basis Method
julia
gross_lattice_basis(O::AlgAssAbsOrd{<:QuaternionAlgebra{QQFieldElem}})
  -> Vector{AssociativeAlgebraElem{QQFieldElem}}

Return a basis of the Gross lattice of an order O of Bp, the elements of reduced trace zero in Z+2O, as three elements of the algebra of O; see gross_lattice.

Examples

julia
julia> A = quaternion_algebra(QQ, -1, -3);

julia> B = gross_lattice_basis(maximal_order(A));

julia> length(B), all(iszero, trred.(B))
(3, true)
source
gross_gram_matrix Method
julia
gross_gram_matrix(B::Vector{<:AssociativeAlgebraElem{QQFieldElem}})
  -> ZZMatrix

Return the Gram matrix of the three elements in B, a basis of a Gross lattice of an order of Bp (see gross_lattice), with respect to the bilinear form (x,y)↦trd(xy¯)/2: the reduced norms of the elements are on its diagonal. The matrix is integral for a basis of a Gross lattice; an ArgumentError is thrown otherwise.

Examples

julia
julia> A = quaternion_algebra(QQ, -1, -3);

julia> B = gross_lattice_basis(maximal_order(A));

julia> G = gross_gram_matrix(B);

julia> det(G), [G[i, i] for i in 1:3] == normred.(B)
(36, true)
source

Ideals connecting maximal orders ​

connecting_ideal Method
julia
connecting_ideal(O1::AlgAssAbsOrd{<:QuaternionAlgebra},
                 O2::AlgAssAbsOrd{<:QuaternionAlgebra}; check::Bool = true)
  -> AlgAssAbsOrdIdl
connecting_ideal(O1::AlgAssRelOrd{<:Any, <:Any, <:QuaternionAlgebra},
                 O2::AlgAssRelOrd{<:Any, <:Any, <:QuaternionAlgebra};
                 check::Bool = true) -> AlgAssRelOrdIdl

Given maximal orders O1 and O2 of a quaternion algebra over Q or a number field, return the lattice O1O2 spanned by the products xy with x∈O1 and y∈O2. It is an invertible fractional ideal with left order O1 and right order O2 [2], Lemma 17.4.7. As it contains O1 and O2, it is integral only if O1=O2.

If check is true, an ArgumentError is thrown unless both orders are maximal.

Examples

julia
julia> O = maximal_order(quaternion_algebra_ramified_at(QQ, 97));

julia> O1, O2 = left_order.(right_class_set(O)[1:2]);

julia> J = connecting_ideal(O1, O2);

julia> left_order(J) == O1, right_order(J) == O2
(true, true)
source
least_norm_ideal Method
julia
least_norm_ideal(I::AlgAssAbsOrdIdl, O::AlgAssAbsOrd; side::Symbol = :right,
                 check::Bool = true) -> ZZRingElem, AlgAssAbsOrdIdl

Given an invertible fractional ideal I with right order O (side = :right) or left order O (side = :left), in a definite quaternion algebra A over Q, return the least reduced norm d of an integral ideal in the class of I, and one such ideal J. The class of I consists of the ideals αI (side = :right) or Iα (side = :left) with α∈A×, as in right_class_set: the order O of J on that side is O itself, while its order on the other side is a conjugate of the one of I. In particular, d=1 if and only if I is principal.

For side = :right, the integral ideals in the class of I are the γ¯I/nrd(I) with 0≠γ∈I, of reduced norm nrd(γ)/nrd(I) ([2], proof of Proposition 17.5.6), and similarly for side = :left. So d is the minimum of nrd/nrd(I) on I, found by one shortest vector computation, and J is the ideal of such a γ.

If check is true, an ArgumentError is thrown unless I is invertible with the order O on the given side.

Examples

julia
julia> O = maximal_order(quaternion_algebra_ramified_at(QQ, 97));

julia> C = right_class_set(O);

julia> d, J = least_norm_ideal(C[2], O);

julia> d == normred(J, O), right_order(J) == O, is_subset(J, O)
(true, true, true)

julia> first(least_norm_ideal(3 * C[2], O)) == d
true
source
least_connecting_norm Method
julia
least_connecting_norm(O1::AlgAssAbsOrd, O2::AlgAssAbsOrd;
                      check::Bool = true) -> ZZRingElem, AlgAssAbsOrdIdl

Given maximal orders O1 and O2 of a definite quaternion algebra A over Q, return the least reduced norm d of an integral ideal with left order O1 and right order conjugate to O2, and one such ideal. So O1 is fixed and O2 is taken up to conjugacy: d depends only on the types of O1 and O2 (see type_set), does not change when they are swapped, and is 1 if and only if they are conjugate. When A is ramified only at a prime p and ∞, and E1, E2 are supersingular elliptic curves over F―p with endomorphism rings O1 and O2, it is the least degree of an isogeny from E1 to E2 or to its Frobenius conjugate E2(p) ([2], Proposition 42.2.16 and Corollary 42.2.21; the ideals J and JP below). The curve E2(p) also has endomorphism ring O2, and is not isomorphic to E2 unless j(E2)∈Fp ([2], Lemma 42.4.1), so d need not be the least degree of an isogeny E1→E2: for O1=O2 it is 1, while in B97 some E2→E2(p) have least degree 2.

The ideals with left order O1 and right order conjugate to O2 lie in the left classes of JP, where J is connecting_ideal(O1, O2) and P runs over the products of the two-sided prime ideals of O2 above distinct primes ramified in A ([2], Theorem 18.1.3 and Proposition 18.5.10). So d is the least of the values of least_norm_ideal with side = :left on these 2r ideals, where r is the number of ramified primes.

If check is true, an ArgumentError is thrown unless both orders are maximal.

Examples

julia
julia> O = maximal_order(quaternion_algebra_ramified_at(QQ, 97));

julia> Ts = type_set(O);

julia> [first(least_connecting_norm(Ts[1], T)) for T in Ts]
5-element Vector{ZZRingElem}:
 1
 2
 2
 4
 3
source
denominator Method
julia
denominator(R::AlgAssAbsOrd, O::AlgAssAbsOrd) -> ZZRingElem

Return the least positive integer d with dR⊆O, for orders R and O of the same algebra.

Examples

julia
julia> O = maximal_order(quaternion_algebra_ramified_at(QQ, 97));

julia> O1, O2 = left_order.(right_class_set(O)[1:2]);

julia> denominator(O1, O1), denominator(O2, O1), index(intersect(O1, O2), O1)
(1, 2, 2)
source