Algorithms · Quantum walk
Discrete-time quantum walk on a line
A coin-and-shift circuit that spreads a walker's position amplitude ballistically, in contrast to the diffusive spread of a classical random walk.
Strong empiricalUpdated
A small worked example, computed in your browser. It is not a result from this record's papers.
A discrete-time quantum walk on a 4-cycle
One coin qubit, two position qubits (4 positions on a cycle), 3 steps starting at position 0.
Step 1 of 3 · Quantum walk step (4-cycle)
Probability of each outcome after this step
- 01150%
- 11050%
Flips the coin with a Hadamard, then shifts the position by +1 if the coin is |1⟩ or -1 mod 4 if the coin is |0⟩; with the coin in superposition, both shifts happen at once, entangling coin and position.
Probability leaves the outcome it was on and appears on 2 entirely different ones — not one outcome is populated both before and after. This is the step that entangles the qubits: from here on no single qubit has a state of its own, only the register as a whole does.
The same coin flip and shift, applied again.
Probability leaves all 2 outcomes it was on and appears on 4 entirely different ones — not one outcome is populated both before and after.
The same coin flip and shift, a third time.
Probability leaves all 4 outcomes it was on and appears on 2 entirely different ones — not one outcome is populated both before and after. The entanglement comes apart here: each qubit has a state of its own again.
Readout The position always reads 3, for either value of the coin: constructive interference on this small cycle concentrates the walk onto a single position after exactly 3 steps.
Open in Studio- Steps3
- Wires4
- Qubits1 coin + 3 position (8 sites)
- Steps shown2
- Spreadingσ∝t (quantum) vs σ∝√t (classical)
- Papers2
A discrete-time quantum walk pairs a coin qubit with a position register: flip the coin, then shift position conditioned on the coin outcome, coherently, without collapsing the superposition between steps.
TakesNothingWhat joins here
No input port at this edge: the record publishes no gate sequence and no register, so there is nothing here to read one off — and unlike a declared hole, nothing has been recorded about what belongs here.
Nothing in the Atlas meets this end.
ReturnsNothingWhat joins here
No output port at this edge: the record publishes no gate sequence and no register, so there is nothing here to read one off — and unlike a declared hole, nothing has been recorded about what belongs here.
Nothing in the Atlas meets this end.
This record publishes no gate sequence and no register, so there is nothing here to read an interface off. Absent rather than empty. See all 152 →
A coined discrete-time quantum walk on the integer line pairs a 2-dimensional coin register with a position register. Each step applies a coin operator (Hadamard, by default) to the coin, then a conditional shift that moves the position by if the coin reads and if it reads — applied coherently, so all branches persist and can later interfere.
Long-run behavior. After steps, the position distribution of this walk spreads with standard deviation (ballistic spreading), in contrast to a classical random walk's (diffusive spreading) — a quadratic gain in spreading rate that several quantum-walk-based search and graph algorithms exploit (Aharonov, Ambainis, Kempe, Vazirani, 2001).
Small worked instance. Start at position with coin . Step 1: on the coin gives ; the shift then gives (coin, position) — each position with probability , matching a classical single step.
Step 2 applies to the coin in each branch: , , giving
then the shift moves each term (, ):
Reading off probabilities: ; at position the two contributions carry different coin states so they do not interfere, giving ; and . At this short length the result numerically coincides with the classical 2-step binomial walk — the quantum/classical divergence (from interference between equal-coin-state paths reaching the same site) only becomes visible from step 3 onward, which is worth stating honestly rather than implying an advantage is visible after 2 steps.
TakesNothingWhat joins here
No input port at this edge: the record publishes no gate sequence and no register, so there is nothing here to read one off — and unlike a declared hole, nothing has been recorded about what belongs here.
Nothing in the Atlas meets this end.
ReturnsNothingWhat joins here
No output port at this edge: the record publishes no gate sequence and no register, so there is nothing here to read one off — and unlike a declared hole, nothing has been recorded about what belongs here.
Nothing in the Atlas meets this end.
This record publishes no gate sequence and no register, so there is nothing here to read an interface off. Absent rather than empty. See all 152 →
- Qubits
- 1 coin + 3 position (8 sites)
- Steps shown
- 2
- Spreading
- σ∝t (quantum) vs σ∝√t (classical)
- Coin
- Hadamard
- Shift
- Conditional cyclic ±1
- 2-step distribution
- P(-2,0,+2) = 1/4, 1/2, 1/4
H (coin)on coinControlled shift +1on coin, pos[0], pos[1], pos[2]Controlled shift −1on coin, pos[0], pos[1], pos[2]
Quantum vs classical
Classical baseline
A classical random walk on the line has position standard deviation σ ∝ √t after t steps (diffusive spreading).
Quantum claim
The coined quantum walk spreads ballistically, σ ∝ t, a quadratic improvement in spreading rate that some quantum-walk search and graph algorithms exploit.
How to compare
Compare the achieved spread (variance) at a fixed step count and circuit depth against a classical simulation, and confirm the downstream application actually uses interference rather than just the marginal position distribution.
Nobody has reviewed this record for gaps yet.
from qiskit import QuantumCircuit
from qiskit.circuit.library import UnitaryGate
import numpy as np
n_pos = 3
N = 2 ** n_pos
def cyclic_shift_matrix(direction):
M = np.zeros((N, N))
for x in range(N):
M[(x + direction) % N, x] = 1
return M
shift_plus = UnitaryGate(cyclic_shift_matrix(+1), label="S+1")
shift_minus = UnitaryGate(cyclic_shift_matrix(-1), label="S-1")
qc = QuantumCircuit(1 + n_pos, n_pos)
coin, pos = 0, list(range(1, 1 + n_pos))
for _ in range(2):
qc.h(coin)
qc.append(shift_plus.control(1), [coin] + pos)
qc.x(coin)
qc.append(shift_minus.control(1), [coin] + pos)
qc.x(coin)
qc.measure(pos, range(n_pos))
FINAL_CIRCUIT = qcRelated entries
- Grover unstructured search
Algorithms
- Quantum Fourier Transform
Algorithms
References
- Quantum Walks On Graphs
Dorit Aharonov, Andris Ambainis, Julia Kempe, Umesh Vazirani · 2000
Establishes the ballistic spreading of coined quantum walks and contrasts it with classical diffusive spreading.
- Quantum random walks - an introductory overview
Julia Kempe · 2003
Accessible review of coined and continuous-time quantum walks and their algorithmic applications.