diff options
author | Ruben Erlenstedt <rxy626@gmail.com> | 2019-11-30 17:32:02 +0100 |
---|---|---|
committer | Ruben Erlenstedt <rxy626@gmail.com> | 2019-11-30 17:32:02 +0100 |
commit | fc949f6605f114d27cafc835b1bc7fa3027050b3 (patch) | |
tree | 0749d155d076d0d8f7f659a2b6f43a7b3f2472a8 | |
parent | 928f1e5fe856cd4a01be044440a53c033eb83027 (diff) |
Plot x3 and x4 of hopf coordinates in 2D
-rw-r--r-- | gnuplot_2d.plt | 11 | ||||
-rw-r--r-- | gnuplot_2q.plt | 7 | ||||
-rw-r--r-- | twoqbit_dequantify.py | 19 |
3 files changed, 21 insertions, 16 deletions
diff --git a/gnuplot_2d.plt b/gnuplot_2d.plt new file mode 100644 index 0000000..b3bf993 --- /dev/null +++ b/gnuplot_2d.plt @@ -0,0 +1,11 @@ +set size square +#plot cos(x),sin(y) w l lc rgb "#42a4f5" +set xrange [-1.1:1.1] +set yrange [-1.1:1.1] +set xlabel "Re(V)" +set ylabel "Im(V)" +set xzeroaxis +set yzeroaxis +plot 'data' w points palette pointsize 2 pointtype 7 +; +pause mouse close diff --git a/gnuplot_2q.plt b/gnuplot_2q.plt deleted file mode 100644 index 6614b49..0000000 --- a/gnuplot_2q.plt +++ /dev/null @@ -1,7 +0,0 @@ -set view equal xyz -set parametric -set isosamples 34,34 -splot cos(u)*cos(v),cos(u)*sin(v),sin(u) w l lc rgb "#42a4f5" -replot 'data2q' w points palette pointsize 2 pointtype 7 -; -pause mouse close diff --git a/twoqbit_dequantify.py b/twoqbit_dequantify.py index 9165a12..b6e0abb 100644 --- a/twoqbit_dequantify.py +++ b/twoqbit_dequantify.py @@ -4,18 +4,18 @@ import cmath as cmt import numpy as npy import scipy.linalg as sla -alpha = 1 -beta = 1 +alpha = 2 +beta = 0 gamma = 1 -delta = 1 +delta = 1+1j norm = npy.linalg.norm([alpha, beta, gamma, delta]) state = npy.array([alpha / norm, beta / norm, gamma / norm, delta / norm]) -dt = 0.1 -iterations = 5 +dt = 0.05 +iterations = 20 -H = npy.array([[1,0,0,0],[0,2,0,0],[0,0,3,0],[0,0,0,4]]) +H = npy.array([[1,0,0,1j],[0,2,0,0],[0,0,3,0],[-1j,0,0,4]]) M0 = [[1,0,0,0],[0,1,0,0],[0,0,-1,0],[0,0,0,-1]] M1 = [[0,0,1,0],[0,0,0,1],[1,0,0,0],[0,1,0,0]] @@ -37,13 +37,14 @@ def fibration(state): return ([x0.real,x1.real,x2.real,x3,x4]) -f = open("data2q", "w") +f = open("data", "w") for i in range(iterations + 1): hopf_state = fibration(state) - f.write(f"{hopf_state[0]}; {hopf_state[1]}; {hopf_state[2]}; {(i + 1) / (iterations + 1)}\n") + f.write(f"{hopf_state[3]}; {hopf_state[4]}; {(i + 1) / (iterations + 1)}\n") + print(hopf_state) state = time_evolution(state) f.close() -subprocess.run(["gnuplot", "gnuplot_2q.plt"]) +subprocess.run(["gnuplot", "gnuplot_2d.plt"]) |