From: Michael Orlitzky Date: Wed, 8 Apr 2026 13:59:37 +0000 (-0400) Subject: mjo/hurwitz.py: fix entry_algebra_gens() in HurwitzMatrixAlgebra X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=b197d66ce91b989e217728640265bcf445062e15;p=sage.d.git 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. --- 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: