....: [ 9, 10, 11, 12],
....: [-10, 9, -12, 11] ])
sage: _unembed_complex_matrix(A)
- [ -2*i + 1 -4*i + 3]
- [ -10*i + 9 -12*i + 11]
+ [ 2*i + 1 4*i + 3]
+ [ 10*i + 9 12*i + 11]
+
+ TESTS::
+
+ sage: set_random_seed()
+ sage: F = QuadraticField(-1, 'i')
+ sage: M = random_matrix(F, 3)
+ sage: _unembed_complex_matrix(_embed_complex_matrix(M)) == M
+ True
+
"""
n = ZZ(M.nrows())
if M.ncols() != n:
raise ValueError('bad real submatrix')
if submat[0,1] != -submat[1,0]:
raise ValueError('bad imag submatrix')
- z = submat[0,0] + submat[1,0]*i
+ z = submat[0,0] + submat[0,1]*i
elements.append(z)
return matrix(F, n/2, elements)