]> gitweb.michael.orlitzky.com - sage.d.git/blobdiff - mjo/octonions.py
octonions: add is_hermitian() for octonion matrices.
[sage.d.git] / mjo / octonions.py
index 73acf2db2ebf76258f47ed1156113925f4f257ed..87bf5ff1ed06b1a77b5815df8dd2248fda4b7edb 100644 (file)
@@ -463,6 +463,23 @@ class OctonionMatrix(IndexedFreeModuleElement):
         """
         return self.parent()
 
+    def is_hermitian(self):
+        r"""
+
+        SETUP::
+
+            sage: from mjo.octonions import OctonionMatrixAlgebra
+
+        EXAMPLES::
+
+            sage: MS = OctonionMatrixAlgebra(3)
+            sage: MS.one().is_hermitian()
+            True
+
+        """
+        return all( self[i,j] == self[j,i].conjugate()
+                    for i in range(self.nrows())
+                    for j in range(self.ncols()) )
 
 class OctonionMatrixAlgebra(CombinatorialFreeModule):
     r"""