Simulation of Discrete Quantum Walk on a Line using the Matlab.
- Puts all
*.m
files in a directory. - Sets the directory as the working directory of the Matlab.
- Calls the function
dqwl(n)
with an argumentn
, which is the number of steps to be walked by the quantum walker. The function will returns a(2 * n + 1)
-dimensional vector, whosei
-th coordinate representing the probability of the quantum walker at the coordinate(i - (n + 1))
aftern
steps. - Calls the function
dqwl(n,s)
with an argumentn
and an optional arguments
, will simulate the discrete quantum walk on a line inn
steps and the initial coin state is set tos
.
plot([-100:100], dqwl(100))
The above command will yield the following diagram:
plot([-100:100], dqwl(100, qubit(1)))
The above command will yield the following diagram: