From 2abd850942d957e2ea082efef1ef32a22d267959 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Thu, 10 Oct 2019 09:04:51 -0400 Subject: [PATCH] eja: add is_invertible() for operators. --- mjo/eja/eja_operator.py | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/mjo/eja/eja_operator.py b/mjo/eja/eja_operator.py index cc1c5e0..781d987 100644 --- a/mjo/eja/eja_operator.py +++ b/mjo/eja/eja_operator.py @@ -383,6 +383,47 @@ class FiniteDimensionalEuclideanJordanAlgebraOperator(Map): return (self + (-other)) + def is_invertible(self): + """ + Return whether or not this operator is invertible. + + SETUP:: + + sage: from mjo.eja.eja_algebra import RealSymmetricEJA, random_eja + + EXAMPLES:: + + sage: J = RealSymmetricEJA(2) + sage: x = sum(J.gens()) + sage: x.operator().matrix() + [ 1 1/2 0] + [1/2 1 1/2] + [ 0 1/2 1] + sage: x.operator().matrix().is_invertible() + True + sage: x.operator().is_invertible() + True + + TESTS: + + The identity operator is always invertible:: + + sage: set_random_seed() + sage: J = random_eja() + sage: J.one().operator().is_invertible() + True + + The zero operator is never invertible:: + + sage: set_random_seed() + sage: J = random_eja() + sage: J.zero().operator().is_invertible() + False + + """ + return self.matrix().is_invertible() + + def matrix(self): """ Return the matrix representation of this operator with respect -- 2.44.2