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

All sections

Saved
Skip Learn navigation
Encyclopedia
Topic

Simon algorithm

A quantum oracle algorithm that finds a hidden XOR period by sampling linear constraints over the binary field.

Also called Simon's algorithm

Edition released Coverage: Overview · Technical
On this page

Definition and significance

Simon's problem assumes that an oracle function has a hidden nonzero string s with f(x)=f(y) exactly when y=x or y=x XOR s. The algorithm obtains equations orthogonal to s, then solves them classically. It supplies an exponential query separation against bounded-error classical algorithms under the relevant promise and oracle model.

The useful information is a relation among outputs, not a list of all evaluated function values. Each run yields one random equation; repetition and classical linear algebra reconstruct the hidden period.

Mechanism and mathematical treatment

Prepare a uniform input superposition, evaluate f coherently, and measure or discard the output register. Conditional on a particular output, the input is (|x>+|x XOR s>)/sqrt(2). Hadamards produce amplitudes proportional to (-1)^(x dot y)[1+(-1)^(s dot y)]. The bracket vanishes when s dot y=1 and doubles when s dot y=0. Thus every measured y satisfies a homogeneous binary equation y dot s=0.

Collect enough linearly independent y values to determine a one-dimensional nullspace. The all-zero vector is always a formal solution, so the promise selects its nonzero member. The number of samples is linear in n up to success-probability overhead; repeated dependent equations add no rank.

Fully worked reference example

Let n=3 and s=101. The allowed sample strings satisfy y0 XOR y2=0, so they are 000,010,101 and 111. Suppose the first independent outcomes are 010 and 101. Their equations are s1=0 and s0 XOR s2=0. The nullspace is {000,101}; the nonzero period is 101.

The paired inputs 001 and 100 differ by 101. Their conditional state transforms into amplitudes only on the four permitted y values. No output tells which of 001 or 100 was the preimage; interference retains their shared periodic relation.

Limitations and common misconceptions

The function promise is essential. A general many-to-one function does not yield the same nullspace interpretation. Small illustrative oracles often have simple classical descriptions, so a proof about black-box query complexity should not be presented as an end-to-end commercial advantage.

Scientific relationships

The oracle-period problem preceded and influenced later order-finding work; this is historical sequence, not an assertion that one algorithm contains the other.

A hidden linear coefficient and a hidden XOR period are different oracle promises.

Historical source context

Simon presented an earlier conference version in 1994; the journal version appeared in October 1997. A later publisher online-posting date is not the discovery date.

A four-bit period recovered by binary elimination

Take the hidden period s=1101 and define the oracle output f(x)=(x1 XOR x0, x2, x3 XOR x0). This is a three-bit linear map. Its kernel consists of 0000 and 1101, so every output has exactly two preimages differing by s. The function satisfies Simon's promise without relying on an unspecified lookup table.

The Fourier samples satisfy y0 XOR y1 XOR y3=0, while y2 is unconstrained. Three possible independent samples are 1100,0010 and 1001. Their equations give s0 XOR s1=0, s2=0 and s0 XOR s3=0. The nullspace is {0000,1101}; selecting the nonzero vector gives the promised period. Each sample is a constraint, and no individual sample uniquely determines s.

For a concrete output value, f(0011)=011 and f(1110)=011. The two inputs differ by 1101. The conditional input state is (|0011>+|1110>)/sqrt(2). Its Hadamard transform has support on the eight vectors orthogonal to s, each with probability 1/8. The phase signs depend on the chosen coset representative 0011, but the support and probabilities do not. Measuring the function output is therefore optional when only the input-sample distribution is needed.

How many samples are actually needed

The permitted samples are uniform in an (n-1)-dimensional binary subspace. If the rows collected so far have rank r, their span contains 2^r of the 2^(n-1) possible samples. The next sample increases rank with probability 1-2^(r-(n-1)). The expected number of samples to increase rank from r to r+1 is the reciprocal of this probability.

For n=4, the expected total to obtain rank three is 1/(1-1/8)+1/(1-1/4)+1/(1-1/2)=8/7+4/3+2=94/21, approximately 4.47619. Three samples can suffice, but they are not guaranteed to be independent. The all-zero sample contributes no equation and occurs with probability 1/8 in this example. Discarding dependent rows saves storage without changing the available information.

After m samples, a simple failure bound is (2^(n-1)-1)2^(-m). To derive it, identify the sampled subspace with a binary vector space of dimension n-1. Failure to span means some nonzero linear functional vanishes on every sample. Each such functional vanishes with probability one-half per independent sample; union-bound over the 2^(n-1)-1 nonzero functionals. Thus m=n-1+ceil(log2(1/delta)) samples are sufficient up to the harmless strict inequality in this bound for failure probability at most delta.

Classical collision reasoning and promise verification

A classical value-query algorithm obtains a useful period once it sees two distinct inputs with the same output; their XOR is s. Before a collision, many candidate pairings remain possible. With random distinct queries, the collision scale is on the order of 2^(n/2), analogous to a birthday phenomenon. This is a statement about the promised oracle family, not about the explicit linear formula used in the small example, which can be inspected and solved classically.

For a candidate s_candidate, checking that f(x)=f(x XOR s_candidate) at selected x can reject a wrong result. A single passing check does not certify an arbitrary oracle's global promise. Under the exact Simon promise, any nonzero collision difference is the true period, so one observed collision has stronger significance. Outside the promise, multiple unrelated collisions can exist and their differences need not define one hidden subgroup.

The quantum circuit must implement the output coherently and preserve input labels. If the implementation records additional input-dependent garbage that is later discarded, it can reduce the coherence between x and x XOR s. The necessary condition is that the total retained environment information not distinguish the paired inputs. Computing f with a reversible subroutine and cleaning its work registers ensures the intended two-preimage interference when the output alone is kept.

The classical postprocessing uses Gaussian elimination over the binary field, not floating-point linear algebra. Row addition is XOR, pivots are binary ones, and no numerical tolerance is needed. Storing at most n-1 independent n-bit rows uses quadratic bit space. This postprocessing cost should accompany the linear quantum-query count in a complete algorithm description.

Sources

  • Daniel R. Simon · · Research paper · Publication status unspecified · epubs.siam.org · DOI 10.1137/S0097539796298637
    Verification scope

    Selected source text checked ·

    Full text indexed, 10 pages, 461 lines. Publisher full text retrieved; oracle promise and classical/quantum access comparison inspected. Journal page states received February 7, 1996 and accepted December 2, 1996; these are not publication dates.

    Access and topic assumptions inspected; no exhaustive theorem-by-theorem external review, quantum hardware execution, or empirical advantage claim. Original definitions and finite examples are not reproduced source passages.