diff options
Diffstat (limited to 'single_dequantify.py')
-rw-r--r-- | single_dequantify.py | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/single_dequantify.py b/single_dequantify.py index c5054f5..b9a5253 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,16 @@ 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]}") - - - - + #print(f"{coords[0]}; {coords[1]}; {coords[2]}") + f.write(f"{coords[0]}; {coords[1]}; {coords[2]}\n") +f.close() +subprocess.run(["gnuplot", "gnuplot.plt"]) |