from sage.matrix.constructor import matrix
+from sage.misc.cachefunc import cached_method
from sage.rings.all import QQ
from mjo.eja.eja_subalgebra import FiniteDimensionalEuclideanJordanSubalgebra
self.rank.set_cache(self.dimension())
+ @cached_method
def one(self):
"""
Return the multiplicative identity element of this algebra.
The superclass method computes the identity element, which is
beyond overkill in this case: the superalgebra identity
restricted to this algebra is its identity. Note that we can't
- count on the first basis element being the identity -- it migth
+ count on the first basis element being the identity -- it might
have been scaled if we orthonormalized the basis.
SETUP::
"""
if self.dimension() == 0:
return self.zero()
- else:
- sa_one = self.superalgebra().one().to_vector()
- # The extra hackery is because foo.to_vector() might not
- # live in foo.parent().vector_space()!
- coords = sum( a*b for (a,b)
- in zip(sa_one,
- self.superalgebra().vector_space().basis()) )
- return self.from_vector(self.vector_space().coordinate_vector(coords))
+
+ return self(self.superalgebra().one())