]> gitweb.michael.orlitzky.com - sage.d.git/commitdiff
eja: fix sub-subalgebra element construction.
authorMichael Orlitzky <michael@orlitzky.com>
Sun, 18 Oct 2020 05:24:18 +0000 (01:24 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Sun, 18 Oct 2020 05:24:18 +0000 (01:24 -0400)
mjo/eja/eja_element_subalgebra.py
mjo/eja/eja_subalgebra.py

index 7fbd0609d9578406cb3ce9a8683fc6e46c8a95e4..cff8b4e8bbc8e1f2119061ca5a5bb84842393a03 100644 (file)
@@ -163,5 +163,10 @@ class FiniteDimensionalEuclideanJordanElementSubalgebra(FiniteDimensionalEuclide
             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))
+
index ac77f22a691e7cc04138e34cae46f148909de0f8..4355e9f20e40d1a396f42a686d474c77e18f1b47 100644 (file)
@@ -215,8 +215,12 @@ class FiniteDimensionalEuclideanJordanSubalgebra(FiniteDimensionalEuclideanJorda
         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))