SETUP::
sage: from mjo.eja.eja_algebra import (JordanSpinEJA,
- ....: RealCartesianProductEJA,
+ ....: HadamardEJA,
....: RealSymmetricEJA)
EXAMPLES:
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
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
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.
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
We can change the generator prefix::
- sage: RealCartesianProductEJA(3, prefix='r').gens()
+ sage: HadamardEJA(3, prefix='r').gens()
(r0, r1, r2)
"""
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):
SETUP::
- sage: from mjo.eja.eja_algebra import RealCartesianProductEJA
+ sage: from mjo.eja.eja_algebra import HadamardEJA
TESTS:
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()
SETUP::
- sage: from mjo.eja.eja_algebra import (RealCartesianProductEJA,
+ sage: from mjo.eja.eja_algebra import (HadamardEJA,
....: random_eja)
EXAMPLES::
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
SETUP::
- sage: from mjo.eja.eja_algebra import RealCartesianProductEJA
+ sage: from mjo.eja.eja_algebra import HadamardEJA
EXAMPLES:
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
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
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()
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)
SETUP::
sage: from mjo.eja.eja_algebra import (JordanSpinEJA,
- ....: RealCartesianProductEJA,
+ ....: HadamardEJA,
....: TrivialEJA,
....: random_eja)
::
- sage: J = RealCartesianProductEJA(5)
+ sage: J = HadamardEJA(5)
sage: J.one().trace()
5
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)
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())
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]])