From 99ca9f8c24194ad6be7b8e325575e58b53429c2b Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Fri, 27 Dec 2019 10:09:55 -0500 Subject: [PATCH] eja: rename RealCartesianProductEJA -> HadamardEJA. --- mjo/eja/eja_algebra.py | 23 +++++++++++------------ mjo/eja/eja_element.py | 26 +++++++++++++------------- mjo/eja/eja_element_subalgebra.py | 4 ++-- mjo/eja/eja_operator.py | 4 ++-- 4 files changed, 28 insertions(+), 29 deletions(-) diff --git a/mjo/eja/eja_algebra.py b/mjo/eja/eja_algebra.py index d31b5b7..166ed1e 100644 --- a/mjo/eja/eja_algebra.py +++ b/mjo/eja/eja_algebra.py @@ -111,7 +111,7 @@ class FiniteDimensionalEuclideanJordanAlgebra(CombinatorialFreeModule): SETUP:: sage: from mjo.eja.eja_algebra import (JordanSpinEJA, - ....: RealCartesianProductEJA, + ....: HadamardEJA, ....: RealSymmetricEJA) EXAMPLES: @@ -139,7 +139,7 @@ class FiniteDimensionalEuclideanJordanAlgebra(CombinatorialFreeModule): vector representations) back and forth faithfully:: sage: set_random_seed() - sage: J = RealCartesianProductEJA.random_instance() + sage: J = HadamardEJA.random_instance() sage: x = J.random_element() sage: J(x.to_vector().column()) == x True @@ -582,12 +582,12 @@ class FiniteDimensionalEuclideanJordanAlgebra(CombinatorialFreeModule): SETUP:: - sage: from mjo.eja.eja_algebra import (RealCartesianProductEJA, + sage: from mjo.eja.eja_algebra import (HadamardEJA, ....: random_eja) EXAMPLES:: - sage: J = RealCartesianProductEJA(5) + sage: J = HadamardEJA(5) sage: J.one() e0 + e1 + e2 + e3 + e4 @@ -903,8 +903,7 @@ class KnownRankEJA(object): return cls(n, field, **kwargs) -class RealCartesianProductEJA(FiniteDimensionalEuclideanJordanAlgebra, - KnownRankEJA): +class HadamardEJA(FiniteDimensionalEuclideanJordanAlgebra, KnownRankEJA): """ Return the Euclidean Jordan Algebra corresponding to the set `R^n` under the Hadamard product. @@ -915,13 +914,13 @@ class RealCartesianProductEJA(FiniteDimensionalEuclideanJordanAlgebra, SETUP:: - sage: from mjo.eja.eja_algebra import RealCartesianProductEJA + sage: from mjo.eja.eja_algebra import HadamardEJA EXAMPLES: This multiplication table can be verified by hand:: - sage: J = RealCartesianProductEJA(3) + sage: J = HadamardEJA(3) sage: e0,e1,e2 = J.gens() sage: e0*e0 e0 @@ -940,7 +939,7 @@ class RealCartesianProductEJA(FiniteDimensionalEuclideanJordanAlgebra, We can change the generator prefix:: - sage: RealCartesianProductEJA(3, prefix='r').gens() + sage: HadamardEJA(3, prefix='r').gens() (r0, r1, r2) """ @@ -949,7 +948,7 @@ class RealCartesianProductEJA(FiniteDimensionalEuclideanJordanAlgebra, mult_table = [ [ V.gen(i)*(i == j) for j in range(n) ] for i in range(n) ] - fdeja = super(RealCartesianProductEJA, self) + fdeja = super(HadamardEJA, self) return fdeja.__init__(field, mult_table, rank=n, **kwargs) def inner_product(self, x, y): @@ -958,7 +957,7 @@ class RealCartesianProductEJA(FiniteDimensionalEuclideanJordanAlgebra, SETUP:: - sage: from mjo.eja.eja_algebra import RealCartesianProductEJA + sage: from mjo.eja.eja_algebra import HadamardEJA TESTS: @@ -966,7 +965,7 @@ class RealCartesianProductEJA(FiniteDimensionalEuclideanJordanAlgebra, over `R^n`:: sage: set_random_seed() - sage: J = RealCartesianProductEJA.random_instance() + sage: J = HadamardEJA.random_instance() sage: x,y = J.random_elements(2) sage: X = x.natural_representation() sage: Y = y.natural_representation() diff --git a/mjo/eja/eja_element.py b/mjo/eja/eja_element.py index f78af25..7c4c79d 100644 --- a/mjo/eja/eja_element.py +++ b/mjo/eja/eja_element.py @@ -96,7 +96,7 @@ class FiniteDimensionalEuclideanJordanAlgebraElement(IndexedFreeModuleElement): SETUP:: - sage: from mjo.eja.eja_algebra import (RealCartesianProductEJA, + sage: from mjo.eja.eja_algebra import (HadamardEJA, ....: random_eja) EXAMPLES:: @@ -104,7 +104,7 @@ class FiniteDimensionalEuclideanJordanAlgebraElement(IndexedFreeModuleElement): sage: R = PolynomialRing(QQ, 't') sage: t = R.gen(0) sage: p = t^4 - t^3 + 5*t - 2 - sage: J = RealCartesianProductEJA(5) + sage: J = HadamardEJA(5) sage: J.one().apply_univariate_polynomial(p) == 3*J.one() True @@ -137,7 +137,7 @@ class FiniteDimensionalEuclideanJordanAlgebraElement(IndexedFreeModuleElement): SETUP:: - sage: from mjo.eja.eja_algebra import RealCartesianProductEJA + sage: from mjo.eja.eja_algebra import HadamardEJA EXAMPLES: @@ -145,14 +145,14 @@ class FiniteDimensionalEuclideanJordanAlgebraElement(IndexedFreeModuleElement): the identity element is `(t-1)` from which it follows that the characteristic polynomial should be `(t-1)^3`:: - sage: J = RealCartesianProductEJA(3) + sage: J = HadamardEJA(3) sage: J.one().characteristic_polynomial() t^3 - 3*t^2 + 3*t - 1 Likewise, the characteristic of the zero element in the rank-three algebra `R^{n}` should be `t^{3}`:: - sage: J = RealCartesianProductEJA(3) + sage: J = HadamardEJA(3) sage: J.zero().characteristic_polynomial() t^3 @@ -162,7 +162,7 @@ class FiniteDimensionalEuclideanJordanAlgebraElement(IndexedFreeModuleElement): to zero on that element:: sage: set_random_seed() - sage: x = RealCartesianProductEJA(3).random_element() + sage: x = HadamardEJA(3).random_element() sage: p = x.characteristic_polynomial() sage: x.apply_univariate_polynomial(p) 0 @@ -170,7 +170,7 @@ class FiniteDimensionalEuclideanJordanAlgebraElement(IndexedFreeModuleElement): The characteristic polynomials of the zero and unit elements should be what we think they are in a subalgebra, too:: - sage: J = RealCartesianProductEJA(3) + sage: J = HadamardEJA(3) sage: p1 = J.one().characteristic_polynomial() sage: q1 = J.zero().characteristic_polynomial() sage: e0,e1,e2 = J.gens() @@ -996,11 +996,11 @@ class FiniteDimensionalEuclideanJordanAlgebraElement(IndexedFreeModuleElement): SETUP:: sage: from mjo.eja.eja_algebra import (JordanSpinEJA, - ....: RealCartesianProductEJA) + ....: HadamardEJA) EXAMPLES:: - sage: J = RealCartesianProductEJA(2) + sage: J = HadamardEJA(2) sage: x = sum(J.gens()) sage: x.norm() sqrt(2) @@ -1350,7 +1350,7 @@ class FiniteDimensionalEuclideanJordanAlgebraElement(IndexedFreeModuleElement): SETUP:: sage: from mjo.eja.eja_algebra import (JordanSpinEJA, - ....: RealCartesianProductEJA, + ....: HadamardEJA, ....: TrivialEJA, ....: random_eja) @@ -1368,7 +1368,7 @@ class FiniteDimensionalEuclideanJordanAlgebraElement(IndexedFreeModuleElement): :: - sage: J = RealCartesianProductEJA(5) + sage: J = HadamardEJA(5) sage: J.one().trace() 5 @@ -1446,11 +1446,11 @@ class FiniteDimensionalEuclideanJordanAlgebraElement(IndexedFreeModuleElement): SETUP:: sage: from mjo.eja.eja_algebra import (JordanSpinEJA, - ....: RealCartesianProductEJA) + ....: HadamardEJA) EXAMPLES:: - sage: J = RealCartesianProductEJA(2) + sage: J = HadamardEJA(2) sage: x = sum(J.gens()) sage: x.trace_norm() sqrt(2) diff --git a/mjo/eja/eja_element_subalgebra.py b/mjo/eja/eja_element_subalgebra.py index c058613..292871a 100644 --- a/mjo/eja/eja_element_subalgebra.py +++ b/mjo/eja/eja_element_subalgebra.py @@ -100,12 +100,12 @@ class FiniteDimensionalEuclideanJordanElementSubalgebra(FiniteDimensionalEuclide SETUP:: - sage: from mjo.eja.eja_algebra import (RealCartesianProductEJA, + sage: from mjo.eja.eja_algebra import (HadamardEJA, ....: random_eja) EXAMPLES:: - sage: J = RealCartesianProductEJA(5) + sage: J = HadamardEJA(5) sage: J.one() e0 + e1 + e2 + e3 + e4 sage: x = sum(J.gens()) diff --git a/mjo/eja/eja_operator.py b/mjo/eja/eja_operator.py index 030b94f..ee33dbf 100644 --- a/mjo/eja/eja_operator.py +++ b/mjo/eja/eja_operator.py @@ -117,13 +117,13 @@ class FiniteDimensionalEuclideanJordanAlgebraOperator(Map): sage: from mjo.eja.eja_operator import FiniteDimensionalEuclideanJordanAlgebraOperator sage: from mjo.eja.eja_algebra import ( ....: JordanSpinEJA, - ....: RealCartesianProductEJA, + ....: HadamardEJA, ....: RealSymmetricEJA) EXAMPLES:: sage: J1 = JordanSpinEJA(3) - sage: J2 = RealCartesianProductEJA(2) + sage: J2 = HadamardEJA(2) sage: J3 = RealSymmetricEJA(1) sage: mat1 = matrix(QQ, [[1,2,3], ....: [4,5,6]]) -- 2.44.2