pi_left = lambda x: J1.from_vector(x.to_vector()[:n])
pi_right = lambda x: J2.from_vector(x.to_vector()[n:])
return (pi_left, pi_right)
+
+ def inclusions(self):
+ r"""
+ Return the pair of inclusion maps from our factors into us.
+
+ SETUP::
+
+ sage: from mjo.eja.eja_algebra import (JordanSpinEJA,
+ ....: RealSymmetricEJA,
+ ....: DirectSumEJA)
+
+ EXAMPLES::
+
+ sage: J1 = JordanSpinEJA(3)
+ sage: J2 = RealSymmetricEJA(2)
+ sage: J = DirectSumEJA(J1,J2)
+ sage: (iota_left, iota_right) = J.inclusions()
+ sage: iota_left(J1.zero()) == J.zero()
+ True
+ sage: iota_right(J2.zero()) == J.zero()
+ True
+ sage: J1.one().to_vector()
+ (1, 0, 0)
+ sage: iota_left(J1.one()).to_vector()
+ (1, 0, 0, 0, 0, 0)
+ sage: J2.one().to_vector()
+ (1, 0, 1)
+ sage: iota_right(J2.one()).to_vector()
+ (0, 0, 0, 1, 0, 1)
+ sage: J.one().to_vector()
+ (1, 0, 0, 1, 0, 1)
+
+ """
+ (J1,J2) = self.factors()
+ n = J1.dimension()
+ V_basis = self.vector_space().basis()
+ I1 = matrix.column(self.base_ring(), V_basis[:n])
+ I2 = matrix.column(self.base_ring(), V_basis[n:])
+ iota_left = lambda x: self.from_vector(I1*x.to_vector())
+ iota_right = lambda x: self.from_vector(I2*+x.to_vector())
+ return (iota_left, iota_right)