]> gitweb.michael.orlitzky.com - sage.d.git/commitdiff
eja: use FreeModules() category for operators instead of VectorSpaces().
authorMichael Orlitzky <michael@orlitzky.com>
Sun, 28 Jul 2019 15:21:00 +0000 (11:21 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Mon, 29 Jul 2019 03:19:01 +0000 (23:19 -0400)
This allows our characteristic polynomial algorithm to use real
operators and not matrices.

mjo/eja/euclidean_jordan_algebra.py

index 9072a12e511b51dbeb64fe6c9e0336a0ab6d87fe..ba2c63cf492a663dcb252ef5f49fa5b6f68e6c88 100644 (file)
@@ -28,8 +28,11 @@ class FiniteDimensionalEuclideanJordanAlgebraOperator(Map):
 
         # 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