The Shift Operator
A discrete-time quantum walk alternates two operations: first a coin toss (the coin operator, usually a Hadamard), then a conditional shift that moves the walker left or right depending on the coin's state. This lesson focuses on the shift.
The conditional shift
Label the walker's direction qubit as and its position as . The conditional shift satisfies
meaning: move right () when , and left () when .
On a line of positions we need 2 bits to label positions . The coin qubit and position register give a 3-qubit system. The right-shift rule is a controlled binary increment:
The first line propagates the carry (flip the high bit only when both the coin and the low bit are ); the second line always flips the low bit when the coin is . Together they increment the position by whenever .
In circuit notation this is a Toffoli gate (CCX) followed by a CNOT (CX):
Concrete example
Start with coin and position (binary ), i.e. the state :
Position has become : the walker moved one step to the right.
Conditionality is the key
The shift is coherent: when the coin is in superposition , the walker's position entangles with the coin and spreads in both directions simultaneously. Classical random walks pick one direction per step; quantum walks create a superposition of paths, leading to the quadratically faster spreading observed in later lessons.
Try it
The circuit below starts in (coin , position ). Complete the conditional shift so the final state is (position ). The grader checks the full statevector.
After pressing Run, the statevector should show a single amplitude of on the basis state (with qubit 0 most significant), confirming the walker moved exactly one step to the right.
Sign in on the full site to ask questions and join the discussion.