summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuben Erlenstedt <rxy626@gmail.com>2019-11-30 13:13:48 +0100
committerRuben Erlenstedt <rxy626@gmail.com>2019-11-30 13:13:48 +0100
commit56438ced53990b8295f7b282758561ac39947ca0 (patch)
tree6d8e9a0a9b0bbb056e1410c2006e93187a158e66
parentcae4a514f6b8414ac4f78c706202f65a819bc5cf (diff)
work on 2d plot of phi
-rw-r--r--plotting.py9
-rw-r--r--single_dequantify.py11
2 files changed, 13 insertions, 7 deletions
diff --git a/plotting.py b/plotting.py
index 9def377..57116c1 100644
--- a/plotting.py
+++ b/plotting.py
@@ -43,12 +43,15 @@ def kugel(historie):
plt.show()
def phi(phi):
- fig, ax = plt.subplots()
+ ax = plt.axes()
+ plt.grid()
x = mth.cos(phi[0])
y = mth.sin(phi[0])
- ax.arrow(0, 0, 1, 1)
- ax.set_title('Zeitentwicklung von phi')
+ ax.arrow(0, 0, 0.5, 0.5, head_width=0.05, head_length=0.07)
+ plt.title('Zeitentwicklung von phi')
+ plt.xlim(-1.1,1.1)
+ plt.ylim(-1.1,1.1)
plt.show()
diff --git a/single_dequantify.py b/single_dequantify.py
index 43c256d..0d38fc7 100644
--- a/single_dequantify.py
+++ b/single_dequantify.py
@@ -10,9 +10,9 @@ beta = 1 / npy.sqrt(2)
state = npy.array([alpha, beta])
dt = 0.2
-iterations = 20
+iterations = 200
-H = npy.array([[2,-2j],[2j,3]])
+H = npy.array([[2,0],[0,3]])
def time_evolution(state, dt = dt):
@@ -32,7 +32,7 @@ def sphere2cart(phi, theta):
]
historie = npy.array([bloch_map(state)])
-f = open("data", "a")
+f = open("data", "w")
for i in range(iterations):
state = time_evolution(state)
@@ -43,4 +43,7 @@ for i in range(iterations):
f.write(f"{coords[0]}; {coords[1]}; {coords[2]}\n")
f.close()
-subprocess.run(["gnuplot", "gnuplot.plt"])
+import plotting
+#plotting.phi(historie[:,0])
+plotting.kugel(historie)
+#subprocess.run(["gnuplot", "gnuplot.plt"])