]> gitweb.michael.orlitzky.com - sage.d.git/commitdiff
mjo/clan/clan_element.py: add the Vinberg inner product
authorMichael Orlitzky <michael@orlitzky.com>
Tue, 17 Feb 2026 02:37:11 +0000 (21:37 -0500)
committerMichael Orlitzky <michael@orlitzky.com>
Tue, 17 Feb 2026 02:37:11 +0000 (21:37 -0500)
mjo/clan/clan_element.py

index 6b08e53134f351b6bb1654209f681d6f8279d1e0..e550119ba9c4e00dd36e096fa943cf476132e725 100644 (file)
@@ -45,6 +45,36 @@ class ClanElement(IndexedFreeModuleElement):
             for (bj, yj)  in other.items()
         )
 
+    def inner_product_vinberg(self, other):
+        r"""
+        The Vinberg inner product of ``self`` and ``other``.
+
+        It is convenient to have this available independent of the
+        inner product used to define the clan.
+
+        SETUP::
+
+            sage: from mjo.clan.unital_clan import SnClan
+
+        EXAMPLES:
+
+        From the definition of "Sp(z)" and Lemma 2 (pp. 380--382),
+        it follows that for a symmetric matrix this is twice the
+        usual trace::
+
+            sage: C = SnClan(3)
+            sage: X = matrix(QQ, [[2,6,10],[6,10,14],[10,14,18]])
+            sage: Y = matrix(QQ, [[2,1,0],[1,1,1],[0,1,4]])
+            sage: (X*Y).trace()
+            126
+            sage: X = C.from_matrix(X)
+            sage: Y = C.from_matrix(Y)
+            sage: X.inner_product_vinberg(Y)
+            252
+
+        """
+        return (self*other).leftreg().trace()
+
     def leftreg(self):
         r"""
         Return the left-regular representation of this element.