Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test if quaternion order is maximal #37111

Merged
merged 5 commits into from
Feb 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -1758,6 +1759,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
Loading