Skip to content

Commit b720abc

Browse files
author
Release Manager
committed
gh-37111: Add test if quaternion order is maximal 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
2 parents 1af98b2 + c603b36 commit b720abc

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

src/sage/algebras/quatalg/quaternion_algebra.py

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
from sage.misc.cachefunc import cached_method
7878

7979
from sage.categories.algebras import Algebras
80+
from sage.categories.number_fields import NumberFields
8081

8182
########################################################
8283
# Constructor
@@ -1783,6 +1784,42 @@ def discriminant(self):
17831784

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

1787+
def is_maximal(self):
1788+
r"""
1789+
Check whether the order of ``self`` is maximal in the ambient quaternion algebra.
1790+
1791+
Only works in quaternion algebras over number fields
1792+
1793+
OUTPUT: Boolean
1794+
1795+
EXAMPLES::
1796+
1797+
sage: p = 11
1798+
sage: B = QuaternionAlgebra(QQ, -1, -p)
1799+
sage: i, j, k = B.gens()
1800+
sage: O0_basis = (1, i, (i+j)/2, (1+i*j)/2)
1801+
sage: O0 = B.quaternion_order(O0_basis)
1802+
sage: O0.is_maximal()
1803+
True
1804+
sage: O1 = B.quaternion_order([1, i, j, i*j])
1805+
sage: O1.is_maximal()
1806+
False
1807+
1808+
TESTS::
1809+
1810+
sage: B = QuaternionAlgebra(GF(13), -1, -11)
1811+
sage: i, j, k = B.gens()
1812+
sage: O0_basis = (1, i, j, k)
1813+
sage: O0 = B.quaternion_order(O0_basis)
1814+
sage: O0.is_maximal()
1815+
Traceback (most recent call last):
1816+
...
1817+
NotImplementedError: check for maximality is only implemented for quaternion algebras over number fields
1818+
"""
1819+
if self.quaternion_algebra().base_ring() not in NumberFields():
1820+
raise NotImplementedError("check for maximality is only implemented for quaternion algebras over number fields")
1821+
return self.discriminant() == self.quaternion_algebra().discriminant()
1822+
17861823
def left_ideal(self, gens, check=True, *, is_basis=False):
17871824
r"""
17881825
Return the left ideal of this order generated by the given generators.

0 commit comments

Comments
 (0)