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))