From 9d08ce4003d8e1d46af79e0ecf1d926386dff81e Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Thu, 26 Mar 2026 20:56:17 -0400 Subject: [PATCH] mjo/clan/clan_element.py: add norm methods For convenience, define norm() and norm_vinberg() in terms of the corresponding inner product methods. This will usually involve a sqrt(), and I have not thought very hard about how to handle that intelligently. --- mjo/clan/clan_element.py | 65 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 61 insertions(+), 4 deletions(-) diff --git a/mjo/clan/clan_element.py b/mjo/clan/clan_element.py index 8c402ea..7c03142 100644 --- a/mjo/clan/clan_element.py +++ b/mjo/clan/clan_element.py @@ -28,8 +28,9 @@ class ClanElement(IndexedFreeModuleElement): EXAMPLES: - In the clan of real symmetric matrices under the Ishi norm, - it is easy to check that the idempotents all have norm 1/2:: + In the clan of real symmetric matrices under the Ishi norm, it + is easy to check that the idempotents all have norm-squared + ``1/2``:: sage: C = RealSymmetricClan(3) sage: b = C.basis() @@ -42,9 +43,40 @@ class ClanElement(IndexedFreeModuleElement): return sum( xi*yj*self.parent().inner_product_on_basis(bi, bj) for (bi, xi) in self.items() - for (bj, yj) in other.items() + for (bj, yj) in other.items() ) + def norm(self): + r""" + The norm of this element. + + This norm is with respect to the inner product used to + construct the clan. + + .. SEEALSO:: + + * :meth:`norm_vinberg` + + SETUP:: + + sage: from mjo.clan.t_algebra_clan import RealSymmetricClan + + EXAMPLES: + + In the clan of real symmetric matrices under the Ishi norm, it + is easy to check that the idempotents all have norm-squared + ``1/2``:: + + sage: C = RealSymmetricClan(3) + sage: b = C.basis() + sage: all( b[i,j,k].norm() == (~QQ(2)).sqrt() + ....: for (i,j,k) in b.keys() + ....: if j == i ) + True + + """ + return self.inner_product(self).sqrt() + def inner_product_vinberg(self, other): r""" The Vinberg inner product of ``self`` and ``other``. @@ -60,7 +92,7 @@ class ClanElement(IndexedFreeModuleElement): 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:: + usual trace inner product:: sage: C = RealSymmetricClan(3) sage: X = matrix(QQ, [[2,6,10],[6,10,14],[10,14,18]]) @@ -75,6 +107,31 @@ class ClanElement(IndexedFreeModuleElement): """ return (self*other).leftreg().trace() + def norm_vinberg(self): + r""" + The norm of ``self`` under :meth:`inner_product_vinberg`. + + SETUP:: + + sage: from mjo.clan.t_algebra_clan import RealSymmetricClan + + EXAMPLES: + + From the definition of "Sp(z)" and Lemma 2 (pp. 380--382), it + follows that for a symmetric matrix this is ``sqrt(2)`` times + the usual trace norm:: + + sage: C = RealSymmetricClan(3) + sage: X = matrix(QQ, [[2,6,10],[6,10,14],[10,14,18]]) + sage: (X*X).trace().sqrt() + 2*sqrt(273) + sage: X = C.from_matrix(X) + sage: X.norm_vinberg() + 2*sqrt(546) + + """ + return self.inner_product_vinberg(self).sqrt() + def leftreg(self): r""" Return the left-regular representation of this element. -- 2.53.0