From b197d66ce91b989e217728640265bcf445062e15 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Wed, 8 Apr 2026 09:59:37 -0400 Subject: [PATCH] mjo/hurwitz.py: fix entry_algebra_gens() in HurwitzMatrixAlgebra Just like we did for MatrixAlgebra, add a special case for the octonions in entry_algebra_gens(). The OctonionAlgebra uses gens() for the multiplicative generators, so we only get five of them. --- mjo/hurwitz.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/mjo/hurwitz.py b/mjo/hurwitz.py index a252cf6..144b7e1 100644 --- a/mjo/hurwitz.py +++ b/mjo/hurwitz.py @@ -581,13 +581,19 @@ class HurwitzMatrixAlgebra(MatrixAlgebra): sage: Q = QuaternionAlgebra(AA,-1,-1) sage: HurwitzMatrixAlgebra(2, Q, AA).entry_algebra_gens() (1, i, j, k) - sage: O = Octonions() + sage: O = OctonionAlgebra(QQ) sage: HurwitzMatrixAlgebra(2, O, AA).entry_algebra_gens() - (e0, e1, e2, e3, e4, e5, e6, e7) + Family (1, i, j, k, l, li, lj, lk) """ - gs = self.entry_algebra().gens() - one = self.entry_algebra().one() + A = self.entry_algebra() + if hasattr(A, "basis"): + # The gens() of the OctonionAlgebra are multiplicative + # generators, NOT a basis. (We expect a basis.) + return A.basis() + + gs = A.gens() + one = A.one() if one in gs: return gs else: -- 2.53.0