From fc949f6605f114d27cafc835b1bc7fa3027050b3 Mon Sep 17 00:00:00 2001 From: Ruben Erlenstedt Date: Sat, 30 Nov 2019 17:32:02 +0100 Subject: Plot x3 and x4 of hopf coordinates in 2D --- gnuplot_2d.plt | 11 +++++++++++ gnuplot_2q.plt | 7 ------- twoqbit_dequantify.py | 19 ++++++++++--------- 3 files changed, 21 insertions(+), 16 deletions(-) create mode 100644 gnuplot_2d.plt delete mode 100644 gnuplot_2q.plt 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"]) -- cgit v1.2.3-54-g00ecf