- 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),
- inner_product=_usual_ip)
+ @staticmethod
+ def __classcall_private__(cls, n, field=QQ):
+ 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 algebra is two, unless we're in a
+ # one-dimensional ambient space (because the rank is bounded by
+ # the ambient dimension).
+ fdeja = super(JordanSpinEJA, cls)
+ return fdeja.__classcall_private__(cls, field, Qs, rank=min(n,2))
+
+ def inner_product(self, x, y):
+ return _usual_ip(x,y)