/usr/share/axiom-20170501/input/quantumwalk.input is in axiom-test 20170501-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 | )set break resume
)sys rm -f quantumwalk.output
)spool quantumwalk.output
)set message test on
)set message auto off
)clear all
-- In AXIOM, comments begin with two hyphens. This is a comment.
-- coin gives zero (reflection): S: |n-1,n,0> --> |n,n-1,0>
-- S: |n+1,n,0> --> |n,n+1,0>
-- coin gives one (transmission) S: |n-1,n,1> --> |n,n+1,1>
-- S: |n+1,n,1> --> |n,n-1,1>
-- set up a 400x400 transition matrix
--S 1 of 8
P:=matrix([[0/1 for i in 1..400] for j in 1..400]);
--E 1
-- the entries of this transition matrix: normalization factor
-- (2**0.5) left until later
--S 2 of 8
for i in 1..394 | (divide(i,4).remainder = 0) repeat
P(i-2,i):=1
P(i+5,i):=1
P(i-2,i+1):=1
P(i+5,i+1):=1
P(i+4,i+2):=1
P(i-1,i+2):=1
P(I+4,i+3):=1
p(i-1,i+3):=-1
--E 2
-- START is the initial state vector: Instead of starting at 0,
-- we start at point 200, the mid-point of the vector
--S 3 of 8
START:=matrix([[0/1] for i in 1..400])
--E 3
--S 4 of 8
START(200,1):=1
--E 4
-- This is just for bookkeeping: COUNT will check the probabilities
-- are normalized
------------------------------------------------------------------
-- The initial state |-1,0,0> corresponds to START(200,1):=1
-- States are ordered: |-1,0,0>, |-1,0,1>, |1,0,0>, |1,0,1>, |0,1,0> etc
------------------------------------------------------------------
--S 5 of 8
COUNT:=matrix([[0/1 for i in 1..100])
--E 5
-- we will store the wavefunction amplitudes in Q
--S 6 of 8
Q:=matrix([[0.0 for i in 1..400] for j in 1..61])
--E 6
-- PROB is the actual probabilities for each final state...
--S 7 of 8
PROB:=matrix([[0/1 for i in 1..100] for j in 1..60])
--E 7
--S 8 of 8
for j in 1..60 repeat
--we run 60 steps of the walk
div:=2**(j-1)
for i in 1..400 repeat
Q(j,i):=START(i,1)/(div**0.5)
c:=0/1
for k in 1..99 repeat
dummy:=4*k
--Calculate sum of squares of the amplitudes to get probabilities.
--4 amplitudes contribut to the probability at each point.
PROB(j,k):=(START(dummy,1)**2 +
START(dummy+1,1)**2 +
START(dummy+2,1)**2 +
START(dummy+3,1)**2
--c should be a vector of 1s, if our probabilities are normalized.
c:=c+PROB(j,k)
COUNT(j,1):=c
START:=P*START
--Finally, display the probabilities.
PROB
--E 8
)spool
)lisp (bye)
|