]> gitweb.michael.orlitzky.com - sage.d.git/blobdiff - mjo/octonions.py
octonions: add a test for Cartesian products.
[sage.d.git] / mjo / octonions.py
index 289c46a69b075f22409b69f827d7c8efbfee375d..2850545280b122cb8109324f4b6431ed0f5076ec 100644 (file)
@@ -7,7 +7,7 @@ from sage.rings.all import AA, ZZ
 from sage.matrix.matrix_space import MatrixSpace
 from sage.misc.table import table
 
-from mjo.matrix_algebra import MatrixAlgebra
+from mjo.matrix_algebra import HurwitzMatrixAlgebra
 
 class Octonion(IndexedFreeModuleElement):
     def conjugate(self):
@@ -347,7 +347,7 @@ class Octonions(CombinatorialFreeModule):
 
 
 
-class OctonionMatrixAlgebra(MatrixAlgebra):
+class OctonionMatrixAlgebra(HurwitzMatrixAlgebra):
     r"""
     The algebra of ``n``-by-``n`` matrices with octonion entries over
     (a subfield of) the real numbers.
@@ -382,6 +382,16 @@ class OctonionMatrixAlgebra(MatrixAlgebra):
         | e2 - e6 | e3 - e7 |
         +---------+---------+
 
+    ::
+
+        sage: A1 = OctonionMatrixAlgebra(1,QQ)
+        sage: A2 = OctonionMatrixAlgebra(1,QQ)
+        sage: cartesian_product([A1,A2])
+        Module of 1 by 1 matrices with entries in Octonion algebra with
+        base ring Rational Field over the scalar ring Rational Field (+)
+        Module of 1 by 1 matrices with entries in Octonion algebra with
+        base ring Rational Field over the scalar ring Rational Field
+
     TESTS::
 
         sage: set_random_seed()