From c051165d656bd4eccb6c12d9bad27698f44102cf Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Mon, 16 Feb 2026 21:03:12 -0500 Subject: [PATCH] mjo/clan/clan_operator.py: public matrix() method This will be useful for the Vinberg inner product. --- mjo/clan/clan_operator.py | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/mjo/clan/clan_operator.py b/mjo/clan/clan_operator.py index 6a058e5..ed4d6b3 100644 --- a/mjo/clan/clan_operator.py +++ b/mjo/clan/clan_operator.py @@ -85,7 +85,7 @@ class ClanOperator(Map): True """ - return self.codomain().from_vector(self._matrix*x.to_vector()) + return self.codomain().from_vector(self.matrix()*x.to_vector()) def _repr_(self): r""" @@ -116,6 +116,29 @@ class ClanOperator(Map): "{!r}\n", "Domain: {}\n", "Codomain: {}") - return ''.join(msg).format(self._matrix, + return ''.join(msg).format(self.matrix(), self.domain(), self.codomain()) + def matrix(self): + """ + Return the matrix representation of this operator with respect + to the default bases of its (co)domain. + + SETUP:: + + sage: from mjo.clan.clan_operator import ClanOperator + sage: from mjo.clan.unital_clan import SnClan + + EXAMPLES:: + + sage: C = SnClan(2) + sage: d = C.dimension() + sage: mat = matrix(C.base_ring(), d, range(d**2)) + sage: f = ClanOperator(C,C,mat) + sage: f.matrix() + [0 1 2] + [3 4 5] + [6 7 8] + + """ + return self._matrix -- 2.51.0