]> gitweb.michael.orlitzky.com - sage.d.git/commitdiff
eja: make two subalgebra tests more general.
authorMichael Orlitzky <michael@orlitzky.com>
Sun, 10 Nov 2019 14:40:25 +0000 (09:40 -0500)
committerMichael Orlitzky <michael@orlitzky.com>
Sun, 10 Nov 2019 14:40:25 +0000 (09:40 -0500)
All of the subalgebra tests are element-subalgebra tests, because I
copied them from the element-subalgebra class. I'll slowly make them
more robust.

mjo/eja/eja_subalgebra.py

index 10303489f5af35bca16694b688269f50da50cdaf..024dfbe72ee6fb0f6f7fe2c00648b79a121d13a5 100644 (file)
@@ -177,11 +177,16 @@ class FiniteDimensionalEuclideanJordanSubalgebra(FiniteDimensionalEuclideanJorda
         EXAMPLES::
 
             sage: J = RealSymmetricEJA(3)
-            sage: x = sum( i*J.gens()[i] for i in range(6) )
-            sage: basis = tuple( x^k for k in range(J.rank()) )
-            sage: K = FiniteDimensionalEuclideanJordanSubalgebra(J,basis)
-            sage: [ K(x^k) for k in range(J.rank()) ]
-            [f0, f1, f2]
+            sage: X = matrix(QQ, [ [0,0,1],
+            ....:                  [0,1,0],
+            ....:                  [1,0,0] ])
+            sage: x = J(X)
+            sage: basis = ( x, x^2 ) # x^2 is the identity matrix
+            sage: K = FiniteDimensionalEuclideanJordanSubalgebra(J, basis)
+            sage: K(J.one())
+            f1
+            sage: K(J.one() + x)
+            f0 + f1
 
         ::
 
@@ -223,21 +228,25 @@ class FiniteDimensionalEuclideanJordanSubalgebra(FiniteDimensionalEuclideanJorda
         EXAMPLES::
 
             sage: J = RealSymmetricEJA(3)
-            sage: x = J.monomial(0) + 2*J.monomial(2) + 5*J.monomial(5)
-            sage: basis = (x^0, x^1, x^2)
+            sage: E11 = matrix(QQ, [ [1,0,0],
+            ....:                    [0,0,0],
+            ....:                    [0,0,0] ])
+            sage: E22 = matrix(QQ, [ [0,0,0],
+            ....:                    [0,1,0],
+            ....:                    [0,0,0] ])
+            sage: b1 = J(E11)
+            sage: b2 = J(E22)
+            sage: basis = (b1, b2)
             sage: K = FiniteDimensionalEuclideanJordanSubalgebra(J,basis)
             sage: K.vector_space()
-            Vector space of degree 6 and dimension 3 over...
+            Vector space of degree 6 and dimension 2 over...
             User basis matrix:
-            [ 1  0  1  0  0  1]
-            [ 1  0  2  0  0  5]
-            [ 1  0  4  0  0 25]
-            sage: (x^0).to_vector()
-            (1, 0, 1, 0, 0, 1)
-            sage: (x^1).to_vector()
-            (1, 0, 2, 0, 0, 5)
-            sage: (x^2).to_vector()
-            (1, 0, 4, 0, 0, 25)
+            [1 0 0 0 0 0]
+            [0 0 1 0 0 0]
+            sage: b1.to_vector()
+            (1, 0, 0, 0, 0, 0)
+            sage: b2.to_vector()
+            (0, 0, 1, 0, 0, 0)
 
         """
         return self._vector_space