Skip to content

Simon’s algorithm finds a hidden XOR period by collecting random linear equations. A coherent query correlates each input with its function value; a Hadamard transform then returns a word orthogonal to the period. Repeating this experiment and solving the equations over F2\mathbb F_2 recovers the hidden word.

For the promise defined below, including the possibility of an injective function, the fixed-error quantum query complexity is Θ(n)\Theta(n), compared with Θ(2n/2)\Theta(2^{n/2}) classical value queries. One query produces a sample, not usually the answer. The comparison counts oracle calls and excludes building the oracle and implementing its gates.

Helpful background. Quantum oracles defines coherent value access. Linear maps explains kernels and rank; here all row operations use arithmetic modulo two. Query complexity distinguishes exact, zero-error and bounded-error query caps.

Let

n≥1,G=F2n,N=∣G∣=2n,s∈G,n\ge1, \qquad G=\mathbb F_2^n, \qquad N=|G|=2^n, \qquad s\in G,

where addition in GG is bitwise XOR. Define Hs={0,s}H_s=\{0,s\}. The oracle is selected from the family of functions f:G→Gf:G\to G satisfying

f(x)=f(x′)⟺x⊕x′∈Hs.f(x)=f(x') \quad\Longleftrightarrow\quad x\mathbin\oplus x'\in H_s.

The biconditional is the promise. It says not merely that ss is a period but that there are no other collisions. The required search output is the complete word ss; the associated decision problem asks whether s=0ns=0^n.

The promise includes two branches. If s=0ns=0^n, then Hs={0}H_s=\{0\} and ff is injective. If s≠0ns\ne0^n, the fibers are exactly the two-element cosets

x+Hs={x,x⊕s},x+H_s=\{x,x\mathbin\oplus s\},

so ff is exactly two-to-one. The mask is unique: the fiber of f(0)f(0) is HsH_s, and equality of two promised functions’ collision relations would force their fibers at zero, hence their masks, to agree.

Some textbook presentations promise s≠0s\ne0 from the outset. That restricted problem is useful for deriving the sampling pattern, but it omits the injective branch and cannot by itself justify an injective-versus-two-to-one decision claim. This page retains the unified promise throughout.

The supplied oracle acts on an nn-qubit address and an nn-qubit value register:

Of∣x,z⟩=∣x,z⊕f(x)⟩.O_f|x,z\rangle=|x,z\oplus f(x)\rangle.

For every xx, XOR by f(x)f(x) is a permutation and its own inverse, so this specifies a unitary on the complete space. A classical query returns the full nn-bit value f(x)f(x).

One sample uses the following steps:

  1. Prepare ∣0n⟩X∣0n⟩Z|0^n\rangle_X|0^n\rangle_Z and apply H⊗nH^{\otimes n} to XX.
  2. Apply OfO_f once.
  3. Apply H⊗nH^{\otimes n} to XX, then measure XX to obtain yy.

The value register may be measured after the query, or left unmeasured and discarded. Both choices give the same marginal distribution for yy. It starts in zero, unlike the one-qubit minus-state target used in the preceding Boolean algorithms.

Conditional coset states and the address marginal

Section titled “Conditional coset states and the address marginal”

After address preparation and one value query, the joint state is

∣Ψf⟩=1N∑x∈G∣x,f(x)⟩.|\Psi_f\rangle = \frac1{\sqrt N}\sum_{x\in G}|x,f(x)\rangle.

For s≠0s\ne0, measuring ZZ and obtaining the value f(t)f(t) leaves

∣t+Hs⟩=∣t⟩+∣t⊕s⟩2|t+H_s\rangle = \frac{|t\rangle+|t\mathbin\oplus s\rangle}{\sqrt2}

in the address register. The probability of each distinct oracle value is 2/N2/N, and the representative tt is irrelevant up to its coset. In the injective branch, measuring ZZ leaves a single basis state ∣t⟩|t\rangle.

The output measurement is optional. If ZZ is ignored, the probability of measuring yy after the final Hadamards is

p(y)=⟨y|H⊗nTr⁡Z(∣Ψf⟩⟨Ψf∣)H⊗n|y⟩=1N2∑x,x′f(x)=f(x′)(−1)(x⊕x′)⋅y.\begin{aligned} p(y) &= \left\langle y\middle| H^{\otimes n}\operatorname{Tr}_Z \bigl(|\Psi_f\rangle\langle\Psi_f|\bigr) H^{\otimes n} \middle|y\right\rangle\\ &= \frac1{N^2} \sum_{\substack{x,x'\\ f(x)=f(x')}} (-1)^{(x\oplus x')\cdot y}. \end{aligned}

Only equal-output pairs survive the partial trace. For a nonzero mask, each xx contributes the two differences 00 and ss, giving

p(y)=1N[1+(−1)s⋅y].p(y) = \frac1N\left[1+(-1)^{s\cdot y}\right].

This equals 2/N2/N when s⋅y=0s\cdot y=0 and zero otherwise. For s=0s=0, only x=x′x=x' survives, so p(y)=1/Np(y)=1/N for every yy. Measuring the value register reveals a convenient conditional coset state; it does not create the period relation or change the address marginal.

The nn-fold Hadamard transform is the Fourier transform over the product group (Z2)n(\mathbb Z_2)^n:

H⊗n∣x⟩=1N∑y∈G(−1)x⋅y∣y⟩,x⋅y=⨁j=1nxjyj.H^{\otimes n}|x\rangle = \frac1{\sqrt N} \sum_{y\in G}(-1)^{x\cdot y}|y\rangle, \qquad x\cdot y=\bigoplus_{j=1}^n x_jy_j.

Applying it to a nontrivial coset state gives

H⊗n∣t+Hs⟩=12N∑y[(−1)t⋅y+(−1)(t⊕s)⋅y]∣y⟩=12N∑y(−1)t⋅y[1+(−1)s⋅y]∣y⟩=2N∑y:s⋅y=0(−1)t⋅y∣y⟩.\begin{aligned} H^{\otimes n}|t+H_s\rangle &= \frac1{\sqrt{2N}}\sum_y \left[ (-1)^{t\cdot y} +(-1)^{(t\oplus s)\cdot y} \right]|y\rangle\\ &= \frac1{\sqrt{2N}}\sum_y (-1)^{t\cdot y} \left[1+(-1)^{s\cdot y}\right]|y\rangle\\ &= \sqrt{\frac2N} \sum_{y:s\cdot y=0} (-1)^{t\cdot y}|y\rangle. \end{aligned}

Character cancellation removes every yy with s⋅y=1s\cdot y=1. Define the annihilator

Hs⊥={y∈G:y⋅h=0 for every h∈Hs}.H_s^\perp = \{y\in G:y\cdot h=0\text{ for every }h\in H_s\}.

Both promise branches are then summarized by

Pr⁡(Y=y)={∣Hs∣/N,y∈Hs⊥,0,y∉Hs⊥.\Pr(Y=y) = \begin{cases} |H_s|/N,&y\in H_s^\perp,\\ 0,&y\notin H_s^\perp. \end{cases}

For s≠0s\ne0, Hs⊥=s⊥H_s^\perp=s^\perp has dimension n−1n-1 and contains N/2N/2 words, each with probability 2/N2/N. For s=0s=0, it is all of GG and each word has probability 1/N1/N. Each sample supplies one homogeneous binary equation y⋅s=0y\cdot s=0; it does not normally determine ss by itself.

The transform here is not the cyclic F2nF_{2^n} circuit used in number-theoretic phase and period estimation. The distinction is structural: (Z2)n(\mathbb Z_2)^n has binary characters implemented by independent Hadamards.

Four paired three-bit inputs and the four Fourier outcomes orthogonal to the hidden word 101

A three-bit example with s=101s=101: f(x1x2x3)=(x2,x1⊕x3,0)f(x_1x_2x_3)=(x_2,x_1\oplus x_3,0). Each input pair shares one value. Fourier sampling gives y=000,010,101,111y=000,010,101,111, each with probability 1/41/4; all satisfy y⋅101=0y\cdot101=0. The zero sample is allowed and adds no equation.

Place retained samples into a binary matrix

M=(y1T⋮ymT).M= \begin{pmatrix} y_1^{\mathsf T}\\ \vdots\\ y_m^{\mathsf T} \end{pmatrix}.

For a nonzero mask, every row lies in s⊥s^\perp. Once rank⁡M=n−1\operatorname{rank}M=n-1, the nullspace is the two-element set {0,t}\{0,t\} for a unique nonzero word tt. Under the nonzero branch alone, t=st=s. Under the unified promise, the injective branch can also happen to produce a rank-(n−1)(n-1) matrix, so the candidate must be checked:

s^={t,f(0n)=f(t),0n,f(0n)≠f(t).\widehat s= \begin{cases} t,&f(0^n)=f(t),\\ 0^n,&f(0^n)\ne f(t). \end{cases}

The biconditional promise makes this decisive. Equality for nonzero tt means t=st=s; inequality rules out tt and therefore identifies the injective branch once the sample span has codimension at most one.

If m≥dm\ge d vectors are sampled independently and uniformly from a dd-dimensional binary space, the probability of spanning it is

Pd,m=∏r=0d−1(1−2r−m).P_{d,m} = \prod_{r=0}^{d-1}\left(1-2^{r-m}\right).

For m<dm<d, spanning is impossible; for d=0d=0, the empty product is one. One way to derive the displayed formula is to transpose the mm samples into a d×md\times m matrix. Its first row must avoid the zero span, its second must avoid a one-dimensional span, and so on. The failure probability obeys

1−Pd,m≤∑r=0d−12r−m=2d−m−2−m<2d−m.\begin{aligned} 1-P_{d,m} &\le \sum_{r=0}^{d-1}2^{r-m} = 2^{d-m}-2^{-m} <2^{d-m}. \end{aligned}

When the current span has rank r<dr<d, a fresh sample increases the rank with probability 1−2r−d1-2^{r-d}. Summing the corresponding geometric waiting times gives

ETd=∑r=0d−111−2r−d=d+∑k=1d12k−1<d+1.607.\begin{aligned} \mathbb E T_d &= \sum_{r=0}^{d-1}\frac1{1-2^{r-d}}\\ &= d+\sum_{k=1}^{d}\frac1{2^k-1} <d+1.607. \end{aligned}

These are exact sampling laws. Row reduction must still be performed over F2\mathbb F_2, not over the real numbers, and a verifier call remains part of the executable algorithm.

Expected stopping, query caps and exact algorithms

Section titled “Expected stopping, query caps and exact algorithms”

Different stopping conventions support different complexity claims.

Expected stopping. Repeatedly sample until the row rank reaches n−1n-1, compute the nonzero null vector, and verify it. In the nonzero branch the expected sample count is below n+0.607n+0.607 because d=n−1d=n-1; the two verifier calls give an always-correct expected O(n)O(n)-query procedure. In the injective branch, this rule also reaches rank n−1n-1 in finite expected time and the verifier returns zero. It has no deterministic query cap.

Fixed-cap zero error. Take m=nm=n Fourier samples. Return zero immediately at rank nn; at rank n−1n-1, verify the unique nonzero null vector; below rank n−1n-1, return ?. For a nonzero mask, the failure bound with d=n−1d=n-1 is below 1/21/2. For the injective branch, dependence among the first n−1n-1 samples has probability at most

∑r=0n−22r−n=12−2−n,\sum_{r=0}^{n-2}2^{r-n} = \frac12-2^{-n},

so the inconclusive probability is also below 1/21/2. The deterministic cap is n+2n+2 value queries.

Fixed-cap bounded error. Take m=n+1m=n+1 samples, use the same rank and verifier rules, and return zero on an unresolved lower-rank outcome. The injective branch is always correct. In the nonzero branch the failure probability is below

2(n−1)−(n+1)=14.2^{(n-1)-(n+1)}=\frac14.

The cap is n+3n+3 queries, already below the conventional 1/31/3 error threshold.

A separate exact algorithm. The random-rank loop is not an exact fixed-cap algorithm. Brassard and Høyer gave a separate construction that forces a new independent annihilator element, or certifies that none remains, using exact amplification; their formulation includes the trivial subgroup, and their Section 4.3 reduces the total number of function evaluations to O(n)O(n). Cai and Qiu later supplied another optimal exact ordinary-oracle construction for the restricted nonzero-mask problem. It must not be applied silently to the s=0s=0 branch. Together with the transparent zero-error and bounded-error procedures, the applicable upper bounds are O(n)O(n).

For the associated injective-versus-two-to-one decision problem, Koiran, Nesme, and Portier proved, for sufficiently large nn,

T(n)≥n+2+log⁡2(2−4ε)8(0≤ε<1/2).T(n) \ge \frac{n+2+\log_2(2-4\varepsilon)}8 \qquad (0\le\varepsilon<1/2).

A full-mask search procedure also solves the decision problem. For zero error, replacing an inconclusive result of probability at most 1/21/2 by an independent fair decision bit produces error at most 1/41/4, so the lower bound transfers under the fixed-cap convention. Consequently, for every fixed ε<1/2\varepsilon<1/2,

QE(Simon⁡n)=Θ(n)=Θ(log⁡N),Q0(Simon⁡n)=Θ(n)=Θ(log⁡N),Qε(Simon⁡n)=Θ(n)=Θ(log⁡N).\begin{aligned} Q_E(\operatorname{Simon}_n)&=\Theta(n)=\Theta(\log N),\\ Q_0(\operatorname{Simon}_n)&=\Theta(n)=\Theta(\log N),\\ Q_\varepsilon(\operatorname{Simon}_n)&=\Theta(n)=\Theta(\log N). \end{aligned}

The equality is asymptotic. The explicit n+2n+2 and n+3n+3 caps above belong to the transparent verifier-based procedures, not to the cited exact construction’s optimized constants.

Classical collisions and difference covers

Section titled “Classical collisions and difference covers”

A classical query returns one complete value f(x)f(x). Under a nonzero mask, the first observed collision identifies it:

f(x)=f(x′),x≠x′,⟹s=x⊕x′.f(x)=f(x'), \qquad x\ne x', \quad\Longrightarrow\quad s=x\mathbin\oplus x'.

An exact deterministic schedule follows from a difference cover. Write n=a+bn=a+b with a=⌊n/2⌋a=\lfloor n/2\rfloor and query every address in

A={(u,0b):u∈F2a},B={(0a,v):v∈F2b}.A=\{(u,0^b):u\in\mathbb F_2^a\}, \qquad B=\{(0^a,v):v\in\mathbb F_2^b\}.

Their intersection is {0n}\{0^n\}. Every nonzero s=(u,v)s=(u,v) equals (u,0b)⊕(0a,v)(u,0^b)\oplus(0^a,v), so a hidden mask forces a collision among the queried addresses. No collision proves the injective branch. Hence

D(Simon⁡n)≤2⌊n/2⌋+2⌈n/2⌉−1.D(\operatorname{Simon}_n) \le 2^{\lfloor n/2\rfloor} +2^{\lceil n/2\rceil} -1.

Conversely, qq queried addresses determine at most (q2)\binom q2 nonzero pairwise XOR differences. If some nonzero word is missing, an injective transcript can be completed either as an injective oracle or as a two-to-one oracle with that hidden mask, so an exact algorithm cannot distinguish them. Therefore

(q2)≥N−1,D(Simon⁡n)≥⌈1+8N−72⌉.\binom q2\ge N-1, \qquad D(\operatorname{Simon}_n) \ge \left\lceil \frac{1+\sqrt{8N-7}}2 \right\rceil.

Random queries give the matched bounded-error upper bound. For a fixed nonzero mask, the domain is partitioned into N/2N/2 pairs. Sampling q≤N/2q\le N/2 distinct addresses without seeing both members of any pair has probability

pmiss(N,q)=2q(N/2q)(Nq).p_{\mathrm{miss}}(N,q) = \frac{2^q\binom{N/2}{q}}{\binom Nq}.

The numerator chooses qq distinct pairs and one endpoint from each. Choosing q=Θ(N)q=\Theta(\sqrt N) makes the miss probability a fixed constant below one; a collision returns its XOR difference, while no collision returns zero.

For a lower bound, mix a uniformly random injective oracle with equal probability against an oracle with a uniformly random nonzero mask and random distinct fiber labels. Until a collision, their distinct output transcripts can be coupled. The queried addresses expose at most (q2)\binom q2 candidate masks, so any depth-qq deterministic decision tree has distributional success at most

12+(q2)2(N−1).\frac12+\frac{\binom q2}{2(N-1)}.

Yao’s minimax principle then gives Ω(N)\Omega(\sqrt N) randomized query complexity for the associated decision task at every fixed error below 1/21/2. Any full-mask search algorithm decides whether s=0ns=0^n, so the lower bound transfers to search. A randomized fixed-cap procedure at ε=0\varepsilon=0 cannot use random coins to evade the exact worst-case difference-cover requirement. Thus, for every fixed 0≤ε<1/20\le\varepsilon<1/2,

D(Simon⁡n)=Θ(2n/2)=Θ(N),Rε(Simon⁡n)=Θ(2n/2)=Θ(N).\begin{aligned} D(\operatorname{Simon}_n)&=\Theta(2^{n/2})=\Theta(\sqrt N),\\ R_\varepsilon(\operatorname{Simon}_n) &=\Theta(2^{n/2})=\Theta(\sqrt N). \end{aligned}

Take n=4n=4, s=1011s=1011, and, with x1x_1 the most significant bit,

f(x1x2x3x4)=(x2, x1⊕x3, x1⊕x4, 0).f(x_1x_2x_3x_4) = (x_2,\ x_1\oplus x_3,\ x_1\oplus x_4,\ 0).

Its kernel is {0000,1011}\{0000,1011\}, and exhaustive evaluation gives:

Inputs Output
0000, 1011 0000
0001, 1010 0010
0010, 1001 0100
0011, 1000 0110
0100, 1111 1000
0101, 1110 1010
0110, 1101 1100
0111, 1100 1110

The exact Fourier support is

0000 0011 0100 0111 1001 1010 1101 1110

with probability 1/81/8 on every listed word and zero elsewhere. The independent rows 0011, 0100, and 1001 have nullspace {0000,1011}\{0000,1011\}.

For a three-dimensional sample space, exact enumeration of all 8m8^m ordered sequences gives:

mm Fraction spanning P3,mP_{3,m}
3 168/512168/512 21/6421/64
4 2520/40962520/4096 315/512315/512
5 26040/3276826040/32768 3255/40963255/4096

The expected spanning time is

ET3=87+43+2=9421.\mathbb E T_3 = \frac87+\frac43+2 = \frac{94}{21}.

For q=4,5,6q=4,5,6 uniformly selected distinct addresses at N=16N=16,

pmiss(16,4)=813,pmiss(16,5)=1639,pmiss(16,6)=32143.p_{\mathrm{miss}}(16,4)=\frac8{13}, \qquad p_{\mathrm{miss}}(16,5)=\frac{16}{39}, \qquad p_{\mathrm{miss}}(16,6)=\frac{32}{143}.

The six-query collision probability is therefore 111/143>2/3111/143>2/3. Exact recovery needs six queries as well: the pair-count lower bound gives (q2)≥15\binom q2\ge15, and

C={0000,1000,0100,0010,0001,1111}C=\{0000,1000,0100,0010,0001,1111\}

has every nonzero four-bit word among its fifteen pairwise XOR differences. Thus D(Simon⁡4)=6D(\operatorname{Simon}_4)=6. For s=1011s=1011, the cover contains the colliding pair 0100 and 1111.

Gate costs and the hidden-subgroup viewpoint

Section titled “Gate costs and the hidden-subgroup viewpoint”

Each Fourier sample needs one query, 2n2n visible qubits, 2n2n Hadamards and measurement of the nn address qubits. Registers must be reinitialized before the next sample. With O(n)O(n) rows, straightforward binary elimination uses O(n3)O(n^3) bit operations and O(n2)O(n^2) memory. The verifier adds at most two value queries; oracle workspace and implementation costs remain additional.

The exponential query comparison is a worst-case result over the promised family. The linear function in the worked example has a transparent description: if that description is available, a classical algorithm can inspect its kernel directly. It is not then restricted to learning through unknown function values. Similarly, an ordinary classical API does not automatically supply the coherent oracle required by the quantum algorithm.

The group is (Z2)n(\mathbb Z_2)^n, and the hidden subgroup is Hs={0,s}H_s=\{0,s\}. Coset sampling followed by Fourier sampling extracts characters trivial on that subgroup. This viewpoint helped motivate later algorithms, including Shor’s algorithm, whose cyclic period finding and number-theoretic reductions need their own analysis. Simon’s oracle lower bound does not become a classical factoring lower bound or prove BQP ≠\ne BPP; see quantum complexity classes.

The ideal sample equations and the verifier rely on the full collision promise. With noisy or off-promise data, a null vector alone does not establish a period. A noise model and a suitable statistical recovery procedure must replace the exact reasoning.

Prove that the mask ss is unique. Then derive the injective branch for s=0s=0 and the exact two-to-one coset structure for s≠0s\ne0.

Solution

The fiber of f(0)f(0) is

{x:f(x)=f(0)}={x:x⊕0∈{0,s}}={0,s}.\{x:f(x)=f(0)\} = \{x:x\oplus0\in\{0,s\}\} = \{0,s\}.

If the same collision relation had masks ss and tt, these fibers would obey {0,s}={0,t}\{0,s\}=\{0,t\}, hence s=ts=t. When s=0s=0, equality of outputs implies x⊕x′=0x\oplus x'=0 and therefore x=x′x=x', so ff is injective. When s≠0s\ne0, each xx shares its value exactly with x⊕sx\oplus s, and the two addresses are distinct. The fibers are therefore the two-element cosets of {0,s}\{0,s\}.

Full-space action and optional measurement

Section titled “Full-space action and optional measurement”

Show that OfO_f is unitary on the whole computational basis. Starting from ∣Ψf⟩|\Psi_f\rangle, derive the address distribution without measuring the value register and compare it with the conditional-coset derivation.

Solution

For each fixed xx, the map z↦z⊕f(x)z\mapsto z\oplus f(x) is a permutation and its own inverse. The full basis map is therefore a permutation, so OfO_f is unitary and Of†=OfO_f^\dagger=O_f.

Tracing out ZZ gives

ρX=1N∑x,x′f(x)=f(x′)∣x⟩⟨x′∣.\rho_X = \frac1N \sum_{\substack{x,x'\\f(x)=f(x')}}|x\rangle\langle x'|.

After H⊗nH^{\otimes n},

p(y)=1N2∑x,x′f(x)=f(x′)(−1)(x⊕x′)⋅y.p(y) = \frac1{N^2} \sum_{\substack{x,x'\\f(x)=f(x')}} (-1)^{(x\oplus x')\cdot y}.

For s≠0s\ne0, each xx has equal-output partners xx and x⊕sx\oplus s, so p(y)=N−1[1+(−1)s⋅y]p(y)=N^{-1}[1+(-1)^{s\cdot y}]. This is 2/N2/N on s⊥s^\perp and zero elsewhere, exactly the distribution obtained by first conditioning on any coset state. For s=0s=0, only diagonal pairs remain and p(y)=1/Np(y)=1/N.

Derive the Hadamard transform of ∣t+Hs⟩|t+H_s\rangle and prove that the result is uniform on Hs⊥H_s^\perp. Include the s=0s=0 branch.

Solution

For s≠0s\ne0,

H⊗n∣t+Hs⟩=12N∑y(−1)t⋅y[1+(−1)s⋅y]∣y⟩=2N∑y:s⋅y=0(−1)t⋅y∣y⟩.\begin{aligned} H^{\otimes n}|t+H_s\rangle &= \frac1{\sqrt{2N}}\sum_y (-1)^{t\cdot y} \left[1+(-1)^{s\cdot y}\right]|y\rangle\\ &= \sqrt{\frac2N} \sum_{y:s\cdot y=0} (-1)^{t\cdot y}|y\rangle. \end{aligned}

There are N/2N/2 supported words and every squared amplitude is 2/N2/N, so the distribution is normalized and uniform. If s=0s=0, a measured output selects one basis state ∣t⟩|t\rangle because ff is injective. Its Hadamard transform has amplitude magnitude 1/N1/\sqrt N at every yy, which is the same rule with H0⊥=GH_0^\perp=G and ∣H0∣=1|H_0|=1.

For the displayed n=4n=4 function, reproduce all fibers, the eight-point Fourier support, and the nullspace of rows 0011, 0100, and 1001.

Solution

Evaluating the four output coordinates gives the eight pairs in the worked example, each separated by

1011.1011.

The equal-output character sum is

∑x,x′f(x)=f(x′)(−1)(x⊕x′)⋅y=16[1+(−1)1011⋅y],\sum_{\substack{x,x'\\f(x)=f(x')}} (-1)^{(x\oplus x')\cdot y} = 16\left[1+(-1)^{1011\cdot y}\right],

so it is 3232 on words orthogonal to 1011 and zero otherwise. Dividing by N2=256N^2=256 gives probability 1/81/8 on

0000 0011 0100 0111 1001 1010 1101 1110

The three chosen equations are independent. Solving them over F2\mathbb F_2 leaves one free bit and gives precisely t=0000t=0000 or t=1011t=1011.

Derive Pd,mP_{d,m}, its failure bound, and ETd\mathbb E T_d. Evaluate the three probabilities and the expected time for d=3d=3, and explain why the row reduction must use binary arithmetic.

Solution

A d×md\times m binary matrix has full row rank when its ordered rows successively avoid spans of sizes 1,2,…,2d−11,2,\ldots,2^{d-1}. Out of 2m2^m possible rows at each step,

Pd,m=∏r=0d−12m−2r2m=∏r=0d−1(1−2r−m).P_{d,m} = \prod_{r=0}^{d-1}\frac{2^m-2^r}{2^m} = \prod_{r=0}^{d-1}(1-2^{r-m}).

A union bound over the failed independence steps gives

1−Pd,m≤∑r=0d−12r−m<2d−m.1-P_{d,m} \le \sum_{r=0}^{d-1}2^{r-m} <2^{d-m}.

At rank rr, the probability of increasing rank is 1−2r−d1-2^{r-d}, so

ETd=∑r=0d−111−2r−d=d+∑k=1d12k−1.\mathbb E T_d = \sum_{r=0}^{d-1}\frac1{1-2^{r-d}} = d+\sum_{k=1}^d\frac1{2^k-1}.

For d=3d=3, the products give 21/6421/64, 315/512315/512, and 3255/40963255/4096 at m=3,4,5m=3,4,5, while

ET3=87+43+2=9421.\mathbb E T_3 = \frac87+\frac43+2 = \frac{94}{21}.

This is the finite-field instance of the kernel, image, rank, and rank–nullity language developed in Mathematical Toolkit Linear Maps. The present exercise specializes that structure to row reduction over F2\mathbb F_2.

Derive the exact no-collision probability for qq distinct random addresses and explain why it gives an O(N)O(\sqrt N) bounded-error algorithm.

Solution

For fixed nonzero ss, the NN addresses form N/2N/2 disjoint pairs. A collision-free qq-subset chooses qq of those pairs and one of two endpoints in each, so the number of favorable subsets is 2q(N/2q)2^q\binom{N/2}{q}. Dividing by all (Nq)\binom Nq subsets gives

pmiss(N,q)=2q(N/2q)(Nq).p_{\mathrm{miss}}(N,q) = \frac{2^q\binom{N/2}{q}}{\binom Nq}.

Equivalently,

pmiss(N,q)=∏j=0q−1N−2jN−j.p_{\mathrm{miss}}(N,q) = \prod_{j=0}^{q-1}\frac{N-2j}{N-j}.

For q=cNq=c\sqrt N, its logarithm is bounded above by

−∑j=0q−1jN−j=−Θ(c2),-\sum_{j=0}^{q-1}\frac{j}{N-j} = -\Theta(c^2),

so a sufficiently large constant cc makes the miss probability at most any fixed error. A collision reveals ss; without one the procedure returns zero.

Prove the pairwise-difference lower bound and split-subspace upper bound. Then establish D(Simon⁡4)=6D(\operatorname{Simon}_4)=6.

Solution

With qq queried addresses, at most (q2)\binom q2 nonzero XOR differences have been exposed. If this is less than N−1N-1, some nonzero ss is absent, and a collision-free transcript is compatible with both an injective oracle and a promised oracle having mask ss. Thus

(q2)≥N−1.\binom q2\ge N-1.

For the upper bound, query

A=F2⌊n/2⌋×{0},B={0}×F2⌈n/2⌉.A=\mathbb F_2^{\lfloor n/2\rfloor}\times\{0\}, \qquad B=\{0\}\times\mathbb F_2^{\lceil n/2\rceil}.

Every s=(u,v)s=(u,v) is the difference of (u,0)∈A(u,0)\in A and (0,v)∈B(0,v)\in B, and the union has 2⌊n/2⌋+2⌈n/2⌉−12^{\lfloor n/2\rfloor}+2^{\lceil n/2\rceil}-1 elements.

At n=4n=4, the lower bound requires (q2)≥15\binom q2\ge15, hence q≥6q\ge6. The set

{0000,1000,0100,0010,0001,1111}\{0000,1000,0100,0010,0001,1111\}

has six elements and fifteen distinct nonzero pairwise XOR differences, so it attains the bound. Therefore D(Simon⁡4)=6D(\operatorname{Simon}_4)=6.

Why verification needs enough independent equations

Section titled “Why verification needs enough independent equations”

In the three-bit example from the figure, suppose the only independent sample is y=010y=010. List the possible null words. If you test t=001t=001 and find f(t)≠f(000)f(t)\ne f(000), may you conclude that the function is injective?

Solution

The equation is s2=0s_2=0, so the nullspace contains 000,001,100,101000,001,100,101. Testing t=001t=001 gives f(001)=010≠000=f(000)f(001)=010\ne000=f(000), although the true period is 101101. This excludes only the tested candidate. Once the row rank is n−1n-1, there is just one nonzero null word and a failed test excludes every nonzero period allowed by the samples. Below that rank, other candidates remain. Conversely, under the promise, any nonzero tt with f(t)=f(0)f(t)=f(0) establishes the period immediately, regardless of the sample rank.

  • G. Brassard and P. Høyer, “An Exact Quantum Polynomial-Time Algorithm for Simon’s Problem,” Proceedings of the Fifth Israeli Symposium on Theory of Computing and Systems, 12–23 (1997), doi:10.1109/ISTCS.1997.595153.
  • G. Cai and D. Qiu, “Optimal Separation in Exact Query Complexities for Simon’s Problem,” Journal of Computer and System Sciences 97, 83–93 (2018), doi:10.1016/j.jcss.2018.05.001.
  • A. M. Childs and W. van Dam, “Quantum Algorithms for Algebraic Problems,” Reviews of Modern Physics 82, 1–52 (2010), doi:10.1103/RevModPhys.82.1.
  • P. Koiran, V. Nesme, and N. Portier, “A Quantum Lower Bound for the Query Complexity of Simon’s Problem,” Automata, Languages and Programming, LNCS 3580, 1287–1298 (2005), doi:10.1007/11523468_104.
  • A. Nayak, “Deterministic Algorithms for the Hidden Subgroup Problem,” Quantum Information and Computation 22, 755–769 (2022), doi:10.26421/QIC22.9-10-3.
  • M. A. Nielsen and I. L. Chuang, Quantum Computation and Quantum Information, 10th Anniversary Edition, Cambridge University Press (2010), doi:10.1017/CBO9780511976667.
  • D. R. Simon, “On the Power of Quantum Computation,” Proceedings of the 35th Annual Symposium on Foundations of Computer Science, 116–123 (1994), doi:10.1109/SFCS.1994.365701.
  • D. R. Simon, “On the Power of Quantum Computation,” SIAM Journal on Computing 26, 1474–1483 (1997), doi:10.1137/S0097539796298637.