QSWE
  • Welcome
  • Algorithms
    • BB84
    • Bell Inequality
    • Deutsch
    • Bernstein-Vazirani
    • Simon
  • Code
    • CirQ
      • BB84
      • Bell Inequality
      • Deutsch
      • Bernstein-Vazirani
      • Simon
  • Contact
Powered by GitBook
On this page
  • Objective
  • Classical protocol
  • Quantum protocol
  • Expectation vs Reality
  1. Algorithms

Simon

First demonstration of exponential speedup

PreviousBernstein-VaziraniNextCirQ

Last updated 2 years ago

Simon's algorithm is the first real demonstration of quantum algorithms providing an exponential speedup over classical algorithm. Both and algorithms that we have seen so far provide a linear speedup over classical algorithms going from O(n) to O(1).

Objective

We are given an unknown function f, which is guaranteed to be map exactly two inputs to every unique output, using a hidden bitstring, b, such that :

f(x1)=f(x2)ifx1⊕x2=bf(x_1)=f(x_2) \hspace{5mm} \text{if} \hspace{2mm} x_1 \oplus x_2 = bf(x1​)=f(x2​)ifx1​⊕x2​=b​

So we want to identify b.

Classical protocol

In the worst case, we have to query the function with 2n−1+12^{n-1} +12n−1+1 different inputs (n is the number of bits in the input) i.e. checking just over half of all the possible inputs until we find two cases of the same output.

Quantum protocol

The Simon oracle takes as input ∣x⟩∣0⟩|x\rangle |0\rangle ∣x⟩∣0⟩​and returns ∣x⟩∣Perm(x⊕b)⟩|x\rangle|\text{Perm}(x\oplus b)\rangle∣x⟩∣Perm(x⊕b)⟩​where Perm is any fixed bitwise permutation. Perm(x⊕b)\text{Perm}(x\oplus b)Perm(x⊕b)​has the same value for two values of x that satisfy the .

  1. Prepare 2n qubits in ∣0n⟩∣0n⟩|0_n\rangle|0_n\rangle∣0n​⟩∣0n​⟩, i.e n input and n output qubits.

  2. Apply Hadamard gates to all input qubits. This create a equiprobable superposition of all possible input combinations, i.e ∣ψ⟩=∑∣Xk⟩|\psi\rangle = \sum |X_k\rangle∣ψ⟩=∑∣Xk​⟩ up to some normalization constant.

  3. Query the oracle with input qubits. The oracle effectively acts on all possible input combinations at the same time. The output is written on the output qubits using CNOT gates.

  4. Apply Hadamard gates to the input qubits. This destructively interferes for all input states ∣Xk⟩|X_k\rangle∣Xk​⟩where Xk⊕sX_k\oplus sXk​⊕s is odd and destructively interferes for all ∣Xk⟩|X_k\rangle∣Xk​⟩where Xk⊕sX_k\oplus sXk​⊕s is even.

  5. Measure all input qubits. The result is one of the possible XkX_kXk​ i.e. Xk⊕s=0X_k\oplus s=0Xk​⊕s=0.

  6. If we repeat this experiment n times, we get n different values for XkX_kXk​. Solve the linear system of equations Xnk⋅s=0X_{nk}\cdot s = 0Xnk​⋅s=0 to find s.

Expectation vs Reality

The classical complexity required goes from O(n) in the BV algorithm to O(2^n) in the Simon problem. In comparison, the quantum complexity goes from O(1) to O(n), making this the first demonstration of a true exponential advantage of quantum computers over classical algorithms.

While Deutsch, BV and Simon algorithm's are important form a historical and theoretical perspective, they have little practical utility since each requires the existence of a very contrived oracle function.

Simon algorithm is very similar to and algorithm. Once again we have simply changed the definition of the oracle function making it much harder to solve.

Deutsch
Bernstein-Vazirani
objective condition
Bernstein-Vazirani
Deutsch