Skip to content

Commit 919b021

Browse files
author
Release Manager
committed
gh-37107: Added is_isomorphic() for rational quaternion algebras
Added `QuaternionAlgebra_ab.is_isomorphic()` to conveniently check whether two rational quaternion algebras are isomorphic. TODO (future work): - [] Extend isomorphism check to quaternion algebras over number fields. #sd123 URL: #37107 Reported by: Sebastian Spindler Reviewer(s): Peter Bruin
2 parents 507c389 + e3e69c2 commit 919b021

File tree

3 files changed

+29
-4
lines changed

3 files changed

+29
-4
lines changed

build/pkgs/configure/checksums.ini

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
tarball=configure-VERSION.tar.gz
2-
sha1=1041fee1d3ed5dc9c6c428668a895fb7109a48e5
3-
md5=e254e55345074cd0959cb21c8e4716ca
4-
cksum=1271538328
2+
sha1=16fe5aaba9a760dd8a2e66736a117cea46ee6e91
3+
md5=375511ae93e27dce742292d0c7557d75
4+
cksum=2150430088
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
c6bf497a0fd0f29c721481b52afaf49969c0cef8
1+
ab5b59acc27408b89ef07ab0e6c654364fceafe6

src/sage/algebras/quatalg/quaternion_algebra.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1074,6 +1074,31 @@ def ramified_primes(self):
10741074
# TODO: more examples
10751075
return [f[0] for f in factor(self.discriminant())]
10761076

1077+
def is_isomorphic(self, A) -> bool:
1078+
r"""
1079+
Return ``True`` if ``self`` and ``A`` are isomorphic quaternion algebras over Q.
1080+
1081+
INPUT:
1082+
1083+
- ``A`` -- a quaternion algebra defined over the rationals Q
1084+
1085+
EXAMPLES::
1086+
1087+
sage: B = QuaternionAlgebra(-46, -87)
1088+
sage: A = QuaternionAlgebra(-58, -69)
1089+
sage: B.is_isomorphic(A)
1090+
True
1091+
sage: A == B
1092+
False
1093+
"""
1094+
if not isinstance(A, QuaternionAlgebra_ab):
1095+
raise TypeError("A must be a quaternion algebra of the form (a,b)_K")
1096+
1097+
if self.base_ring() != QQ or A.base_ring() != QQ:
1098+
raise NotImplementedError("isomorphism check only implemented for rational quaternion algebras")
1099+
1100+
return self.discriminant() == A.discriminant()
1101+
10771102
def _magma_init_(self, magma):
10781103
"""
10791104
Return Magma version of this quaternion algebra.

0 commit comments

Comments
 (0)