smartyfy.mrindigi.com

Quantum Computing Master Course — 065. Simon Problem

Lesson 065: Simon Problem

Smartyfy Quantum Computing Master Course

Prerequisites and objectives

Simon’s problem hides a binary period in a function whose equal outputs occur in pairs. The quantum circuit does not immediately print the period. Instead, each run samples a linear equation that the period satisfies. You will derive that distribution, solve a small example, and understand why repeated independent equations and classical postprocessing are necessary.

For this lesson, n is at least two and the hidden string s is nonzero. The oracle function maps n-bit strings to n-bit strings and obeys f(x)=f(x′) exactly when x′=x or x′=x⊕s. Thus every output in its image has precisely two preimages.

The hidden-XOR promise

The operation x⊕s flips exactly the positions where s has ones. Since s≠0, it maps each x to a different partner, and applying it twice returns x. The input domain is partitioned into 2^(n−1) disjoint pairs.

The promise has two directions: partners have equal outputs, and different pairs have different outputs. Merely requiring f(x)=f(x⊕s) would allow additional collisions that change the algorithm’s analysis. State both conditions when defining a Simon oracle.

Some formulations additionally allow s=0, corresponding to an injective function. That is a broader promise with a different final identification case. We exclude it here so that, after n−1 independent equations are collected, their nullspace (the binary strings satisfying all those equations) consists of zero and the unique nonzero hidden period.

Prepare and query

Use an n-qubit input register and an n-qubit output register, initially both zero. Apply H to every input qubit, then the reversible oracle Uf|x,y⟩=|x,y⊕f(x)⟩. The joint state becomes 2^(−n/2)Σx|x⟩|f(x)⟩.

For analysis, measure the output register. If its result is f(x0), exactly two input branches survive: x0 and x0⊕s. The normalized input state is (|x0⟩+|x0⊕s⟩)/√2.

Each image value occurs with probability 2/2ⁿ. The observed output label does not itself reveal which partner was present or directly reveal s. Its role is to isolate a coherent two-element input pair.

Derive the sampled equation

Apply H to every input qubit. For an output string z, its amplitude becomes [ (−1) raised to x0·z + (−1) raised to (x0⊕s)·z ] divided by √(2×2ⁿ).

Binary distributivity factors this into (−1) raised to x0·z times [1+(−1) raised to s·z] divided by √(2×2ⁿ). If s·z=1, the bracket is zero. If s·z=0, it is two.

Therefore measuring the input gives a uniformly random z satisfying s·z=0, with probability 1/2^(n−1) for each allowed string. The phase depending on x0 disappears when probabilities are taken, so the distribution is independent of which output label was measured.

Output-register measurement is convenient for the proof but is not required operationally. If the output register is left unmeasured and only the input is read after its Hadamards, averaging over the orthogonal output labels gives the same distribution.

Worked example with s=101

Choose the following three-bit function. Assign distinct output labels to pairs differing by 101. Output labels are arbitrary provided the pairing promise holds.

A valid three-bit Simon oracle with hidden period 101
Input pair x and x⊕101 Shared output f(x)
000 and 101 000
001 and 100 001
010 and 111 010
011 and 110 011

If the output measurement gives 000, the input becomes (|000⟩+|101⟩)/√2. The allowed input measurement results after the final Hadamards satisfy z₂⊕z₀=0.

They are 000,010,101,111, each with probability one quarter. The strings 001,011,100,110 have probability zero. Notice that one allowed result happens to equal s, but the algorithm is not guaranteed to sample s directly, and that coincidence is not the recovery rule.

Recover the period from several equations

Suppose separate runs return 010 and 101. The first equation says s₁=0. The second says s₂⊕s₀=0. Their solution set is {000,101}. The nonzero-period promise selects 101.

A sampled 000 gives the equation 0=0 and adds no information. A repeated equation also adds no rank. More generally, equations can be dependent even when their bit strings differ: 010 XOR 101 =111, so adding 111 after those two does not supply a new constraint.

One needs n−1 independent equations for this nonzero-period case. Since the samples are random, obtaining n−1 outcomes is not the same as obtaining n−1 independent constraints. The next lesson develops binary elimination and rank tests.

