We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e63ec4e commit ce5802dCopy full SHA for ce5802d
flattenunitary.py
@@ -0,0 +1,17 @@
1
+import qutip as qt
2
+import numpy as np
3
+def flattenunitary(x1a):
4
+ x1a_re = x1a.data.toarray().real
5
+ x1a_im = x1a.data.toarray().imag
6
+ complex_x1a_top = np.concatenate((x1a_re, -x1a_im), axis=1)
7
+ complex_x1a_bottom = np.concatenate((x1a_im, x1a_re), axis=1)
8
+ complex_x1a = np.vstack((complex_x1a_top, complex_x1a_bottom))
9
+ return complex_x1a.flatten()
10
+
11
+def realise(x1a):
12
13
14
15
16
17
+ return complex_x1a
0 commit comments