From 0732f9b87a11349a065c11e6877d402b3a0fccc1 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Thu, 28 Nov 2024 20:17:25 -0500 Subject: [PATCH] mjo/eja/eja_operator.py: randomize the permuted factors test --- mjo/eja/eja_operator.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/mjo/eja/eja_operator.py b/mjo/eja/eja_operator.py index 698bc87..ebb4531 100644 --- a/mjo/eja/eja_operator.py +++ b/mjo/eja/eja_operator.py @@ -902,19 +902,24 @@ class EJAOperator(Map): Permuting factors is always a Jordan isomorphism:: + sage: from random import choice sage: J1 = random_eja(field=QQ, orthonormalize=False) sage: J2 = random_eja(field=QQ, orthonormalize=False) sage: J3 = random_eja(field=QQ, orthonormalize=False) - sage: J = cartesian_product([J1,J1,J3,J2,J2]) + sage: factors = [J1,J1,J2,J2,J3] + sage: J = cartesian_product(factors) + sage: p = choice(SymmetricGroup(5)) + sage: H = cartesian_product(p(factors)) sage: I1 = J1.one().operator().matrix() sage: I2 = J2.one().operator().matrix() sage: I3 = J3.one().operator().matrix() - sage: M = block_matrix(5, 5, [[ 0, 0, 0, 0, I2 ], - ....: [ 0, I1, 0, 0, 0 ], - ....: [ 0, 0, 0, I2, 0 ], - ....: [I1, 0, 0, 0, 0 ], - ....: [ 0, 0, I3, 0, 0 ]]) - sage: L = EJAOperator(J,J,M) + sage: rows = [[I1, 0, 0, 0, 0 ], + ....: [ 0, I1, 0, 0, 0 ], + ....: [ 0, 0, I2, 0, 0 ], + ....: [ 0, 0, 0, I2, 0 ], + ....: [ 0, 0, 0, 0, I3 ]] + sage: M = block_matrix(5, 5, p(rows)) + sage: L = EJAOperator(J,H,M) sage: L.is_isomorphism() True sage: L.inverse().is_isomorphism() -- 2.44.2