# We need to supply something here to avoid getting the
# default Homset of the parent FiniteDimensionalAlgebra class,
- # which messes up e.g. equality testing.
- parent = Hom(domain_eja, codomain_eja, VectorSpaces(F))
+ # which messes up e.g. equality testing. We use FreeModules(F)
+ # instead of VectorSpaces(F) because our characteristic polynomial
+ # algorithm will need to F to be a polynomial ring at some point.
+ # When F is a field, FreeModules(F) returns VectorSpaces(F) anyway.
+ parent = Hom(domain_eja, codomain_eja, FreeModules(F))
# The Map initializer will set our parent to a homset, which
# is explicitly NOT what we want, because these ain't algebra