sage: x2 = F(1 + 2*i)
sage: x3 = F(-i)
sage: x4 = F(6)
- sage: M = matrix(F,2,[x1,x2,x3,x4])
+ sage: M = matrix(F,2,[[x1,x2],[x3,x4]])
sage: _embed_complex_matrix(M)
- [ 4 2| 1 -2]
- [-2 4| 2 1]
+ [ 4 -2| 1 2]
+ [ 2 4|-2 1]
[-----+-----]
- [ 0 1| 6 0]
- [-1 0| 0 6]
+ [ 0 -1| 6 0]
+ [ 1 0| 0 6]
"""
n = M.nrows()
for z in M.list():
a = z.real()
b = z.imag()
- blocks.append(matrix(field, 2, [[a,-b],[b,a]]))
+ blocks.append(matrix(field, 2, [[a,b],[-b,a]]))
# We can drop the imaginaries here.
return block_matrix(field.base_ring(), n, blocks)