summaryrefslogtreecommitdiff
path: root/single_dequantify.py
diff options
context:
space:
mode:
Diffstat (limited to 'single_dequantify.py')
-rw-r--r--single_dequantify.py17
1 files changed, 10 insertions, 7 deletions
diff --git a/single_dequantify.py b/single_dequantify.py
index db2ed0c..3cf7d3a 100644
--- a/single_dequantify.py
+++ b/single_dequantify.py
@@ -1,20 +1,23 @@
-#import plotting
+import sys
import subprocess
import math as mth
import cmath as cmt
import numpy as npy
import scipy.linalg as sla
-alpha = 0
+alpha = 1
beta = 1
-
-norm = npy.linalg.norm([alpha, beta])
-state = npy.array([alpha / norm, beta / norm])
-
dt = 0.1
iterations = 61
-H = npy.array([[2,1j],[-1j,3]])
+H = npy.array([[1,0],[0,2]])
+
+if len(sys.argv) == 3:
+ alpha = complex(sys.argv[1])
+ beta = complex(sys.argv[2])
+
+norm = npy.linalg.norm([alpha, beta])
+state = npy.array([alpha / norm, beta / norm])
def time_evolution(state, dt = dt):
return npy.dot(state, sla.expm(-1j * dt * H))