Skip to content

Commit

Permalink
gh-37111: Add test if quaternion order is maximal
Browse files Browse the repository at this point in the history
    
Add a method to sage.algebras.quatalg.quaternion_algebra.QuaternionOrder
which allows to check whether the order is maximal.
This method compares the discriminant of the order to the discriminant
of the algebra. According to Voight's book on quaternion algebras
(chapter 15), this test is valid in number fields (but not over any
field), so the method fails with a notImplementedError in  other cases.

Currently, there is no method to test maximality of orders, so
implementing it for quaternion algebras over number fields is some
progress.


#sd123
    
URL: #37111
Reported by: syndrakon
Reviewer(s): David Coudert, Peter Bruin, syndrakon
  • Loading branch information
Release Manager committed Feb 1, 2024
2 parents 1af98b2 + c603b36 commit b720abc
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions src/sage/algebras/quatalg/quaternion_algebra.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
from sage.misc.cachefunc import cached_method

from sage.categories.algebras import Algebras
from sage.categories.number_fields import NumberFields

########################################################
# Constructor
Expand Down Expand Up @@ -1783,6 +1784,42 @@ def discriminant(self):

return (MatrixSpace(QQ, 4, 4)(L)).determinant().sqrt()

def is_maximal(self):
r"""
Check whether the order of ``self`` is maximal in the ambient quaternion algebra.
Only works in quaternion algebras over number fields
OUTPUT: Boolean
EXAMPLES::
sage: p = 11
sage: B = QuaternionAlgebra(QQ, -1, -p)
sage: i, j, k = B.gens()
sage: O0_basis = (1, i, (i+j)/2, (1+i*j)/2)
sage: O0 = B.quaternion_order(O0_basis)
sage: O0.is_maximal()
True
sage: O1 = B.quaternion_order([1, i, j, i*j])
sage: O1.is_maximal()
False
TESTS::
sage: B = QuaternionAlgebra(GF(13), -1, -11)
sage: i, j, k = B.gens()
sage: O0_basis = (1, i, j, k)
sage: O0 = B.quaternion_order(O0_basis)
sage: O0.is_maximal()
Traceback (most recent call last):
...
NotImplementedError: check for maximality is only implemented for quaternion algebras over number fields
"""
if self.quaternion_algebra().base_ring() not in NumberFields():
raise NotImplementedError("check for maximality is only implemented for quaternion algebras over number fields")
return self.discriminant() == self.quaternion_algebra().discriminant()

def left_ideal(self, gens, check=True, *, is_basis=False):
r"""
Return the left ideal of this order generated by the given generators.
Expand Down

0 comments on commit b720abc

Please sign in to comment.