n = M.nrows()
if M.ncols() != n:
raise ValueError("the matrix 'M' must be square")
- field = M.base_ring()
+
+ # We don't need any adjoined elements...
+ field = M.base_ring().base_ring()
+
blocks = []
for z in M.list():
- a = z.vector()[0] # real part, I guess
- b = z.vector()[1] # imag part, I guess
+ a = z.list()[0] # real part, I guess
+ b = z.list()[1] # imag part, I guess
blocks.append(matrix(field, 2, [[a,b],[-b,a]]))
- # We can drop the imaginaries here.
- return matrix.block(field.base_ring(), n, blocks)
+ return matrix.block(field, n, blocks)
@staticmethod
sage: from mjo.eja.eja_algebra import ComplexHermitianEJA
+ EXAMPLES:
+
+ In theory, our "field" can be any subfield of the reals::
+
+ sage: ComplexHermitianEJA(2,AA)
+ Euclidean Jordan algebra of dimension 4 over Algebraic Real Field
+ sage: ComplexHermitianEJA(2,RR)
+ Euclidean Jordan algebra of dimension 4 over Real Field with
+ 53 bits of precision
+
TESTS:
The dimension of this algebra is `n^2`::