X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;ds=sidebyside;f=mjo%2Feja%2Feja_operator.py;h=6e22d367c6faa55a4f1461925ce62b04aaedfef1;hb=64a06cae592dafa4ad007110d5d7ea9ae62dcee5;hp=781d987518af32043ef11ccbb1533f9ad4f3b6ef;hpb=2abd850942d957e2ea082efef1ef32a22d267959;p=sage.d.git diff --git a/mjo/eja/eja_operator.py b/mjo/eja/eja_operator.py index 781d987..6e22d36 100644 --- a/mjo/eja/eja_operator.py +++ b/mjo/eja/eja_operator.py @@ -383,6 +383,56 @@ class FiniteDimensionalEuclideanJordanAlgebraOperator(Map): return (self + (-other)) + def inverse(self): + """ + Return the inverse of this operator, if it exists. + + The reason this method is not simply an alias for the built-in + :meth:`__invert__` is that the built-in inversion is a bit magic + since it's intended to be a unary operator. If we alias ``inverse`` + to ``__invert__``, then we wind up having to call e.g. ``A.inverse`` + without parentheses. + + SETUP:: + + sage: from mjo.eja.eja_algebra import RealSymmetricEJA, random_eja + + EXAMPLES:: + + sage: J = RealSymmetricEJA(2) + sage: x = sum(J.gens()) + sage: x.operator().inverse().matrix() + [3/2 -1 1/2] + [ -1 2 -1] + [1/2 -1 3/2] + sage: x.operator().matrix().inverse() + [3/2 -1 1/2] + [ -1 2 -1] + [1/2 -1 3/2] + + TESTS: + + The identity operator is its own inverse:: + + sage: set_random_seed() + sage: J = random_eja() + sage: idJ = J.one().operator() + sage: idJ.inverse() == idJ + True + + The zero operator is never invertible:: + + sage: set_random_seed() + sage: J = random_eja() + sage: J.zero().operator().inverse() + Traceback (most recent call last): + ... + ZeroDivisionError: input matrix must be nonsingular + + """ + return ~self + + def is_invertible(self): """ Return whether or not this operator is invertible. @@ -474,6 +524,11 @@ class FiniteDimensionalEuclideanJordanAlgebraOperator(Map): Return the spectral decomposition of this operator as a list of (eigenvalue, orthogonal projector) pairs. + This is the unique spectral decomposition, up to the order of + the projection operators, with distinct eigenvalues. So, the + projections are generally onto subspaces of dimension greater + than one. + SETUP:: sage: from mjo.eja.eja_algebra import RealSymmetricEJA @@ -497,15 +552,9 @@ class FiniteDimensionalEuclideanJordanAlgebraOperator(Map): True sage: P1^2 == P1 True - sage: c0 = P0(A.one()) - sage: c1 = P1(A.one()) - sage: c0.inner_product(c1) == 0 - True - sage: c0 + c1 == A.one() - True - sage: c0.is_idempotent() + sage: P0*P1 == A.zero().operator() True - sage: c1.is_idempotent() + sage: P1*P0 == A.zero().operator() True """