return W.linear_combination(zip(B,self.to_vector()))
+ def norm(self):
+ """
+ The norm of this element with respect to :meth:`inner_product`.
+
+ SETUP::
+
+ sage: from mjo.eja.eja_algebra import (JordanSpinEJA,
+ ....: RealCartesianProductEJA)
+
+ EXAMPLES::
+
+ sage: J = RealCartesianProductEJA(2)
+ sage: x = sum(J.gens())
+ sage: x.norm()
+ sqrt(2)
+
+ ::
+
+ sage: J = JordanSpinEJA(4)
+ sage: x = sum(J.gens())
+ sage: x.norm()
+ 2
+
+ """
+ return self.inner_product(self).sqrt()
+
+
def operator(self):
"""
Return the left-multiplication-by-this-element
raise TypeError("'other' must live in the same algebra")
return (self*other).trace()
+
+
+ def trace_norm(self):
+ """
+ The norm of this element with respect to :meth:`trace_inner_product`.
+
+ SETUP::
+
+ sage: from mjo.eja.eja_algebra import (JordanSpinEJA,
+ ....: RealCartesianProductEJA)
+
+ EXAMPLES::
+
+ sage: J = RealCartesianProductEJA(2)
+ sage: x = sum(J.gens())
+ sage: x.trace_norm()
+ sqrt(2)
+
+ ::
+
+ sage: J = JordanSpinEJA(4)
+ sage: x = sum(J.gens())
+ sage: x.trace_norm()
+ 2*sqrt(2)
+
+ """
+ return self.trace_inner_product(self).sqrt()