From c38ce6eab53954221d4f944ea0ad4ac27f323023 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Sat, 4 Feb 2023 12:12:03 -0500 Subject: [PATCH] eja: drop "FiniteDimensional" prefix everywhere. --- mjo/eja/TODO | 2 - mjo/eja/eja_algebra.py | 54 +++++++++++++------------- mjo/eja/eja_element.py | 8 ++-- mjo/eja/eja_operator.py | 82 +++++++++++++++++++-------------------- mjo/eja/eja_subalgebra.py | 33 ++++++++-------- 5 files changed, 89 insertions(+), 90 deletions(-) diff --git a/mjo/eja/TODO b/mjo/eja/TODO index a5e81b9..f4b9515 100644 --- a/mjo/eja/TODO +++ b/mjo/eja/TODO @@ -13,5 +13,3 @@ 5. The rational_algebra() stuff doesn't really belong in classes that don't derive from RationalBasisEJA or its as-yet-nonexistent element class. - -6. Drop "FiniteDimensional" everywhere. diff --git a/mjo/eja/eja_algebra.py b/mjo/eja/eja_algebra.py index 92a7df1..adcc343 100644 --- a/mjo/eja/eja_algebra.py +++ b/mjo/eja/eja_algebra.py @@ -72,18 +72,18 @@ matrix, whereas the inner product must return a scalar. Our basis for the one-by-one matrices is of course the set consisting of a single matrix with its sole entry non-zero:: - sage: from mjo.eja.eja_algebra import FiniteDimensionalEJA + sage: from mjo.eja.eja_algebra import EJA sage: jp = lambda X,Y: X*Y sage: ip = lambda X,Y: X[0,0]*Y[0,0] sage: b1 = matrix(AA, [[1]]) - sage: J1 = FiniteDimensionalEJA((b1,), jp, ip) + sage: J1 = EJA((b1,), jp, ip) sage: J1 Euclidean Jordan algebra of dimension 1 over Algebraic Real Field In fact, any positive scalar multiple of that inner-product would work:: sage: ip2 = lambda X,Y: 16*ip(X,Y) - sage: J2 = FiniteDimensionalEJA((b1,), jp, ip2) + sage: J2 = EJA((b1,), jp, ip2) sage: J2 Euclidean Jordan algebra of dimension 1 over Algebraic Real Field @@ -91,7 +91,7 @@ But beware that your basis will be orthonormalized _with respect to the given inner-product_ unless you pass ``orthonormalize=False`` to the constructor. For example:: - sage: J3 = FiniteDimensionalEJA((b1,), jp, ip2, orthonormalize=False) + sage: J3 = EJA((b1,), jp, ip2, orthonormalize=False) sage: J3 Euclidean Jordan algebra of dimension 1 over Algebraic Real Field @@ -118,7 +118,7 @@ Another option for your basis is to use elemebts of a sage: from mjo.matrix_algebra import MatrixAlgebra sage: A = MatrixAlgebra(1,AA,AA) - sage: J4 = FiniteDimensionalEJA(A.gens(), jp, ip) + sage: J4 = EJA(A.gens(), jp, ip) sage: J4 Euclidean Jordan algebra of dimension 1 over Algebraic Real Field sage: J4.basis()[0].to_matrix() @@ -168,8 +168,8 @@ from sage.rings.all import (ZZ, QQ, AA, QQbar, RR, RLF, CLF, PolynomialRing, QuadraticField) from mjo.eja.eja_element import (CartesianProductEJAElement, - FiniteDimensionalEJAElement) -from mjo.eja.eja_operator import FiniteDimensionalEJAOperator + EJAElement) +from mjo.eja.eja_operator import EJAOperator from mjo.eja.eja_utils import _all2list def EuclideanJordanAlgebras(field): @@ -183,7 +183,7 @@ def EuclideanJordanAlgebras(field): category = category.WithBasis().Unital().Commutative() return category -class FiniteDimensionalEJA(CombinatorialFreeModule): +class EJA(CombinatorialFreeModule): r""" A finite-dimensional Euclidean Jordan algebra. @@ -238,7 +238,7 @@ class FiniteDimensionalEJA(CombinatorialFreeModule): sage: J.subalgebra(basis, orthonormalize=False).is_associative() True """ - Element = FiniteDimensionalEJAElement + Element = EJAElement @staticmethod def _check_input_field(field): @@ -1674,8 +1674,8 @@ class FiniteDimensionalEJA(CombinatorialFreeModule): r""" Create a subalgebra of this algebra from the given basis. """ - from mjo.eja.eja_subalgebra import FiniteDimensionalEJASubalgebra - return FiniteDimensionalEJASubalgebra(self, basis, **kwargs) + from mjo.eja.eja_subalgebra import EJASubalgebra + return EJASubalgebra(self, basis, **kwargs) def vector_space(self): @@ -1697,7 +1697,7 @@ class FiniteDimensionalEJA(CombinatorialFreeModule): -class RationalBasisEJA(FiniteDimensionalEJA): +class RationalBasisEJA(EJA): r""" Algebras whose supplied basis elements have all rational entries. @@ -1752,7 +1752,7 @@ class RationalBasisEJA(FiniteDimensionalEJA): # Note: the same Jordan and inner-products work here, # because they are necessarily defined with respect to # ambient coordinates and not any particular basis. - self._rational_algebra = FiniteDimensionalEJA( + self._rational_algebra = EJA( basis, jordan_product, inner_product, @@ -1815,7 +1815,7 @@ class RationalBasisEJA(FiniteDimensionalEJA): subs_dict = { X[i]: BX[i] for i in range(len(X)) } return tuple( a_i.subs(subs_dict) for a_i in a ) -class ConcreteEJA(FiniteDimensionalEJA): +class ConcreteEJA(EJA): r""" A class for the Euclidean Jordan algebras that we know by name. @@ -1916,7 +1916,7 @@ class ConcreteEJA(FiniteDimensionalEJA): return eja_class.random_instance(max_dimension, *args, **kwargs) -class HermitianMatrixEJA(FiniteDimensionalEJA): +class HermitianMatrixEJA(EJA): @staticmethod def _denormalized_basis(A): """ @@ -2342,7 +2342,7 @@ class OctonionHermitianEJA(HermitianMatrixEJA, RationalBasisEJA, ConcreteEJA): r""" SETUP:: - sage: from mjo.eja.eja_algebra import (FiniteDimensionalEJA, + sage: from mjo.eja.eja_algebra import (EJA, ....: OctonionHermitianEJA) sage: from mjo.hurwitz import Octonions, OctonionMatrixAlgebra @@ -2364,7 +2364,7 @@ class OctonionHermitianEJA(HermitianMatrixEJA, RationalBasisEJA, ConcreteEJA): sage: basis = (b[0] + b[9],) + b[1:9] + (b[0] - b[9],) sage: jp = OctonionHermitianEJA.jordan_product sage: ip = OctonionHermitianEJA.trace_inner_product - sage: J = FiniteDimensionalEJA(basis, + sage: J = EJA(basis, ....: jp, ....: ip, ....: field=QQ, @@ -2914,7 +2914,7 @@ class TrivialEJA(RationalBasisEJA, ConcreteEJA): return cls(**kwargs) -class CartesianProductEJA(FiniteDimensionalEJA): +class CartesianProductEJA(EJA): r""" The external (orthogonal) direct sum of two or more Euclidean Jordan algebras. Every Euclidean Jordan algebra decomposes into an @@ -3305,7 +3305,7 @@ class CartesianProductEJA(FiniteDimensionalEJA): Pi = self._module_morphism(lambda j: Ji.monomial(j - offset), codomain=Ji) - return FiniteDimensionalEJAOperator(self,Ji,Pi.matrix()) + return EJAOperator(self,Ji,Pi.matrix()) @cached_method def cartesian_embedding(self, i): @@ -3413,7 +3413,7 @@ class CartesianProductEJA(FiniteDimensionalEJA): Ji = self.cartesian_factor(i) Ei = Ji._module_morphism(lambda j: self.monomial(j + offset), codomain=self) - return FiniteDimensionalEJAOperator(Ji,self,Ei.matrix()) + return EJAOperator(Ji,self,Ei.matrix()) def subalgebra(self, basis, **kwargs): @@ -3442,10 +3442,10 @@ class CartesianProductEJA(FiniteDimensionalEJA): False """ - from mjo.eja.eja_subalgebra import FiniteDimensionalCartesianProductEJASubalgebra - return FiniteDimensionalCartesianProductEJASubalgebra(self, basis, **kwargs) + from mjo.eja.eja_subalgebra import CartesianProductEJASubalgebra + return CartesianProductEJASubalgebra(self, basis, **kwargs) -FiniteDimensionalEJA.CartesianProduct = CartesianProductEJA +EJA.CartesianProduct = CartesianProductEJA class RationalBasisCartesianProductEJA(CartesianProductEJA, RationalBasisEJA): @@ -3455,7 +3455,7 @@ class RationalBasisCartesianProductEJA(CartesianProductEJA, SETUP:: - sage: from mjo.eja.eja_algebra import (FiniteDimensionalEJA, + sage: from mjo.eja.eja_algebra import (EJA, ....: HadamardEJA, ....: JordanSpinEJA, ....: RealSymmetricEJA) @@ -3485,7 +3485,7 @@ class RationalBasisCartesianProductEJA(CartesianProductEJA, sage: jp = lambda X,Y: X*Y sage: ip = lambda X,Y: X[0,0]*Y[0,0] sage: b1 = matrix(QQ, [[1]]) - sage: J2 = FiniteDimensionalEJA((b1,), jp, ip) + sage: J2 = EJA((b1,), jp, ip) sage: cartesian_product([J2,J1]) # factor one not RationalBasisEJA Euclidean Jordan algebra of dimension 1 over Algebraic Real Field (+) Euclidean Jordan algebra of dimension 2 over Algebraic @@ -3564,7 +3564,7 @@ class ComplexSkewSymmetricEJA(RationalBasisEJA, ConcreteEJA): sage: from mjo.eja.eja_algebra import (ComplexSkewSymmetricEJA, ....: QuaternionHermitianEJA) - sage: from mjo.eja.eja_operator import FiniteDimensionalEJAOperator + sage: from mjo.eja.eja_operator import EJAOperator EXAMPLES: @@ -3573,7 +3573,7 @@ class ComplexSkewSymmetricEJA(RationalBasisEJA, ConcreteEJA): sage: J = ComplexSkewSymmetricEJA(2, field=QQ, orthonormalize=False) sage: K = QuaternionHermitianEJA(2, field=QQ, orthonormalize=False) sage: jordan_isom_matrix = matrix.diagonal(QQ,[-1,1,1,1,1,-1]) - sage: phi = FiniteDimensionalEJAOperator(J,K,jordan_isom_matrix) + sage: phi = EJAOperator(J,K,jordan_isom_matrix) sage: all( phi(x*y) == phi(x)*phi(y) ....: for x in J.gens() ....: for y in J.gens() ) diff --git a/mjo/eja/eja_element.py b/mjo/eja/eja_element.py index df14666..8af3b77 100644 --- a/mjo/eja/eja_element.py +++ b/mjo/eja/eja_element.py @@ -3,11 +3,11 @@ from sage.misc.cachefunc import cached_method from sage.modules.free_module import VectorSpace from sage.modules.with_basis.indexed_element import IndexedFreeModuleElement -from mjo.eja.eja_operator import FiniteDimensionalEJAOperator +from mjo.eja.eja_operator import EJAOperator from mjo.eja.eja_utils import _scale -class FiniteDimensionalEJAElement(IndexedFreeModuleElement): +class EJAElement(IndexedFreeModuleElement): """ An element of a Euclidean Jordan algebra. """ @@ -1162,7 +1162,7 @@ class FiniteDimensionalEJAElement(IndexedFreeModuleElement): P = self.parent() left_mult_by_self = lambda y: self*y L = P.module_morphism(function=left_mult_by_self, codomain=P) - return FiniteDimensionalEJAOperator(P, P, L.matrix() ) + return EJAOperator(P, P, L.matrix() ) def quadratic_representation(self, other=None): @@ -1722,7 +1722,7 @@ class FiniteDimensionalEJAElement(IndexedFreeModuleElement): return self.trace_inner_product(self).sqrt() -class CartesianProductParentEJAElement(FiniteDimensionalEJAElement): +class CartesianProductParentEJAElement(EJAElement): r""" An intermediate class for elements that have a Cartesian product as their parent algebra. diff --git a/mjo/eja/eja_operator.py b/mjo/eja/eja_operator.py index a8beed6..689b7ec 100644 --- a/mjo/eja/eja_operator.py +++ b/mjo/eja/eja_operator.py @@ -2,14 +2,14 @@ from sage.matrix.constructor import matrix from sage.categories.all import FreeModules from sage.categories.map import Map -class FiniteDimensionalEJAOperator(Map): +class EJAOperator(Map): r""" An operator between two finite-dimensional Euclidean Jordan algebras. SETUP:: sage: from mjo.eja.eja_algebra import HadamardEJA - sage: from mjo.eja.eja_operator import FiniteDimensionalEJAOperator + sage: from mjo.eja.eja_operator import EJAOperator EXAMPLES: @@ -19,12 +19,12 @@ class FiniteDimensionalEJAOperator(Map): sage: J = HadamardEJA(3) sage: V = VectorSpace(J.base_ring(), 3) sage: M = matrix.identity(J.base_ring(), 3) - sage: FiniteDimensionalEJAOperator(V,J,M) + sage: EJAOperator(V,J,M) Traceback (most recent call last): ... TypeError: domain must be a finite-dimensional Euclidean Jordan algebra - sage: FiniteDimensionalEJAOperator(J,V,M) + sage: EJAOperator(J,V,M) Traceback (most recent call last): ... TypeError: codomain must be a finite-dimensional Euclidean @@ -33,14 +33,14 @@ class FiniteDimensionalEJAOperator(Map): """ def __init__(self, domain_eja, codomain_eja, mat): - from mjo.eja.eja_algebra import FiniteDimensionalEJA + from mjo.eja.eja_algebra import EJA # I guess we should check this, because otherwise you could # pass in pretty much anything algebraish. - if not isinstance(domain_eja, FiniteDimensionalEJA): + if not isinstance(domain_eja, EJA): raise TypeError('domain must be a finite-dimensional ' 'Euclidean Jordan algebra') - if not isinstance(codomain_eja, FiniteDimensionalEJA): + if not isinstance(codomain_eja, EJA): raise TypeError('codomain must be a finite-dimensional ' 'Euclidean Jordan algebra') @@ -76,7 +76,7 @@ class FiniteDimensionalEJAOperator(Map): SETUP:: - sage: from mjo.eja.eja_operator import FiniteDimensionalEJAOperator + sage: from mjo.eja.eja_operator import EJAOperator sage: from mjo.eja.eja_algebra import JordanSpinEJA EXAMPLES:: @@ -84,7 +84,7 @@ class FiniteDimensionalEJAOperator(Map): sage: J = JordanSpinEJA(3) sage: x = J.linear_combination(zip(J.gens(),range(len(J.gens())))) sage: id = identity_matrix(J.base_ring(), J.dimension()) - sage: f = FiniteDimensionalEJAOperator(J,J,id) + sage: f = EJAOperator(J,J,id) sage: f(x) == x True @@ -98,7 +98,7 @@ class FiniteDimensionalEJAOperator(Map): SETUP:: - sage: from mjo.eja.eja_operator import FiniteDimensionalEJAOperator + sage: from mjo.eja.eja_operator import EJAOperator sage: from mjo.eja.eja_algebra import ( ....: JordanSpinEJA, ....: RealSymmetricEJA ) @@ -109,8 +109,8 @@ class FiniteDimensionalEJAOperator(Map): sage: J = RealSymmetricEJA(2) sage: id = identity_matrix(J.base_ring(), J.dimension()) - sage: f = FiniteDimensionalEJAOperator(J,J,id) - sage: g = FiniteDimensionalEJAOperator(J,J,id) + sage: f = EJAOperator(J,J,id) + sage: g = EJAOperator(J,J,id) sage: f + g Linear operator between finite-dimensional Euclidean Jordan algebras represented by the matrix: @@ -127,15 +127,15 @@ class FiniteDimensionalEJAOperator(Map): sage: id1 = identity_matrix(J1.base_ring(), 3) sage: J2 = JordanSpinEJA(3) sage: id2 = identity_matrix(J2.base_ring(), 3) - sage: f = FiniteDimensionalEJAOperator(J1,J1,id1) - sage: g = FiniteDimensionalEJAOperator(J2,J2,id2) + sage: f = EJAOperator(J1,J1,id1) + sage: g = EJAOperator(J2,J2,id2) sage: f + g Traceback (most recent call last): ... TypeError: unsupported operand parent(s) for +: ... """ - return FiniteDimensionalEJAOperator( + return EJAOperator( self.domain(), self.codomain(), self.matrix() + other.matrix()) @@ -148,7 +148,7 @@ class FiniteDimensionalEJAOperator(Map): SETUP:: - sage: from mjo.eja.eja_operator import FiniteDimensionalEJAOperator + sage: from mjo.eja.eja_operator import EJAOperator sage: from mjo.eja.eja_algebra import ( ....: JordanSpinEJA, ....: HadamardEJA, @@ -162,8 +162,8 @@ class FiniteDimensionalEJAOperator(Map): sage: mat1 = matrix(AA, [[1,2,3], ....: [4,5,6]]) sage: mat2 = matrix(AA, [[7,8]]) - sage: g = FiniteDimensionalEJAOperator(J1, J2, mat1) - sage: f = FiniteDimensionalEJAOperator(J2, J3, mat2) + sage: g = EJAOperator(J1, J2, mat1) + sage: f = EJAOperator(J2, J3, mat2) sage: f*g Linear operator between finite-dimensional Euclidean Jordan algebras represented by the matrix: @@ -174,7 +174,7 @@ class FiniteDimensionalEJAOperator(Map): Algebraic Real Field """ - return FiniteDimensionalEJAOperator( + return EJAOperator( other.domain(), self.codomain(), self.matrix()*other.matrix()) @@ -196,14 +196,14 @@ class FiniteDimensionalEJAOperator(Map): SETUP:: - sage: from mjo.eja.eja_operator import FiniteDimensionalEJAOperator + sage: from mjo.eja.eja_operator import EJAOperator sage: from mjo.eja.eja_algebra import RealSymmetricEJA EXAMPLES:: sage: J = RealSymmetricEJA(2) sage: id = identity_matrix(J.base_ring(), J.dimension()) - sage: f = FiniteDimensionalEJAOperator(J,J,id) + sage: f = EJAOperator(J,J,id) sage: ~f Linear operator between finite-dimensional Euclidean Jordan algebras represented by the matrix: @@ -214,7 +214,7 @@ class FiniteDimensionalEJAOperator(Map): Codomain: Euclidean Jordan algebra of dimension 3 over... """ - return FiniteDimensionalEJAOperator( + return EJAOperator( self.codomain(), self.domain(), ~self.matrix()) @@ -231,7 +231,7 @@ class FiniteDimensionalEJAOperator(Map): SETUP:: - sage: from mjo.eja.eja_operator import FiniteDimensionalEJAOperator + sage: from mjo.eja.eja_operator import EJAOperator sage: from mjo.eja.eja_algebra import RealSymmetricEJA EXAMPLES: @@ -261,7 +261,7 @@ class FiniteDimensionalEJAOperator(Map): """ try: if other in self.codomain().base_ring(): - return FiniteDimensionalEJAOperator( + return EJAOperator( self.domain(), self.codomain(), self.matrix()*other) @@ -281,14 +281,14 @@ class FiniteDimensionalEJAOperator(Map): SETUP:: - sage: from mjo.eja.eja_operator import FiniteDimensionalEJAOperator + sage: from mjo.eja.eja_operator import EJAOperator sage: from mjo.eja.eja_algebra import RealSymmetricEJA EXAMPLES:: sage: J = RealSymmetricEJA(2) sage: id = identity_matrix(J.base_ring(), J.dimension()) - sage: f = FiniteDimensionalEJAOperator(J,J,id) + sage: f = EJAOperator(J,J,id) sage: -f Linear operator between finite-dimensional Euclidean Jordan algebras represented by the matrix: @@ -299,7 +299,7 @@ class FiniteDimensionalEJAOperator(Map): Codomain: Euclidean Jordan algebra of dimension 3 over... """ - return FiniteDimensionalEJAOperator( + return EJAOperator( self.domain(), self.codomain(), -self.matrix()) @@ -311,7 +311,7 @@ class FiniteDimensionalEJAOperator(Map): SETUP:: - sage: from mjo.eja.eja_operator import FiniteDimensionalEJAOperator + sage: from mjo.eja.eja_operator import EJAOperator sage: from mjo.eja.eja_algebra import RealSymmetricEJA TESTS: @@ -321,7 +321,7 @@ class FiniteDimensionalEJAOperator(Map): sage: J = RealSymmetricEJA(2) sage: id = identity_matrix(J.base_ring(), J.dimension()) - sage: f = FiniteDimensionalEJAOperator(J,J,id) + sage: f = EJAOperator(J,J,id) sage: f^0 + f^1 + f^2 Linear operator between finite-dimensional Euclidean Jordan algebras represented by the matrix: @@ -343,7 +343,7 @@ class FiniteDimensionalEJAOperator(Map): else: mat = self.matrix()**n - return FiniteDimensionalEJAOperator( + return EJAOperator( self.domain(), self.codomain(), mat) @@ -357,14 +357,14 @@ class FiniteDimensionalEJAOperator(Map): SETUP:: - sage: from mjo.eja.eja_operator import FiniteDimensionalEJAOperator + sage: from mjo.eja.eja_operator import EJAOperator sage: from mjo.eja.eja_algebra import JordanSpinEJA EXAMPLES:: sage: J = JordanSpinEJA(2) sage: id = identity_matrix(J.base_ring(), J.dimension()) - sage: FiniteDimensionalEJAOperator(J,J,id) + sage: EJAOperator(J,J,id) Linear operator between finite-dimensional Euclidean Jordan algebras represented by the matrix: [1 0] @@ -391,14 +391,14 @@ class FiniteDimensionalEJAOperator(Map): SETUP:: - sage: from mjo.eja.eja_operator import FiniteDimensionalEJAOperator + sage: from mjo.eja.eja_operator import EJAOperator sage: from mjo.eja.eja_algebra import RealSymmetricEJA EXAMPLES:: sage: J = RealSymmetricEJA(2) sage: id = identity_matrix(J.base_ring(),J.dimension()) - sage: f = FiniteDimensionalEJAOperator(J,J,id) + sage: f = EJAOperator(J,J,id) sage: f - (f*2) Linear operator between finite-dimensional Euclidean Jordan algebras represented by the matrix: @@ -442,7 +442,7 @@ class FiniteDimensionalEJAOperator(Map): SETUP:: - sage: from mjo.eja.eja_operator import FiniteDimensionalEJAOperator + sage: from mjo.eja.eja_operator import EJAOperator sage: from mjo.eja.eja_algebra import (random_eja, ....: JordanSpinEJA, ....: RealSymmetricEJA) @@ -455,13 +455,13 @@ class FiniteDimensionalEJAOperator(Map): sage: M = matrix(R, [ [0, 0], ....: [0, 0], ....: [0, 0] ]) - sage: L = FiniteDimensionalEJAOperator(J1,J2,M) + sage: L = EJAOperator(J1,J2,M) sage: L.is_zero() True sage: M = matrix(R, [ [0, 0], ....: [0, 1], ....: [0, 0] ]) - sage: L = FiniteDimensionalEJAOperator(J1,J2,M) + sage: L = EJAOperator(J1,J2,M) sage: L.is_zero() False @@ -579,14 +579,14 @@ class FiniteDimensionalEJAOperator(Map): SETUP:: - sage: from mjo.eja.eja_operator import FiniteDimensionalEJAOperator + sage: from mjo.eja.eja_operator import EJAOperator sage: from mjo.eja.eja_algebra import RealSymmetricEJA EXAMPLES:: sage: J = RealSymmetricEJA(2) sage: mat = matrix(J.base_ring(), J.dimension(), range(9)) - sage: f = FiniteDimensionalEJAOperator(J,J,mat) + sage: f = EJAOperator(J,J,mat) sage: f.matrix() [0 1 2] [3 4 5] @@ -603,7 +603,7 @@ class FiniteDimensionalEJAOperator(Map): SETUP:: - sage: from mjo.eja.eja_operator import FiniteDimensionalEJAOperator + sage: from mjo.eja.eja_operator import EJAOperator sage: from mjo.eja.eja_algebra import RealSymmetricEJA EXAMPLES:: @@ -668,7 +668,7 @@ class FiniteDimensionalEJAOperator(Map): # for the spectral theorem to work. us[i] = us[i]/us[i].norm() mat = us[i].column()*us[i].row() - Pi = FiniteDimensionalEJAOperator( + Pi = EJAOperator( self.domain(), self.codomain(), mat) diff --git a/mjo/eja/eja_subalgebra.py b/mjo/eja/eja_subalgebra.py index c9abada..97a7978 100644 --- a/mjo/eja/eja_subalgebra.py +++ b/mjo/eja/eja_subalgebra.py @@ -1,11 +1,11 @@ from sage.matrix.constructor import matrix from sage.misc.cachefunc import cached_method -from mjo.eja.eja_algebra import FiniteDimensionalEJA -from mjo.eja.eja_element import (FiniteDimensionalEJAElement, +from mjo.eja.eja_algebra import EJA +from mjo.eja.eja_element import (EJAElement, CartesianProductParentEJAElement) -class FiniteDimensionalEJASubalgebraElement(FiniteDimensionalEJAElement): +class EJASubalgebraElement(EJAElement): """ SETUP:: @@ -88,7 +88,7 @@ class FiniteDimensionalEJASubalgebraElement(FiniteDimensionalEJAElement): -class FiniteDimensionalEJASubalgebra(FiniteDimensionalEJA): +class EJASubalgebra(EJA): """ A subalgebra of an EJA with a given basis. @@ -97,7 +97,7 @@ class FiniteDimensionalEJASubalgebra(FiniteDimensionalEJA): sage: from mjo.eja.eja_algebra import (ComplexHermitianEJA, ....: JordanSpinEJA, ....: RealSymmetricEJA) - sage: from mjo.eja.eja_subalgebra import FiniteDimensionalEJASubalgebra + sage: from mjo.eja.eja_subalgebra import EJASubalgebra EXAMPLES: @@ -109,11 +109,11 @@ class FiniteDimensionalEJASubalgebra(FiniteDimensionalEJA): ....: [0,0] ]) sage: E22 = matrix(AA, [ [0,0], ....: [0,1] ]) - sage: K1 = FiniteDimensionalEJASubalgebra(J, (J(E11),), associative=True) + sage: K1 = EJASubalgebra(J, (J(E11),), associative=True) sage: K1.one().to_matrix() [1 0] [0 0] - sage: K2 = FiniteDimensionalEJASubalgebra(J, (J(E22),), associative=True) + sage: K2 = EJASubalgebra(J, (J(E22),), associative=True) sage: K2.one().to_matrix() [0 0] [0 1] @@ -185,7 +185,7 @@ class FiniteDimensionalEJASubalgebra(FiniteDimensionalEJA): SETUP:: sage: from mjo.eja.eja_algebra import RealSymmetricEJA - sage: from mjo.eja.eja_subalgebra import FiniteDimensionalEJASubalgebra + sage: from mjo.eja.eja_subalgebra import EJASubalgebra EXAMPLES:: @@ -195,7 +195,7 @@ class FiniteDimensionalEJASubalgebra(FiniteDimensionalEJA): ....: [1,0,0] ]) sage: x = J(X) sage: basis = ( x, x^2 ) # x^2 is the identity matrix - sage: K = FiniteDimensionalEJASubalgebra(J, + sage: K = EJASubalgebra(J, ....: basis, ....: associative=True, ....: orthonormalize=False) @@ -256,25 +256,26 @@ class FiniteDimensionalEJASubalgebra(FiniteDimensionalEJA): True """ - from mjo.eja.eja_operator import FiniteDimensionalEJAOperator + from mjo.eja.eja_operator import EJAOperator mm = self._module_morphism(lambda j: self.superalgebra()(self.monomial(j).to_matrix()), codomain=self.superalgebra()) - return FiniteDimensionalEJAOperator(self, + return EJAOperator(self, self.superalgebra(), mm.matrix()) - Element = FiniteDimensionalEJASubalgebraElement + Element = EJASubalgebraElement -class FiniteDimensionalCartesianProductEJASubalgebraElement(FiniteDimensionalEJASubalgebraElement, CartesianProductParentEJAElement): +class CartesianProductEJASubalgebraElement(EJASubalgebraElement, + CartesianProductParentEJAElement): r""" The class for elements that both belong to a subalgebra and have a Cartesian product algebra as their parent. By inheriting :class:`CartesianProductParentEJAElement` in addition to - :class:`FiniteDimensionalEJASubalgebraElement`, we allow the + :class:`EJASubalgebraElement`, we allow the ``to_matrix()`` method to be overridden with the version that works on Cartesian products. @@ -297,10 +298,10 @@ class FiniteDimensionalCartesianProductEJASubalgebraElement(FiniteDimensionalEJA """ pass -class FiniteDimensionalCartesianProductEJASubalgebra(FiniteDimensionalEJASubalgebra): +class CartesianProductEJASubalgebra(EJASubalgebra): r""" Subalgebras whose parents are Cartesian products. Exists only to specify a special element class that will (in addition) inherit from ``CartesianProductParentEJAElement``. """ - Element = FiniteDimensionalCartesianProductEJASubalgebraElement + Element = CartesianProductEJASubalgebraElement -- 2.44.2