qit.examples.quantum_walk¶
- qit.examples.quantum_walk(steps=8, n=21, p=0.05, n_coin=2)¶
Quantum random walk demo.
Simulates a wrapping 1D quantum walker controlled by a unitary quantum coin. On each step the coin is flipped and the walker moves either to the left or to the right depending on the result. A three-dimensional coin introduces a third option, staying put.
- Parameters
steps (int) – number of steps
n (int) – number of possible walker positions
p (float) – probability of measuring the walker after each step
n_coin (int) – coin dimension, 2 or 3
- Returns
walker state at the end of the walk
- Return type
NOTE: p=1 results in a fully classical random walk, whereas p=0 corresponds to the “fully quantum” case.