]> gitweb.michael.orlitzky.com - sage.d.git/commitdiff
octonions: add is_hermitian() for octonion matrices.
authorMichael Orlitzky <michael@orlitzky.com>
Tue, 2 Mar 2021 16:14:30 +0000 (11:14 -0500)
committerMichael Orlitzky <michael@orlitzky.com>
Tue, 2 Mar 2021 16:14:30 +0000 (11:14 -0500)
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"""