From 9109474162705d518acf4062ec1f7a4d00ea0734 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Mon, 16 Feb 2026 21:37:11 -0500 Subject: [PATCH] mjo/clan/clan_element.py: add the Vinberg inner product --- mjo/clan/clan_element.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/mjo/clan/clan_element.py b/mjo/clan/clan_element.py index 6b08e53..e550119 100644 --- a/mjo/clan/clan_element.py +++ b/mjo/clan/clan_element.py @@ -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. -- 2.51.0