summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuben Erlenstedt <rxy626@gmail.com>2019-11-30 11:52:17 +0100
committerRuben Erlenstedt <rxy626@gmail.com>2019-11-30 11:52:17 +0100
commitcae4a514f6b8414ac4f78c706202f65a819bc5cf (patch)
tree52dfbb15d78715166dc67704147d2c1432bec4fe
parent26cb7b3abac9365d5ceccabc7cdde900f8cde3bf (diff)
parentf409a937c5a508ca015ee1fbc69a7eed28a1dd75 (diff)
Merge branch 'master' of keybase://team/entropyy.quantensysteme/dequantify
-rw-r--r--.gitignore2
-rw-r--r--gnuplot.plt7
-rw-r--r--single_dequantify.py16
3 files changed, 17 insertions, 8 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..0c7b4fc
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+data
+__pycache__
diff --git a/gnuplot.plt b/gnuplot.plt
new file mode 100644
index 0000000..635bd3e
--- /dev/null
+++ b/gnuplot.plt
@@ -0,0 +1,7 @@
+set view equal xyz
+set parametric
+set isosamples 10,10
+splot cos(u)*cos(v),cos(u)*sin(v),sin(u)
+replot 'data'
+;
+pause mouse close
diff --git a/single_dequantify.py b/single_dequantify.py
index cd302af..43c256d 100644
--- a/single_dequantify.py
+++ b/single_dequantify.py
@@ -1,9 +1,9 @@
-
+#import plotting
+import subprocess
import math as mth
import cmath as cmt
import numpy as npy
import scipy.linalg as sla
-#import matplotlib.pyplot as plt
alpha = 1 / npy.sqrt(2)
beta = 1 / npy.sqrt(2)
@@ -32,15 +32,15 @@ def sphere2cart(phi, theta):
]
historie = npy.array([bloch_map(state)])
+f = open("data", "a")
+
for i in range(iterations):
state = time_evolution(state)
h = npy.dot(state, state)
- historie = npy.vstack([historie,bloch_map(state)])
+ historie = npy.vstack([historie,bloch_map(state)])
coords = bloch_map(state)
coords = sphere2cart(coords[0], coords[1])
- print(f"{coords[0]}; {coords[1]}; {coords[2]}")
-
-import plotting
-plotting.phi(historie[:,0])
-
+ f.write(f"{coords[0]}; {coords[1]}; {coords[2]}\n")
+f.close()
+subprocess.run(["gnuplot", "gnuplot.plt"])