From 84b9f0eb682b60ecc8592bef22c549051d200ead Mon Sep 17 00:00:00 2001 From: Dennis Kobert Date: Sat, 30 Nov 2019 13:43:57 +0100 Subject: Add commadline options --- single_dequantify.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/single_dequantify.py b/single_dequantify.py index 8e801a1..96f76ed 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 = 3 +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,0],[0,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)) -- cgit v1.2.3-54-g00ecf