Deutsch–Jozsa as HSP
The Deutsch–Jozsa algorithm is historically the first quantum algorithm to demonstrate an exponential separation over deterministic classical computation. It solves a promise problem — is a black-box function constant or balanced? — in a single query where a classical deterministic algorithm needs up to queries. Once you understand the Hidden Subgroup Problem (HSP), you gain a cleaner view of why the algorithm works: the constant case maps directly onto an HSP instance over the group , and the algorithm's structure is that of the standard abelian HSP circuit.
The group structure
Recall from the previous lessons that the HSP asks us to identify a hidden subgroup of an abelian group given oracle access to a function that is constant on cosets of and takes distinct values on distinct cosets.
For the Deutsch–Jozsa problem the setting is:
- Group: , the -bit strings under bitwise XOR (addition mod 2).
- Promise: The oracle is either constant or balanced (equal number of 0s and 1s).
- Goal: Decide which case holds using as few queries as possible.
The key observation is that the two cases relate differently to the subgroup structure of :
| Case | Hidden subgroup | Cosets | |------|--------------------|--------| | Constant | All of | Only one coset: itself | | Balanced | No HSP subgroup structure | — |
When is constant, it is trivially constant on every coset of (since there is only one coset, itself) — this is a valid HSP instance with . When is balanced, the function takes both values and equally, and there is in general no proper subgroup such that is constant on every coset of with distinct cosets mapping to distinct values. The balanced case is therefore not a standard HSP instance; instead, it is identified by the quantum algorithm via amplitude cancellation (see the circuit section below).
The quantum subroutine is Fourier sampling
The standard HSP algorithm for abelian groups runs the following circuit:
- Prepare an equal superposition over all group elements: apply to .
- Query the oracle in superposition to entangle the function value with the input register.
- Discard (trace out) the output register.
- Apply the Quantum Fourier Transform (QFT) over to the input register.
- Measure.
For the QFT is again (since the Hadamard transform is its own inverse and coincides with the Fourier transform over ). The resulting circuit is exactly the Deutsch–Jozsa circuit:
After the final , the amplitude of the all-zeros string is
If is constant, every term in the sum has the same sign, so : we measure with certainty. If is balanced, the positive and negative terms cancel exactly, so : the all-zeros outcome never appears.
Why the HSP lens clarifies the algorithm
From the HSP perspective, the measurement in step 5 samples from the dual group . The output distribution concentrates on characters that are constant on — exactly the characters that are trivial on , i.e. elements of the annihilator of in .
- Constant case (): The Fourier-sampling theorem applies directly. (the only character trivial on all of ), so the only measurable outcome is .
- Balanced case: A general balanced function does not satisfy the strict HSP promise for any nontrivial subgroup (distinct cosets need not have distinct values). The outcome follows instead from the amplitude cancellation derived above: the equal number of and phases sum to zero.
Relationship to Simon's problem
Simon's problem (the next lesson) is the natural next step in the same family: instead of deciding whether is constant (i.e., ) or not, we are given a genuine HSP promise — has hidden period with for an unknown — and must identify . The HSP Fourier-sampling strategy is the same, but now we need samples to pin down all bits of .
The progression
is a chain of increasingly powerful HSP instances, all solved by the same conceptual strategy of quantum Fourier sampling over an abelian group.
Sign in on the full site to ask questions and join the discussion.