]> gitweb.michael.orlitzky.com - sage.d.git/commitdiff
eja: port BilinearFormEJA to matrix-only representation.
authorMichael Orlitzky <michael@orlitzky.com>
Mon, 7 Dec 2020 21:26:51 +0000 (16:26 -0500)
committerMichael Orlitzky <michael@orlitzky.com>
Mon, 7 Dec 2020 21:27:14 +0000 (16:27 -0500)
mjo/eja/eja_algebra.py

index f14218151d69db6fb90bdf2bec240a9506569f33..2c68c8cdd1ff8eb5c3a1a90ccac7d3987bdfbce0 100644 (file)
@@ -2317,25 +2317,25 @@ class BilinearFormEJA(ConcreteEJA):
             raise ValueError("bilinear form is not positive-definite")
 
         def inner_product(x,y):
-            return (B*x).inner_product(y)
+            return (y.T*B*x)[0,0]
 
         def jordan_product(x,y):
             P = x.parent()
-            x0 = x[0]
-            xbar = x[1:]
-            y0 = y[0]
-            ybar = y[1:]
-            z0 = inner_product(x,y)
+            x0 = x[0,0]
+            xbar = x[1:,0]
+            y0 = y[0,0]
+            ybar = y[1:,0]
+            z0 = (y.T*x)[0,0]
             zbar = y0*xbar + x0*ybar
-            return P((z0,) + tuple(zbar))
+            return P([0] + zbar.list())
 
         # We know this is a valid EJA, but will double-check
         # if the user passes check_axioms=True.
         if "check_axioms" not in kwargs: kwargs["check_axioms"] = False
 
         n = B.nrows()
-        standard_basis = FreeModule(ZZ, n).basis()
-        super(BilinearFormEJA, self).__init__(standard_basis,
+        column_basis = tuple( b.column() for b in FreeModule(ZZ, n).basis() )
+        super(BilinearFormEJA, self).__init__(column_basis,
                                               jordan_product,
                                               inner_product,
                                               **kwargs)