From e3e69c2de558ad0ebbb65e24efc3e712f5f7e211 Mon Sep 17 00:00:00 2001 From: Sebastian Spindler Date: Sat, 20 Jan 2024 01:27:07 +0100 Subject: [PATCH] Type check `is_isomorphic` Added a type check to .is_isomorphic to ensure that A is a quaternion algebra of the form (a,b)_K. --- src/sage/algebras/quatalg/quaternion_algebra.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/sage/algebras/quatalg/quaternion_algebra.py b/src/sage/algebras/quatalg/quaternion_algebra.py index b8cb5082661..d1904cb74d2 100644 --- a/src/sage/algebras/quatalg/quaternion_algebra.py +++ b/src/sage/algebras/quatalg/quaternion_algebra.py @@ -1091,6 +1091,9 @@ def is_isomorphic(self, A) -> bool: sage: A == B False """ + if not isinstance(A, QuaternionAlgebra_ab): + raise TypeError("A must be a quaternion algebra of the form (a,b)_K") + if self.base_ring() != QQ or A.base_ring() != QQ: raise NotImplementedError("isomorphism check only implemented for rational quaternion algebras")