From: Michael Orlitzky Date: Thu, 28 Nov 2024 23:20:17 +0000 (-0500) Subject: mjo/eja/eja_operator.py: improved is_isomorphism() tests X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=6a9013933cf040a8ff4c5c495711bd8cf74e1ff0;p=sage.d.git mjo/eja/eja_operator.py: improved is_isomorphism() tests For random testing we can use rationals; but only certain small examples complete fast enough over the algebraics. --- diff --git a/mjo/eja/eja_operator.py b/mjo/eja/eja_operator.py index 8f60ce7..7b40b90 100644 --- a/mjo/eja/eja_operator.py +++ b/mjo/eja/eja_operator.py @@ -785,9 +785,13 @@ class EJAOperator(Map): sage: (L^2).is_isomorphism() True - Likewise for the isomorphisms of the real symmetric algebra:: + Likewise for the isomorphisms of the real symmetric + algebra. We can check these for much larger ``n`` if we work + over the rationals:: - sage: J = RealSymmetricEJA.random_instance() + sage: J = RealSymmetricEJA.random_instance(field=QQ, + ....: orthonormalize=False, + ....: max_dimension=15) sage: n = J.one().to_matrix().nrows() sage: U = random_unitary_matrix(J.base_ring(), n) sage: L = lambda X: J(U.conjugate_transpose()*X*U) @@ -802,13 +806,33 @@ class EJAOperator(Map): sage: (L^2).is_isomorphism() True + If we use the algebraic field, though, only small examples are + checkable in a reasonable amount of time:: + + sage: J = RealSymmetricEJA(3) + sage: U = random_unitary_matrix(J.base_ring(), 3) + sage: L = lambda X: J(U.conjugate_transpose()*X*U) + sage: columns = ( L(b).to_vector() for b in J.matrix_basis() ) + sage: MS = MatrixSpace(J.base_ring(), J.dimension(), J.dimension()) + sage: M = MS(columns).transpose() # long time + sage: L = EJAOperator(J,J,M) # long time + sage: L.is_isomorphism() # long time + True + sage: L.inverse().is_isomorphism() # long time + True + sage: (L^2).is_isomorphism() # long time + True + And the complex hermitian algebra. This starts to get tricky because we need to coerce the unitary matrix into the correct space (with real scalars):: - sage: J = ComplexHermitianEJA.random_instance() + sage: J = ComplexHermitianEJA.random_instance(field=QQ, + ....: orthonormalize=False, + ....: max_dimension=16) sage: n = J.one().to_matrix().nrows() - sage: U = random_unitary_matrix(QQbar, n) + sage: F = QuadraticField(-1, 'I') + sage: U = random_unitary_matrix(F, n) sage: UU = J.matrix_space().from_list(U.rows()) sage: L = lambda X: J((UU.conjugate_transpose()*X*UU)) @@ -838,6 +862,38 @@ class EJAOperator(Map): sage: (L^2).is_isomorphism() True + Again we repeat with a _specific_ example whose scalars are + algebraic; anything larger than this takes too long (though + `n=3` is doable if you're willing to wait five minutes):: + + sage: J = ComplexHermitianEJA(2) + sage: U = random_unitary_matrix(QQbar, 2) + sage: UU = J.matrix_space().from_list(U.rows()) + + sage: L = lambda X: J((UU.conjugate_transpose()*X*UU)) + sage: columns = ( L(b).to_vector() for b in J.matrix_basis() ) + sage: MS = MatrixSpace(J.base_ring(), J.dimension(), J.dimension()) + sage: M = MS(columns).transpose() + sage: L = EJAOperator(J,J,M) + sage: L.is_isomorphism() + True + sage: L.inverse().is_isomorphism() + True + sage: (L^2).is_isomorphism() + True + + sage: L = lambda X: J((UU.conjugate_transpose()*X.conjugate()*UU)) + sage: columns = ( L(b).to_vector() for b in J.matrix_basis() ) + sage: MS = MatrixSpace(J.base_ring(), J.dimension(), J.dimension()) + sage: M = MS(columns).transpose() + sage: L = EJAOperator(J,J,M) + sage: L.is_isomorphism() + True + sage: L.inverse().is_isomorphism() + True + sage: (L^2).is_isomorphism() + True + TESTS: The identity operator is always a Jordan isomorphism::