]> gitweb.michael.orlitzky.com - sage.d.git/commitdiff
eja: add is_self_adjoint() for operators.
authorMichael Orlitzky <michael@orlitzky.com>
Wed, 25 Nov 2020 19:33:34 +0000 (14:33 -0500)
committerMichael Orlitzky <michael@orlitzky.com>
Wed, 25 Nov 2020 19:33:34 +0000 (14:33 -0500)
mjo/eja/eja_algebra.py
mjo/eja/eja_operator.py

index a0af3f0ef543dd951b2463a8aef0f295a2561287..2ea1a9267623d95d02231654a48a470efc186a40 100644 (file)
@@ -1123,7 +1123,7 @@ class ConcreteEuclideanJordanAlgebra:
         sage: set_random_seed()
         sage: J = ConcreteEuclideanJordanAlgebra.random_instance()
         sage: x = J.random_element()
-        sage: x.operator().matrix().is_symmetric()
+        sage: x.operator().is_self_adjoint()
         True
 
     """
index 3133eb99415b7853d2b579690fc37526665dec0f..0b52f555d51f58341fe56f5b63984f88cdf99da0 100644 (file)
@@ -419,6 +419,30 @@ class FiniteDimensionalEuclideanJordanAlgebraOperator(Map):
         return (self + (-other))
 
 
+    def is_self_adjoint(self):
+        r"""
+        Return whether or not this operator is self-adjoint.
+
+        At least in Sage, the fact that the base field is real means
+        that the algebra elements have to be real as well (this is why
+        we embed the complex numbers and quaternions). As a result, the
+        matrix of this operator will contain only real entries, and it
+        suffices to check only symmetry, not conjugate symmetry.
+
+        SETUP::
+
+            sage: from mjo.eja.eja_algebra import (JordanSpinEJA)
+
+        EXAMPLES::
+
+            sage: J = JordanSpinEJA(4)
+            sage: J.one().operator().is_self_adjoint()
+            True
+
+        """
+        return self.matrix().is_symmetric()
+
+
     def is_zero(self):
         r"""
         Return whether or not this map is the zero operator.