X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=mjo%2Feja%2Feuclidean_jordan_algebra.py;h=4713ff0859876b5832e6e5e9551f632444c6a138;hb=8ee3c1ac3dd5a2b08f91cfd4c700d87f617196e6;hp=1426d5e16be4b6acc7c68a4494e2c6f1c4d61819;hpb=4156fccce1265f500fe432b0f5567e43fbbc23d6;p=sage.d.git diff --git a/mjo/eja/euclidean_jordan_algebra.py b/mjo/eja/euclidean_jordan_algebra.py index 1426d5e..4713ff0 100644 --- a/mjo/eja/euclidean_jordan_algebra.py +++ b/mjo/eja/euclidean_jordan_algebra.py @@ -161,6 +161,43 @@ class FiniteDimensionalEuclideanJordanAlgebra(FiniteDimensionalAlgebra): raise NotImplementedError('irregular element') + def operator_commutes_with(self, other): + """ + Return whether or not this element operator-commutes + with ``other``. + + EXAMPLES: + + The definition of a Jordan algebra says that any element + operator-commutes with its square:: + + sage: set_random_seed() + sage: x = random_eja().random_element() + sage: x.operator_commutes_with(x^2) + True + + TESTS: + + Test Lemma 1 from Chapter III of Koecher:: + + sage: set_random_seed() + sage: J = random_eja() + sage: u = J.random_element() + sage: v = J.random_element() + sage: lhs = u.operator_commutes_with(u*v) + sage: rhs = v.operator_commutes_with(u^2) + sage: lhs == rhs + True + + """ + if not other in self.parent(): + raise ArgumentError("'other' must live in the same algebra") + + A = self.matrix() + B = other.matrix() + return (A*B == B*A) + + def det(self): """ Return my determinant, the product of my eigenvalues.