From: Michael Orlitzky Date: Wed, 27 Nov 2024 01:02:56 +0000 (-0500) Subject: mjo/eja/eja_operator.py: add is_homomorphism() for operators X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=5a895f959f7fed530690686637383751550b61f3;p=sage.d.git mjo/eja/eja_operator.py: add is_homomorphism() for operators --- diff --git a/mjo/eja/eja_operator.py b/mjo/eja/eja_operator.py index 0b1e9a8..8ee8dea 100644 --- a/mjo/eja/eja_operator.py +++ b/mjo/eja/eja_operator.py @@ -663,6 +663,60 @@ class EJAOperator(Map): ) + def is_homomorphism(self): + r""" + Return whether or not this operator is an algebra homomorphism. + + SETUP:: + + sage: from mjo.eja.eja_operator import EJAOperator + sage: from mjo.eja.eja_algebra import (random_eja, + ....: JordanSpinEJA, + ....: RealSymmetricEJA) + + EXAMPLES: + + The identity and zero operators are trivially homomorphisms:: + + sage: J = random_eja() + sage: J.zero().operator().is_homomorphism() + True + sage: J.one().operator().is_homomorphism() + True + + Sending one factor of a cartesian product to zero is a + homomorphism:: + + sage: J1 = random_eja(field=QQ, orthonormalize=False) + sage: J2 = random_eja(field=QQ, orthonormalize=False) + sage: J = cartesian_product([J1,J2]) + sage: I1 = matrix.identity(QQ, J1.dimension()) + sage: Z1 = matrix.zero(QQ, J1.dimension()) + sage: I2 = matrix.identity(QQ, J2.dimension()) + sage: Z2 = matrix.zero(QQ, J2.dimension()) + sage: M = block_matrix([ + ....: [I1, 0], + ....: [0, Z2] + ....: ]) + sage: L = EJAOperator(J,J,M) + sage: L.is_homomorphism() + True + sage: M = block_matrix([ + ....: [Z1, 0], + ....: [0, I2] + ....: ]) + sage: L = EJAOperator(J,J,M) + sage: L.is_homomorphism() + True + + """ + return all( + self(b1*b2) == self(b1)*self(b2) + for b1 in self.domain().basis() + for b2 in self.domain().basis() + ) + + def matrix(self): """ Return the matrix representation of this operator with respect