check=False)
- def _invert_(self):
+ def __invert__(self):
"""
EXAMPLES::
return FiniteDimensionalEuclideanJordanAlgebraMorphism(self.parent(),
A.inverse())
- def _lmul_(self, other):
+ def _lmul_(self, right):
"""
Compose two EJA morphisms using multiplicative notation.
EXAMPLES::
- sage: J = RealSymmetricEJA(3)
+ sage: J = RealSymmetricEJA(2)
sage: x = J.zero()
sage: y = J.one()
sage: x.operator() * y.operator()
- Morphism from Euclidean Jordan algebra of degree 6 over Rational
- Field to Euclidean Jordan algebra of degree 6 over Rational Field
+ Morphism from Euclidean Jordan algebra of degree 3 over Rational
+ Field to Euclidean Jordan algebra of degree 3 over Rational Field
given by matrix
- [0 0 0 0 0 0]
- [0 0 0 0 0 0]
- [0 0 0 0 0 0]
- [0 0 0 0 0 0]
- [0 0 0 0 0 0]
- [0 0 0 0 0 0]
+ [0 0 0]
+ [0 0 0]
+ [0 0 0]
+
+ ::
+
+ sage: J = RealSymmetricEJA(2)
+ sage: x = J.linear_combination(zip(range(len(J.gens())), J.gens()))
+ sage: x.operator()
+ Morphism from Euclidean Jordan algebra of degree 3 over Rational
+ Field to Euclidean Jordan algebra of degree 3 over Rational Field
+ given by matrix
+ [ 0 1 0]
+ [1/2 1 1/2]
+ [ 0 1 2]
+ sage: 2*x.operator()
+ Morphism from Euclidean Jordan algebra of degree 3 over Rational
+ Field to Euclidean Jordan algebra of degree 3 over Rational Field
+ given by matrix
+ [0 2 0]
+ [1 2 1]
+ [0 2 4]
+ sage: x.operator()*2
+ Morphism from Euclidean Jordan algebra of degree 3 over Rational
+ Field to Euclidean Jordan algebra of degree 3 over Rational Field
+ given by matrix
+ [0 2 0]
+ [1 2 1]
+ [0 2 4]
TESTS::
True
"""
- if not other.codomain() is self.domain():
+ try:
+ # I think the morphism classes break the coercion framework
+ # somewhere along the way, so we have to do this ourselves.
+ right = self.parent().coerce(right)
+ except:
+ pass
+
+ if not right.codomain() is self.domain():
raise ValueError("(co)domains must agree for composition")
return FiniteDimensionalEuclideanJordanAlgebraMorphism(
- self.parent(),
- self.matrix()*other.matrix() )
+ self.parent(),
+ self.matrix()*right.matrix() )
+
+ __mul__ = _lmul_
def _neg_(self):
if not self.is_invertible():
raise ValueError("element is not invertible")
- P = self.parent()
- return P(self.quadratic_representation().inverse()*self.vector())
+ return (~self.quadratic_representation())(self)
def is_invertible(self):
sage: D = (x0^2 - x_bar.inner_product(x_bar))*D
sage: D = D + 2*x_bar.tensor_product(x_bar)
sage: Q = block_matrix(2,2,[A,B,C,D])
- sage: Q == x.quadratic_representation().operator_matrix()
+ sage: Q == x.quadratic_representation().matrix()
True
Test all of the properties from Theorem 11.2 in Alizadeh::