summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuben Erlenstedt <rxy626@gmail.com>2019-11-30 16:57:05 +0100
committerRuben Erlenstedt <rxy626@gmail.com>2019-11-30 16:57:05 +0100
commit928f1e5fe856cd4a01be044440a53c033eb83027 (patch)
tree98152f46dcc20400fb7c551266895245b5e659bd
parent3c5f2981c616e7375a3155d4bfaffec6e361ff89 (diff)
parent84b9f0eb682b60ecc8592bef22c549051d200ead (diff)
Merge branch 'master' of keybase://team/entropyy.quantensysteme/dequantify
-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))