TESTS:
- Ensure that this is one-half of the trace inner-product::
+ Ensure that this is one-half of the trace inner-product when
+ the algebra isn't just the reals (when ``n`` isn't one). This
+ is in Faraut and Koranyi, and also my "On the symmetry..."
+ paper::
sage: set_random_seed()
- sage: n = ZZ.random_element(5)
- sage: M = matrix.random(QQ, n-1, algorithm='unimodular')
+ sage: n = ZZ.random_element(2,5)
+ sage: M = matrix.random(QQ, max(0,n-1), algorithm='unimodular')
sage: B = M.transpose()*M
sage: J = BilinearFormEJA(n, B=B)
- sage: eis = VectorSpace(M.base_ring(), M.ncols()).basis()
- sage: V = J.vector_space()
- sage: sis = [ J.from_vector(V([0] + (M.inverse()*ei).list()))
- ....: for ei in eis ]
- sage: actual = [ sis[i]*sis[j]
- ....: for i in range(n-1)
- ....: for j in range(n-1) ]
- sage: expected = [ J.one() if i == j else J.zero()
- ....: for i in range(n-1)
- ....: for j in range(n-1) ]
+ sage: x = J.random_element()
+ sage: y = J.random_element()
+ sage: x.inner_product(y) == (x*y).trace()/2
+ True
"""
xvec = x.to_vector()
ybar = yvec[1:]
return x[0]*y[0] + (self._B*xbar).inner_product(ybar)
+
class JordanSpinEJA(FiniteDimensionalEuclideanJordanAlgebra, KnownRankEJA):
"""
The rank-2 simple EJA consisting of real vectors ``x=(x0, x_bar)``