+ The rank-n simple EJA consisting of complex Hermitian n-by-n
+ matrices over the real numbers, the usual symmetric Jordan product,
+ and the real-part-of-trace inner product. It has dimension `n^2 over
+ the reals.
+ """
+ F = QuadraticField(-1, 'i')
+ i = F.gen()
+ S = _real_symmetric_basis(n, field=F)
+ T = []
+ for s in S:
+ T.append(s)
+ T.append(i*s)
+ embed_T = [ _embed_complex_matrix(t) for t in T ]
+ Qs = _multiplication_table_from_matrix_basis(embed_T)
+ return FiniteDimensionalEuclideanJordanAlgebra(field, Qs, rank=n)
+
+def QuaternionHermitianSimpleEJA(n):
+ """
+ The rank-n simple EJA consisting of self-adjoint n-by-n quaternion
+ matrices, the usual symmetric Jordan product, and the
+ real-part-of-trace inner product. It has dimension `2n^2 - n` over
+ the reals.
+ """
+ pass
+
+def OctonionHermitianSimpleEJA(n):
+ """
+ This shit be crazy. It has dimension 27 over the reals.
+ """
+ n = 3
+ pass
+
+def JordanSpinSimpleEJA(n, field=QQ):
+ """
+ The rank-2 simple EJA consisting of real vectors ``x=(x0, x_bar)``
+ with the usual inner product and jordan product ``x*y =
+ (<x_bar,y_bar>, x0*y_bar + y0*x_bar)``. It has dimension `n` over
+ the reals.
+
+ EXAMPLES:
+
+ This multiplication table can be verified by hand::
+
+ sage: J = JordanSpinSimpleEJA(4)
+ sage: e0,e1,e2,e3 = J.gens()
+ sage: e0*e0
+ e0
+ sage: e0*e1
+ e1
+ sage: e0*e2
+ e2
+ sage: e0*e3
+ e3
+ sage: e1*e2
+ 0
+ sage: e1*e3
+ 0
+ sage: e2*e3
+ 0
+
+ In one dimension, this is the reals under multiplication::
+
+ sage: J1 = JordanSpinSimpleEJA(1)
+ sage: J2 = eja_rn(1)
+ sage: J1 == J2
+ True
+
+ """
+ Qs = []
+ id_matrix = identity_matrix(field, n)
+ for i in xrange(n):
+ ei = id_matrix.column(i)
+ Qi = zero_matrix(field, n)
+ Qi.set_row(0, ei)
+ Qi.set_column(0, ei)
+ Qi += diagonal_matrix(n, [ei[0]]*n)
+ # The addition of the diagonal matrix adds an extra ei[0] in the
+ # upper-left corner of the matrix.
+ Qi[0,0] = Qi[0,0] * ~field(2)
+ Qs.append(Qi)
+
+ # The rank of the spin factor algebra is two, UNLESS we're in a
+ # one-dimensional ambient space (the rank is bounded by the
+ # ambient dimension).
+ return FiniteDimensionalEuclideanJordanAlgebra(field, Qs, rank=min(n,2))