X-Git-Url: http://gitweb.michael.orlitzky.com/?p=sage.d.git;a=blobdiff_plain;f=mjo%2Foctonions.py;h=2850545280b122cb8109324f4b6431ed0f5076ec;hp=bd014c22eb4c180117cf70291e4f2357c091bd20;hb=d006c2e856b970d2f8e77d738030ef2e63ec5b78;hpb=a339e89c225bb46379332ecb8b0c50b918d34ac6 diff --git a/mjo/octonions.py b/mjo/octonions.py index bd014c2..2850545 100644 --- a/mjo/octonions.py +++ b/mjo/octonions.py @@ -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. @@ -374,14 +374,24 @@ class OctonionMatrixAlgebra(MatrixAlgebra): sage: O = Octonions(QQ) sage: e0,e1,e2,e3,e4,e5,e6,e7 = O.gens() sage: MS = OctonionMatrixAlgebra(2) - sage: MS.from_list([ [e0+e4, e1+e5], - ....: [e2-e6, e3-e7] ]) + sage: MS([ [e0+e4, e1+e5], + ....: [e2-e6, e3-e7] ]) +---------+---------+ | e0 + e4 | e1 + e5 | +---------+---------+ | 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()