]> gitweb.michael.orlitzky.com - sage.d.git/commitdiff
mjo/clan/unital_clan.py: begin sorting out the Vinberg clan init
authorMichael Orlitzky <michael@orlitzky.com>
Sat, 14 Feb 2026 20:17:54 +0000 (15:17 -0500)
committerMichael Orlitzky <michael@orlitzky.com>
Sat, 14 Feb 2026 20:17:54 +0000 (15:17 -0500)
mjo/clan/unital_clan.py

index d838093da2d11291cc1b6ef935d36bea8b7e0089..0e497bbadfe725ce561eb319207f8e8c4d10098c 100644 (file)
@@ -562,29 +562,64 @@ class VinbergClan(NormalDecomposition):
         from sage.modules.free_module import VectorSpace
 
         M2 = MatrixSpace(scalar_field, 2)
-        b = Mn.basis()
+        b = M2.basis()
 
         from sage.sets.family import Family
         S2_basis = Family({ (i,j,1) :
             a*(b[(i,j)] + b[(j,i)])
-            for i in range(n)
+            for i in range(2)
             for j in range(i+1)
             if (a := 1 - (i == j)/scalar_field(2))
         })
 
-        # Mn.submodule() destroys our basis keys, so use
+        # M2.submodule() destroys our basis keys, so use
         # SubmoduleWithBasis directly.
         self._S2 = SubmoduleWithBasis(S2_basis,
                                       support_order=b.keys(),
                                       ambient=M2)
 
-        R5 = VectorSpace(scalar_field, 5)
+        # We need an Ishi basis (i,j,k) for R^5 if we want to use
+        # NormalDecomposition.
+        R5 = VectorSpace(scalar_field, [
+            (0,0,1),
+            (1,0,1),
+            (1,1,1),
+            (2,1,1),
+            (2,2,1)
+        ])
+
+        def unlift(pair):
+            A,B = pair
+            return ( A[(0,0,1)]*R5((0,0,1)) +
+                     A[(1,0,1)]*R5((1,0,1)) +
+                     A[(1,1,1)]*R5((1,1,1)) +
+                     B[(1,0,1)]*R5((2,1,1)) +
+                     B[(1,1,1)]*R5((2,2,1)) )
 
         def lift(v):
-            
-            return 
-
-        super().__init__(R5, MatrixClan._cp, MatrixClan._ip, **kwargs)
+            M1 = ( self._S2((0,0,1))*v[(0,0,1)] +
+                   self._S2((1,0,1))*v[(1,0,1)] +
+                   self._S2((1,1,1))*v[(1,1,1)] )
+            M2 = ( self._S2((0,0,1))*v[(0,0,1)] +
+                   self._S2((1,0,1))*v[(2,1,1)] +
+                   self._S2((1,1,1))*v[(2,2,1)] )
+            return (M1,M2)
+
+        def cp(x,y):
+            X1,X2 = lift(x)
+            Y1,Y2 = lift(y)
+            Z1 = MatrixClan._down_hat(X1)*Y1 + Y1*MatrixClan._up_hat(X1)
+            Z2 = MatrixClan._down_hat(X2)*Y2 + Y2*MatrixClan._up_hat(X2)
+            return unlift(Z1,Z2)
+
+        def ip(x,y):
+            two = x.base_ring()(2)
+            p = cp(x,y) / two
+            return sum( p[idx]
+                        for idx in p.monomial_coefficients()
+                        if idx[0] == idx[1] )
+
+        super().__init__(R5, cp, ip, **kwargs)
 
     def __repr__(self) -> str:
         r"""