return elt.minimal_polynomial()
- def quadratic_representation(self):
+ def quadratic_representation(self, other=None):
"""
Return the quadratic representation of this element.
The explicit form in the spin factor algebra is given by
Alizadeh's Example 11.12::
+ sage: set_random_seed()
sage: n = ZZ.random_element(1,10).abs()
sage: J = JordanSpinSimpleEJA(n)
sage: x = J.random_element()
sage: Q == x.quadratic_representation()
True
+ Test all of the properties from Theorem 11.2 in Alizadeh::
+
+ sage: set_random_seed()
+ sage: J = random_eja()
+ sage: x = J.random_element()
+ sage: y = J.random_element()
+
+ Property 1:
+
+ sage: actual = x.quadratic_representation(y)
+ sage: expected = ( (x+y).quadratic_representation()
+ ....: -x.quadratic_representation()
+ ....: -y.quadratic_representation() ) / 2
+ sage: actual == expected
+ True
+
+ Property 2:
+
+ sage: alpha = QQ.random_element()
+ sage: actual = (alpha*x).quadratic_representation()
+ sage: expected = (alpha^2)*x.quadratic_representation()
+ sage: actual == expected
+ True
+
+ Property 5:
+
+ sage: Qy = y.quadratic_representation()
+ sage: actual = J(Qy*x.vector()).quadratic_representation()
+ sage: expected = Qy*x.quadratic_representation()*Qy
+ sage: actual == expected
+ True
+
+ Property 6:
+
+ sage: k = ZZ.random_element(1,10).abs()
+ sage: actual = (x^k).quadratic_representation()
+ sage: expected = (x.quadratic_representation())^k
+ sage: actual == expected
+ True
+
"""
- return 2*(self.matrix()**2) - (self**2).matrix()
+ if other is None:
+ other=self
+ elif not other in self.parent():
+ raise ArgumentError("'other' must live in the same algebra")
+
+ return ( self.matrix()*other.matrix()
+ + other.matrix()*self.matrix()
+ - (self*other).matrix() )
def span_of_powers(self):