Shor’s Algorithm
Anita S. V.
Freeman Dyson
For me, the important thing about quantum mechanics is the equations, the mathematics. If you want to understand quantum mechanics, just do the math. All the words that are spun around it don’t mean very much. It’s like playing the violin. If violinists were judged on how they spoke, it wouldn’t make much sense.
Church-Turing Thesis
Every computing machine is necessarily within polynomial reductions from Turing machine.
But that was assuming classical physics, with quantum mechanics we believe this is broken. Many classically hard problems like factoring of a number is polynomial on a quantum computer when best known classical algorithms are exponential on number of bits.
There is also reasonable evidence probabilistic algorithms can be faster but a proof seems elusive. Discovery of AKS primality has cast doubt on this.
Quantum Mechanics - Informally
Superposition Principle: Any two valid state can be simultaneously possible. (With varying complex weights). The combined state will “behave” in some sense between those two components.
Correspondence Principle: Any classically understood state “behaves” classically. (Similar to Transfer principle)
Hilbert Space
It is a vector space over complex number field, together with an inner product definition. Inner product can be thought of as something that expresses separation between the vector. (Similar to dot product for real vectors)
||a||2 = (a, a) ≥0 for all vectors. And linear on second operator.
(a, b) = (b, a)*
(a, λb) = λ(a, b)
(a, b+c) = (a, b) + (a, c)
Dual Space
We can observe, the space of linear functionals f : X -> C as a hilbert space. (trivially has same dimension).
Define, dual (a) = fa, such that fa(b) = (a, b). We now have a dual hilbert space by defining its inner product as (fa,fb) = (b, a)
The elements of our main space will be denoted as |a⟩, ket-vector. and its dual will be written as ⟨a|, bra-vector, then we can conveniently define (a, b) = ⟨a|b⟩
Outer Product, |a⟩⟨b| is defined as linear operator X->X, (|a⟩⟨b|) |x⟩ = |a⟩(⟨b|x⟩)
Concretely speaking
Complex column vectors of size n, is an n-dimensional complex vector space. We augment an inner product as follows to make it a Hilbert Space:
(a, b) = a†b
Realization: ⟨a| is simply a†. We will reserve dagger for linear operators from now.
Note: Every hilbert space can be converted to a column matrix using a basis.
Definitions.
Note that, (a, A b) = (A†a, b)
Hermitian operator if self adjoint. (H† = H).
Unitary operator if preserves inner product. (U†U = UU† = I)
Normal operator if (A†A= AA†). Trivially both unitary and hermitian are normal operators.
If A|a⟩ = λ|a⟩ then, |a⟩ is an eigenvector of A, and λ is an eigenvalue of A.
Positive operator if A satisfies ⟨a|A|a⟩ ≥0 for all |a⟩. Positive definite if equality only for 0 vector.
Quantum Mechanics - Formally.
Qubit
Irrelevance of global phase!
Pauli Matrices - Basic Gates
If n is a real unit vector on 3D space, that represents n · 𝜎 = nxX + nyY + nzZ
Define: Rn(θ) = exp(iθ(n · 𝜎)/2) = cos(θ/2) I + i sin(θ/2) (n · 𝜎)
Hadamard, Phase and T gates.
T is also called 𝜋/8 gate.
Important Results.
If A is hermitian, its eigenvalues are real, and eigenvectors are orthogonal (for unequal eigenvalue). The space generated by eigenvectors with nonzero eigenvalues is called support of the hermitian.
Definition: Diagonalizable if A can be written as sum of a|a⟩⟨a|, where a is eigenvalue and |a⟩ is corresponding eigenvector. And each of {|a⟩} must be orthonormal to each other.
Spectral Decomposition Theorem: An operator is normal if and only if diagonalizable.
AA† is a positive operator. All positive operators are hermitian. And hence all eigenvalues are non-negative for a positive operator.
Function of Hermitian.
If f is analytic at eigenvalues, we can easily see f(A) = 𝝨f(a)|a⟩⟨a|
In case f is defined on eigenvalues of A, we can still use it from a “definition” perspective, but may not “carry” algebraic features from complex space to hilbert space.
For a positive operator A, define √A = 𝝨√a|a⟩⟨a|, verify that √A √A = A. (Note this doesn’t not mean X2=A has only one or even 2n solutions, Note that it is has even an entire space when A = I for example.)
Verify that exp(iH) = U, where H is hermitian, and U is unitary, and this is the Schrodinger’s equation.
No-Cloning Theorem
Controlled NOT = CNOT (XORish)
Swap using CNOT
Control and Target reversal
Tensor Product
z(|a⟩⊗|b⟩) = (z|a⟩)⊗|b⟩ = |a⟩⊗(z|b⟩)
(|a⟩+|b⟩)⊗|c⟩ = |a⟩⊗|c⟩ + |b⟩⊗|c⟩
|c⟩⊗(|a⟩+|b⟩) = |c⟩⊗|a⟩ + |c⟩⊗|b⟩
(A⊗B)(|a⟩⊗|b⟩) = A|a⟩⊗B|b⟩
Controlled Unitary.
Every unitary matrix for a single qubit can be written as U = eiαAXBXC, where A,B,C are unitary, α real, such that ABC = I.
Proof:
Controlled Unitary cont’d
C
X
B
X
A
1 0
0 eiɑ
Toffoli Gate (NANDish)
Implementing Toffoli using H, T and S.
Bell States (Entangled states)
|𝛽00⟩ = (|00⟩ + |11⟩)/√2
|𝛽01⟩ = (|01⟩ + |10⟩)/√2
|𝛽10⟩ = (|00⟩ - |11⟩)/√2
|𝛽11⟩ = (|01⟩ - |10⟩)/√2
Quantum Computation Theorems.
Universality of CNOT: Every n-qubit unitary operator can be implemented by CNOT gate and all single qubit gates.
Approximation Theorem: Every n-qubit unitary operator can be approximated arbitrarily by CNOT gate and H,T (or Toffoli), and S gates.
Quantum Fourier Transform
Quantum Phase Estimation
Order Finding
Where r is order of x, least r such that xr ≡ 1 (mod N).
Application: Order finding
But, the big problem is preparing eigenstate, which is impossible owing to fact we don’t know r. So we note (1/√r) Σ|us⟩ =|1⟩. as the second register. Now with 1/r probability we will get an eigenstate. So phase will be s/r with probability (1-ε)/r. Now to find actual r, we note that at sufficiently high accuracy, s/r is a continued fraction of estimate. (Non trivial theorem).
Application: Factoring
If x2 ≡ 1 (mod N), such that x is not 1 or N-1. gcd(x-1, N) or gcd(x+1, N) is a non trivial factor of N. If N is odd composite non prime power, a random coprime a, will have an even order with high probability. So we will get ax/2 as a solution. Retry until we get a solution. So factoring reduces to order finding. (For even N, power of prime, we got trivial mechanisms, especially owing to factor primality is polynomial in time).
Hidden Subgroup Problem
Let f be a function from a finitely generated group G to a finite set X such that f is constant on the cosets of a subgroup K, and distinct on each coset. Given a quantum black box for performing the unitary transform U|g⟩|h⟩ = |g⟩|h+f(g)⟩, for g ∊ G, h ∊ X, and + an appropriately chosen binary operation on X, find a generating set for K.
Most important Quantum Algorithms
Important from technical perspective (no application): Deutsch Jozsa Algorithm, Simon’s Algorithm.
References - Papers
References - Books