Finite family {0: e0, 1: e1, 2: e2}
sage: J.natural_basis()
(
- [1 0] [0 1] [0 0]
- [0 0], [1 0], [0 1]
+ [1 0] [ 0 1/2*sqrt2] [0 0]
+ [0 0], [1/2*sqrt2 0], [0 1]
)
::
sage: J = RealSymmetricEJA(2)
sage: J.vector_space()
- Vector space of dimension 3 over Rational Field
+ Vector space of dimension 3 over...
"""
return self.zero().to_vector().parent().ambient_vector_space()
if i == j:
Sij = Eij
else:
- # Beware, orthogonal but not normalized!
Sij = Eij + Eij.transpose()
+ # Now normalize it.
+ Sij = Sij / _real_symmetric_matrix_ip(Sij,Sij).sqrt()
S.append(Sij)
return tuple(S)
Y_mat = Y.natural_representation()
return (X_mat*Y_mat).trace()
+def _real_symmetric_matrix_ip(X,Y):
+ return (X*Y).trace()
+
class RealSymmetricEJA(FiniteDimensionalEuclideanJordanAlgebra):
"""
sage: e0*e0
e0
sage: e1*e1
- e0 + e2
+ 1/2*e0 + 1/2*e2
sage: e2*e2
e2
sage: (x*y).inner_product(z) == y.inner_product(x*z)
True
+ Our basis is normalized with respect to the natural inner product::
+
+ sage: set_random_seed()
+ sage: n = ZZ.random_element(1,5)
+ sage: J = RealSymmetricEJA(n)
+ sage: all( b.norm() == 1 for b in J.gens() )
+ True
+
+ Left-multiplication operators are symmetric because they satisfy
+ the Jordan axiom::
+
+ sage: set_random_seed()
+ sage: n = ZZ.random_element(1,5)
+ sage: x = RealSymmetricEJA(n).random_element()
+ sage: x.operator().matrix().is_symmetric()
+ True
+
"""
def __init__(self, n, field=QQ, **kwargs):
+ if n > 1 and field is QQ:
+ # We'll need sqrt(2) to normalize the basis, and this
+ # winds up in the multiplication table, so the whole
+ # algebra needs to be over the field extension.
+ field = QuadraticField(2, 'sqrt2')
+
S = _real_symmetric_basis(n, field)
Qs = _multiplication_table_from_matrix_basis(S)
**kwargs)
def inner_product(self, x, y):
- return _matrix_ip(x,y)
+ X = x.natural_representation()
+ Y = y.natural_representation()
+ return _real_symmetric_matrix_ip(X,Y)
class ComplexHermitianEJA(FiniteDimensionalEuclideanJordanAlgebra):
Property 2 (multiply on the right for :trac:`28272`):
- sage: alpha = QQ.random_element()
+ sage: alpha = J.base_ring().random_element()
sage: (alpha*x).quadratic_representation() == Qx*(alpha^2)
True
sage: set_random_seed()
sage: A = random_eja().zero().subalgebra_generated_by()
sage: A
- Euclidean Jordan algebra of dimension 0 over Rational Field
+ Euclidean Jordan algebra of dimension 0 over...
sage: A.one()
0
sage: x = J.random_element()
sage: y = J.random_element()
sage: z = J.random_element()
- sage: a = QQ.random_element();
+ sage: a = J.base_ring().random_element();
sage: actual = (a*(x+z)).trace_inner_product(y)
sage: expected = ( a*x.trace_inner_product(y) +
....: a*z.trace_inner_product(y) )
[2 0 0]
[0 2 0]
[0 0 2]
- Domain: Euclidean Jordan algebra of dimension 3 over
- Rational Field
- Codomain: Euclidean Jordan algebra of dimension 3 over
- Rational Field
+ Domain: Euclidean Jordan algebra of dimension 3 over...
+ Codomain: Euclidean Jordan algebra of dimension 3 over...
If you try to add two identical vector space operators but on
different EJAs, that should blow up::
[1 0 0]
[0 1 0]
[0 0 1]
- Domain: Euclidean Jordan algebra of dimension 3 over
- Rational Field
- Codomain: Euclidean Jordan algebra of dimension 3 over
- Rational Field
+ Domain: Euclidean Jordan algebra of dimension 3 over...
+ Codomain: Euclidean Jordan algebra of dimension 3 over...
"""
return FiniteDimensionalEuclideanJordanAlgebraOperator(
sage: x.operator()
Linear operator between finite-dimensional Euclidean Jordan algebras
represented by the matrix:
- [ 2 4 0]
+ [ 2 2 0]
[ 2 9 2]
- [ 0 4 16]
- Domain: Euclidean Jordan algebra of dimension 3 over
- Rational Field
- Codomain: Euclidean Jordan algebra of dimension 3 over
- Rational Field
+ [ 0 2 16]
+ Domain: Euclidean Jordan algebra of dimension 3 over...
+ Codomain: Euclidean Jordan algebra of dimension 3 over...
sage: x.operator()*(1/2)
Linear operator between finite-dimensional Euclidean Jordan algebras
represented by the matrix:
- [ 1 2 0]
+ [ 1 1 0]
[ 1 9/2 1]
- [ 0 2 8]
- Domain: Euclidean Jordan algebra of dimension 3 over
- Rational Field
- Codomain: Euclidean Jordan algebra of dimension 3 over
- Rational Field
+ [ 0 1 8]
+ Domain: Euclidean Jordan algebra of dimension 3 over...
+ Codomain: Euclidean Jordan algebra of dimension 3 over...
"""
- if other in self.codomain().base_ring():
- return FiniteDimensionalEuclideanJordanAlgebraOperator(
- self.domain(),
- self.codomain(),
- self.matrix()*other)
+ try:
+ if other in self.codomain().base_ring():
+ return FiniteDimensionalEuclideanJordanAlgebraOperator(
+ self.domain(),
+ self.codomain(),
+ self.matrix()*other)
+ except NotImplementedError:
+ # This can happen with certain arguments if the base_ring()
+ # is weird and doesn't know how to test membership.
+ pass
# This should eventually delegate to _composition_ after performing
# some sanity checks for us.
[-1 0 0]
[ 0 -1 0]
[ 0 0 -1]
- Domain: Euclidean Jordan algebra of dimension 3 over
- Rational Field
- Codomain: Euclidean Jordan algebra of dimension 3 over
- Rational Field
+ Domain: Euclidean Jordan algebra of dimension 3 over...
+ Codomain: Euclidean Jordan algebra of dimension 3 over...
"""
return FiniteDimensionalEuclideanJordanAlgebraOperator(
[3 0 0]
[0 3 0]
[0 0 3]
- Domain: Euclidean Jordan algebra of dimension 3 over
- Rational Field
- Codomain: Euclidean Jordan algebra of dimension 3 over
- Rational Field
+ Domain: Euclidean Jordan algebra of dimension 3 over...
+ Codomain: Euclidean Jordan algebra of dimension 3 over...
"""
if (n == 1):
[-1 0 0]
[ 0 -1 0]
[ 0 0 -1]
- Domain: Euclidean Jordan algebra of dimension 3 over
- Rational Field
- Codomain: Euclidean Jordan algebra of dimension 3 over
- Rational Field
+ Domain: Euclidean Jordan algebra of dimension 3 over...
+ Codomain: Euclidean Jordan algebra of dimension 3 over...
"""
return (self + (-other))
EXAMPLES::
sage: J = RealSymmetricEJA(3)
- sage: x = sum( i*J.gens()[i] for i in range(6) )
+ sage: x = J.monomial(0) + 2*J.monomial(2) + 5*J.monomial(5)
sage: K = FiniteDimensionalEuclideanJordanElementSubalgebra(x)
sage: K.vector_space()
- Vector space of degree 6 and dimension 3 over Rational Field
+ Vector space of degree 6 and dimension 3 over...
User basis matrix:
[ 1 0 1 0 0 1]
- [ 0 1 2 3 4 5]
- [10 14 21 19 31 50]
+ [ 1 0 2 0 0 5]
+ [ 1 0 4 0 0 25]
sage: (x^0).to_vector()
(1, 0, 1, 0, 0, 1)
sage: (x^1).to_vector()
- (0, 1, 2, 3, 4, 5)
+ (1, 0, 2, 0, 0, 5)
sage: (x^2).to_vector()
- (10, 14, 21, 19, 31, 50)
+ (1, 0, 4, 0, 0, 25)
"""
return self._vector_space