Four input pairs differing by XOR 101 map to distinct shared labels. The sampled equation distribution is uniform on 000, 010, 101, 111, each probability 1/4, and zero elsewhere. Samples 010 and 101 impose s1=0 and s2 XOR s0=0, yielding candidates 000 and 101; the nonzero promise selects 101. Sample 111 is their XOR and adds no rank.
Independent constraints identify the period. Counting samples alone is insufficient because zero, repeated or dependent rows add no new constraint. Open full-size diagram

Query advantage and its boundaries

The allowed sample space has dimension n−1 over the two-element field. Independent runs produce enough independent equations with an expected number of queries proportional to n, followed by polynomial-time binary linear algebra. Additional samples can raise the confidence of reaching full rank.

In the standard opaque-oracle model, classical randomized methods require exponentially many queries in n for Simon’s problem in the worst-case bounded-error sense, with collision-based scaling on the order of 2^(n/2). This contrasts with the quantum polynomial-query procedure.

The separation relies on the promise and access model. A short explicit formula might reveal s by inspection; a toy oracle generator certainly knows how it constructed the pairs. The classical solver must be compared under the same hidden-information assumptions.

This oracle result is stronger than the exact-versus-randomized comparison in Deutsch-Jozsa, but it still does not by itself prove an unconditional separation of ordinary BPP and BQP.

Validation and failure diagnosis

For a small supplied table, verify that every input has exactly one distinct collision partner and that all partner differences equal the same nonzero s. A function with four-element collision classes violates the stated promise even if one period relation holds.

In an ideal simulation, every sampled equation must satisfy z·s=0 when checked against the test generator’s known period. That check belongs to validation, not to the solver’s allowed knowledge. Physical noise can produce inconsistent equations, requiring an explicitly different statistical recovery procedure.

Four exercises with worked solutions

  1. For hidden s=101, is z=011 allowed?

    Solution. The binary dot product is 1×0⊕0×1⊕1×1=1. It is not allowed and has probability zero in the ideal distribution.

  2. What constraint does z=000 supply?

    Solution. It gives zero dot s equals zero for every candidate s. It is a valid outcome but adds no independent information.

  3. After equations 010 and 101, does equation 111 increase rank?

    Solution. No. It is their XOR, so its constraint follows from the previous two. The rank remains two.

  4. For n=4, what is each allowed equation’s probability and how many independent constraints are required?

    Solution. There are 2³=8 allowed strings, each with probability 1/8. Three independent constraints determine a one-dimensional solution space whose nonzero member is s.

Five explained multiple-choice questions

  1. One ideal Simon run returns: A. A classical collision pair directly. B. A uniformly random equation label z with z·s=0. C. Every function value. D. The period with certainty.

    Answer: B. The measurement samples a constraint rather than the answer itself.

  2. The nonzero-period promise makes f: A. Exactly two-to-one on its image. B. Constant. C. Injective. D. Arbitrarily many-to-one.

    Answer: A. Each input is paired uniquely with x⊕s.

  3. The zero equation is: A. Proof that s=0. B. A noisy error necessarily. C. Valid but uninformative. D. Impossible.

    Answer: C. Zero is orthogonal to every binary string.

  4. n−1 sampled outcomes always suffice: A. Only when every target bit is measured. B. Because samples cannot repeat. C. Because all outcomes are nonzero. D. No, their equations may be dependent.

    Answer: D. Recovery requires rank n−1, not merely that many records.

  5. The oracle separation establishes: A. A universal hardware speedup. B. An advantage under the specified hidden-XOR access model. C. P≠NP. D. That all explicit functions hide their periods.

    Answer: B. Promise and access assumptions determine the theorem’s scope.

Pitfalls and summary

State the exact collision promise, retain coherent pairs, and collect independent binary constraints. The algorithm’s information comes from interference within each pair. Uniform equation sampling plus classical elimination recovers the hidden period under the ideal assumptions.

Primary sources and further study

These sources support the definitions and context. The numerical examples, exercises, and explanations here were prepared for this lesson. Research papers are optional advanced reading.