Skip to content
Current section
The Quantum Computing Enthusiast’s Hub
Saved
All sections

All sections

Saved
Skip Learn navigation
Encyclopedia
Explainer

The promise is part of the quantum algorithm

A valid theorem can coexist with unhelpful output on an invalid input. That is why benchmark descriptions must include promised structure and preprocessing. In this toy example the violation is visible by enumerating eight values. In a large application, verifying the promise may itself have a cost, and that cost belongs in any end-to-end argument.

Edition released Coverage: Overview · Technical · Research
On this page

Explanation

An algorithm can be extraordinarily effective when the possible inputs belong to a carefully defined family. Deutsch-Jozsa is a classic example. The unknown Boolean function is promised to be either constant or balanced, with exactly half its outputs equal to each value. An ideal quantum procedure distinguishes those two cases with one coherent query. Remove the promise and the interpretation changes. This is not an obscure qualification. It is a direct lesson in how a problem definition can create the conditions for an algorithmic advantage. A reader who understands the promise can judge a far wider range of computational claims.

The phase oracle assigns a plus or minus sign to each input according to the function value. After the final Hadamards, the amplitude of the all-zero output is the average of those signs. A constant function gives an average of plus one or minus one and therefore an all-zero outcome with probability one. A balanced function gives an average of zero and never produces all zeros in the ideal model. A function outside those two families generally gives an intermediate probability. The circuit still runs, but its output is no longer the promised yes-or-no certification. A procedure and the theorem describing its answer must therefore be kept together.

Compare three sign patterns: all signs equal, an even split, and an unpromised split. The first two yield the exact verdicts of the promised problem. The third can produce a nonzero but nonunit all-zero probability, revealing why the promise is a mathematical input. Exact deterministic classical query comparisons and bounded-error randomized classical strategies are different benchmarks. The allowed error probability and access model change the scale of the claimed separation, so both belong beside a query-cost comparison.

The Deutsch-Jozsa decision rule is exact for the promised alternatives. A function is constant or balanced. Once that condition is removed, the same circuit can still be run, but its outcome no longer carries the original guaranteed classification. This is a useful pattern far beyond one textbook algorithm: an algorithm's promise is part of its input specification.

Imagine applying the circuit to a dataset whose labels are only approximately balanced. A zero-string outcome does not license a claim that the function is constant, and the absence of that outcome does not repair the missing promise. A careful report would state the actual label distribution and interpret the resulting probability under a broader model. It would also compare classical and quantum access on the same problem. The best use of the small example is to show where an exact theorem ends and a different statistical inference task begins.

Declared model

Outside the promise, the binary guarantee disappears

Inputs and assumptions

Sweep k, the number of ones in an eight-input Boolean truth table, from 0 to 8. Values outside k=0,4,8 illustrate violation of the Deutsch–Jozsa promise.

Mathematical expression

P(all-zero output)=(1−2k/8)².

Worked interpretation

Preserved calculated values — synthetic model
Number of ones in an eight-input truth tableAll-zero output
01
10.5625
20.25
30.0625
40
50.0625
60.25
70.5625
81

Model boundaries

Ideal phase oracle and exact counts over all inputs. Query-complexity comparisons must specify deterministic exact versus randomized bounded-error classical strategies.

Original ideal teaching calculation. Not measured hardware data.

Misconception and correction

Misconception: The Deutsch-Jozsa algorithm correctly classifies every Boolean function, even outside its promise.

Correction: An output outside the promised case is not evidence that quantum mechanics has failed. It may simply mean the algorithm was asked a different question.

Worked derivation

After phase kickback and final Hadamards, the all-zero output amplitude is the average of (-1)^f(x) over all eight inputs.

For a constant function this average is either plus one or minus one, so the all-zero output occurs with certainty.

For a balanced function four terms are positive and four negative, giving zero all-zero probability.

For six zeros and two ones, the average is (6-2)/8=1/2, so the all-zero probability is one quarter. The algorithm’s promised binary interpretation no longer applies.

Additional scientific distinctions

The Deutsch–Jozsa guarantee concerns functions promised to be constant or balanced. With N=2^n inputs, the all-zero amplitude after the final Hadamards is (N_0-N_1)/N, where N_0 and N_1 count the two function values. For a truth table containing seven zeros and one one, this amplitude is 6/8=3/4 and its squared magnitude is 9/16. A nonconstant function can therefore produce the all-zero outcome outside the promise.

The circuit remains mathematically defined when the promise fails; the claimed interpretation loses its guarantee. Amplitudes must be combined before squaring because their signs carry the cancellation. A classical comparison must also specify deterministic certainty or an allowed probability of error: the striking worst-case exact-query separation does not transfer unchanged to a randomized bounded-error comparison. Promise, oracle cost, error criterion and output meaning belong together in the explanation.

Sources