return self.zero()
else:
sa_one = self.superalgebra().one().to_vector()
- sa_coords = self.vector_space().coordinate_vector(sa_one)
- return self.from_vector(sa_coords)
+ # 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))
+
if elt not in self.superalgebra():
raise ValueError("not an element of this subalgebra")
- coords = self.vector_space().coordinate_vector(elt.to_vector())
- return self.from_vector(coords)
+ # 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(elt.to_vector(),
+ self.superalgebra().vector_space().basis()) )
+ return self.from_vector(self.vector_space().coordinate_vector(coords))