1次元量子ウォークの別の書き方をしています。
設定】
上のスピンを[1,0],下のスピンは[0,1]とします。まず初期状態[1,0]の内部スピンをquantumcoinといわれるもので変更します。
その計算した内部スピンを上図のように上ならx+1,下はx-1に移動させます。この状態を時間発展させていきたいのですが、少しエラーがでてしまい一日奮闘したのですが、あと一歩のところで、上手くいきません。
python
1import numpy as np 2import matplotlib.pyplot as plt 3import math 4 5n=4 6m=3 7theta=3*(math.pi)/12 8 9phi_list=[] 10init_phi=[] 11new_phi=[] 12 13for i in range(0,2*n+1): 14 a=[0,0] 15 new_phi.append(a) 16 phi_list.append(a) 17 18 19 20#内部自由度をかえるコイン↓ 21def quantumcoin(theta): 22 C = [[np.cos(theta),-np.sin(theta)],[np.sin(theta),np.cos(theta)]] 23 return C 24#print(quantumcoin(3*(math.pi)/12)) 25 26#t=0の時のphi状態 27def initPositionPhi(): 28 phi = [1,0] 29 othersphi=[0,0] 30 for i in range(0,2*n+1): 31 if i == n: 32 init_phi.append(phi) 33 else: 34 init_phi.append(othersphi) 35 return init_phi 36#print(initPositionPhi()) 37 38def CoinOperator(x,new_phi): #内部自由度を変える処理 39 new_phi[x]=np.dot(quantumcoin(theta),new_phi[x]) 40 return new_phi[x] 41print(CoinOperator(n,initPositionPhi())) 42 43 44#def ShiftOperator(steps,phi): 45for t in range(1,m+1): #内部自由度を変えた物に合わせて座標を移動(x=nがスタート) 46 #if t==0: #怪しい 47 #initPositionPhi() 48 if t==1: 49 new_phi[n-t][1] = (CoinOperator(n,initPositionPhi()))[1] 50 new_phi[n+t][0] = (CoinOperator(n,initPositionPhi()))[0] 51 print(t,new_phi) 52 else: 53 new_phi[n-t] = (CoinOperator(n-(t-1),new_phi))[1] + (CoinOperator(n-(t+1),new_phi))[0] 54 new_phi[n+t] = (CoinOperator(n+(t-1),new_phi))[0] + (CoinOperator(n+(t+1),new_phi))[1] 55 #print(t,new_phi) 56
結果は
python
1[0.70710678 0.70710678] 21 [[0, 0], [0, 0], [0, 0], [0, 1.0000000000000002], [0, 0], [-0.7071067811865477, 0], [0, 0], [0, 0], [0, 0]] 31 [[0, 0], [0, 0], [0, 0], [0, 1.0000000000000002], [0, 0], [-0.7071067811865477, 0], [0, 0], [0, 0], [0, 0]] 42 [[0, 0], array([0., 0.]), 0.7071067811865477, array([-0.70710678, 0.70710678]), [0, 0], array([-0.5, -0.5]), -0.5000000000000001, array([0., 0.]), [0, 0]] 53 [array([0., 0.]), array([0.5, 0.5]), array([[ 0.5, -0.5], 6 [ 0.5, 0.5]]), array([-0.70710678, 0.70710678]), [0, 0], array([-0.5, -0.5]), array([[-0.35355339, 0.35355339], 7 [-0.35355339, -0.35355339]]), array([-0.35355339, 0.35355339]), array([0., 0.])]
と、結果が少しおかしくなってしまいます。
というのも、内部状態を変えた後の下スピンが反映されません。
式の定義が少しおかしいのかもしれませんが、解決できませんでした。
ご指摘、アドバイスよろしくお願いします。
以下のような答えになります。
R=[1 0],L=[0,1]としています。よろしくお願いします。
回答1件
あなたの回答
tips
プレビュー