[ 0 -1| 6 0]
[ 1 0| 0 6]
+ TESTS:
+
+ Embedding is a homomorphism (isomorphism, in fact)::
+
+ sage: set_random_seed()
+ sage: n = ZZ.random_element(5)
+ sage: F = QuadraticField(-1, 'i')
+ sage: X = random_matrix(F, n)
+ sage: Y = random_matrix(F, n)
+ sage: actual = _embed_complex_matrix(X) * _embed_complex_matrix(Y)
+ sage: expected = _embed_complex_matrix(X*Y)
+ sage: actual == expected
+ True
+
"""
n = M.nrows()
if M.ncols() != n:
[ 2*i + 1 4*i + 3]
[ 10*i + 9 12*i + 11]
- TESTS::
+ TESTS:
+
+ Unembedding is the inverse of embedding::
sage: set_random_seed()
sage: F = QuadraticField(-1, 'i')
[-3 4 1 -2]
[-4 -3 2 1]
+ Embedding is a homomorphism (isomorphism, in fact)::
+
+ sage: set_random_seed()
+ sage: n = ZZ.random_element(5)
+ sage: Q = QuaternionAlgebra(QQ,-1,-1)
+ sage: X = random_matrix(Q, n)
+ sage: Y = random_matrix(Q, n)
+ sage: actual = _embed_quaternion_matrix(X)*_embed_quaternion_matrix(Y)
+ sage: expected = _embed_quaternion_matrix(X*Y)
+ sage: actual == expected
+ True
+
"""
quaternions = M.base_ring()
n = M.nrows()
sage: _unembed_quaternion_matrix(M)
[1 + 2*i + 3*j + 4*k]
- TESTS::
+ TESTS:
+
+ Unembedding is the inverse of embedding::
sage: set_random_seed()
sage: Q = QuaternionAlgebra(QQ, -1, -1)