From 208bc5d64bd206684e59f757d932768552e9f7ba Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Tue, 6 Aug 2019 19:00:57 -0400 Subject: [PATCH] eja: use "dimension" instead of "degree" in EJA string representation. --- mjo/eja/eja_algebra.py | 9 +++---- mjo/eja/eja_operator.py | 54 +++++++++++++++++++++++++++-------------- 2 files changed, 40 insertions(+), 23 deletions(-) diff --git a/mjo/eja/eja_algebra.py b/mjo/eja/eja_algebra.py index 8c66de6..a9bb6c7 100644 --- a/mjo/eja/eja_algebra.py +++ b/mjo/eja/eja_algebra.py @@ -159,13 +159,12 @@ class FiniteDimensionalEuclideanJordanAlgebra(CombinatorialFreeModule): Ensure that it says what we think it says:: sage: JordanSpinEJA(2, field=QQ) - Euclidean Jordan algebra of degree 2 over Rational Field + Euclidean Jordan algebra of dimension 2 over Rational Field sage: JordanSpinEJA(3, field=RDF) - Euclidean Jordan algebra of degree 3 over Real Double Field + Euclidean Jordan algebra of dimension 3 over Real Double Field """ - # TODO: change this to say "dimension" and fix all the tests. - fmt = "Euclidean Jordan algebra of degree {} over {}" + fmt = "Euclidean Jordan algebra of dimension {} over {}" return fmt.format(self.dimension(), self.base_ring()) def product_on_basis(self, i, j): @@ -696,7 +695,7 @@ def random_eja(): TESTS:: sage: random_eja() - Euclidean Jordan algebra of degree... + Euclidean Jordan algebra of dimension... """ diff --git a/mjo/eja/eja_operator.py b/mjo/eja/eja_operator.py index 8973a95..7c3b2a6 100644 --- a/mjo/eja/eja_operator.py +++ b/mjo/eja/eja_operator.py @@ -81,8 +81,10 @@ class FiniteDimensionalEuclideanJordanAlgebraOperator(Map): [2 0 0] [0 2 0] [0 0 2] - Domain: Euclidean Jordan algebra of degree 3 over Rational Field - Codomain: Euclidean Jordan algebra of degree 3 over Rational Field + Domain: Euclidean Jordan algebra of dimension 3 over + Rational Field + Codomain: Euclidean Jordan algebra of dimension 3 over + Rational Field If you try to add two identical vector space operators but on different EJAs, that should blow up:: @@ -135,8 +137,10 @@ class FiniteDimensionalEuclideanJordanAlgebraOperator(Map): Linear operator between finite-dimensional Euclidean Jordan algebras represented by the matrix: [39 54 69] - Domain: Euclidean Jordan algebra of degree 3 over Rational Field - Codomain: Euclidean Jordan algebra of degree 1 over Rational Field + Domain: Euclidean Jordan algebra of dimension 3 over + Rational Field + Codomain: Euclidean Jordan algebra of dimension 1 over + Rational Field """ return FiniteDimensionalEuclideanJordanAlgebraOperator( @@ -175,8 +179,10 @@ class FiniteDimensionalEuclideanJordanAlgebraOperator(Map): [1 0 0] [0 1 0] [0 0 1] - Domain: Euclidean Jordan algebra of degree 3 over Rational Field - Codomain: Euclidean Jordan algebra of degree 3 over Rational Field + Domain: Euclidean Jordan algebra of dimension 3 over + Rational Field + Codomain: Euclidean Jordan algebra of dimension 3 over + Rational Field """ return FiniteDimensionalEuclideanJordanAlgebraOperator( @@ -212,16 +218,20 @@ class FiniteDimensionalEuclideanJordanAlgebraOperator(Map): [ 2 4 0] [ 2 9 2] [ 0 4 16] - Domain: Euclidean Jordan algebra of degree 3 over Rational Field - Codomain: Euclidean Jordan algebra of degree 3 over Rational Field + Domain: Euclidean Jordan algebra of dimension 3 over + Rational Field + Codomain: Euclidean Jordan algebra of dimension 3 over + Rational Field sage: x.operator()*(1/2) Linear operator between finite-dimensional Euclidean Jordan algebras represented by the matrix: [ 1 2 0] [ 1 9/2 1] [ 0 2 8] - Domain: Euclidean Jordan algebra of degree 3 over Rational Field - Codomain: Euclidean Jordan algebra of degree 3 over Rational Field + Domain: Euclidean Jordan algebra of dimension 3 over + Rational Field + Codomain: Euclidean Jordan algebra of dimension 3 over + Rational Field """ if other in self.codomain().base_ring(): @@ -256,8 +266,10 @@ class FiniteDimensionalEuclideanJordanAlgebraOperator(Map): [-1 0 0] [ 0 -1 0] [ 0 0 -1] - Domain: Euclidean Jordan algebra of degree 3 over Rational Field - Codomain: Euclidean Jordan algebra of degree 3 over Rational Field + Domain: Euclidean Jordan algebra of dimension 3 over + Rational Field + Codomain: Euclidean Jordan algebra of dimension 3 over + Rational Field """ return FiniteDimensionalEuclideanJordanAlgebraOperator( @@ -289,8 +301,10 @@ class FiniteDimensionalEuclideanJordanAlgebraOperator(Map): [3 0 0] [0 3 0] [0 0 3] - Domain: Euclidean Jordan algebra of degree 3 over Rational Field - Codomain: Euclidean Jordan algebra of degree 3 over Rational Field + Domain: Euclidean Jordan algebra of dimension 3 over + Rational Field + Codomain: Euclidean Jordan algebra of dimension 3 over + Rational Field """ if (n == 1): @@ -330,8 +344,10 @@ class FiniteDimensionalEuclideanJordanAlgebraOperator(Map): algebras represented by the matrix: [1 0] [0 1] - Domain: Euclidean Jordan algebra of degree 2 over Rational Field - Codomain: Euclidean Jordan algebra of degree 2 over Rational Field + Domain: Euclidean Jordan algebra of dimension 2 over + Rational Field + Codomain: Euclidean Jordan algebra of dimension 2 over + Rational Field """ msg = ("Linear operator between finite-dimensional Euclidean Jordan " @@ -364,8 +380,10 @@ class FiniteDimensionalEuclideanJordanAlgebraOperator(Map): [-1 0 0] [ 0 -1 0] [ 0 0 -1] - Domain: Euclidean Jordan algebra of degree 3 over Rational Field - Codomain: Euclidean Jordan algebra of degree 3 over Rational Field + Domain: Euclidean Jordan algebra of dimension 3 over + Rational Field + Codomain: Euclidean Jordan algebra of dimension 3 over + Rational Field """ return (self + (-other)) -- 2.44.2