]> gitweb.michael.orlitzky.com - sage.d.git/commitdiff
eja: make the complex embedding agree with the docs.
authorMichael Orlitzky <michael@orlitzky.com>
Fri, 19 Jul 2019 21:20:49 +0000 (17:20 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Mon, 29 Jul 2019 03:19:01 +0000 (23:19 -0400)
mjo/eja/euclidean_jordan_algebra.py

index 3cec4fad035e0330e22598bd77f6e5b1dc9b6074..8f21db7406a2d336a43f6fec3c8bc4438d0536a8 100644 (file)
@@ -1182,13 +1182,13 @@ def _embed_complex_matrix(M):
         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()
@@ -1199,7 +1199,7 @@ def _embed_complex_matrix(M):
     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)