- Variational Quantum Algorithms (VQA)
- Quantum Approximate Optimization Algorithm (QAOA)
- Quantum Annealing
- QAOA – continued
- QAOA – Max Cut Example
- Appendix A: Formulate the TSP Problem unitarily
- Appendix B: Time Evolution of Quantum States
- Appendix C: Approximating Arbitrary Unitary Gates
Variational Quantum Algorithms [3], [4]
Quantum supremacy in the era before fully error-corrected quantum computers: NISQ (noisy intermediate-scale quantum) – computers, ranging up to a couple of 1000 (physical) qubits, essentially limited by noise, e.g. [1], but also note [2]
To obtain quantum advantage on NISQ computers: Variational Quantum Algorithms (VQAs)
Variational Quantum Algorithms start on an input state |0>⊗n, and then alternate between a quantum and a classical part. Consider optimization problems on bit-strings of the form minxϵ{0,1}n f(x) with F the set of optimal solutions. Examples for this kind of problems are Knapsack (choose items for best (monetary) value without excess weight), Traveling Salesperson (find the shortest path through a graph, see Appendix A regarding the formulation), and Spin Glass (find the lowest energy state in physics models, see later in this blog). There are three main parts (detailed explanations will follow below):
• a parametrized quantum circuit U(θ): Rd → M2n(C)
• a guiding function g: Rd → R
• a (classical) algorithm A optimizing g over Rd
Starting with a θ in Rd, the quantum circuit U(θ) is executed multiple times giving a sample quantum state with a probability distribution over {0, 1}n, {pθ(x) : x ∈ {0, 1}n}. The guiding function g assigns a ‘cost’ to this state were g(θ) = G(pθ,f(x)) with pθ(x) > 0 for a given function G. This cost is then given to A, optimizing g to a minimum, forcing pθ to concentrate around minimizers of f and resulting in a new θ, then mapped via U to states that are an optimal solution of f which can then be retrieved by a measurement. With that also some issues arise: U(θ) needs to be able to reach a distribution concentrated on the optimum for some θ, and g(θ) could have local minima and/or barren plateaus
Quantum Part
Recall: gates acting on the same qubits are a series of (unitary) matrix multiplications; gates acting on different qubits are related via the tensor product
A parametrized quantum circuit is a continuous function U: Rd → M2n(C) mapping any θ ∈ Rd to a unitary matrix U(θ)
A universal quantum gate set is a collection of basic quantum operations that can approximate any arbitrary unitary transformation or quantum algorithm as close as needed. The set of one-qubit gates together with the CNOT (CX) gate are universal, and any one-qubit gate is the composition of rotation gates R (on the Bloch sphere), see Appendix C:


θ in R. Note the connection to the Pauli matrices, e.g. Rx(θ) = cos(θ/2) I – i sin(θ/2) σx = exp(-iθσx/2), hence Rx(θ) is in SU(2) (Lie group of unitary matrices)
Classical part
The classical part is characterized by two aspects: the function that guides the optimization and the optimizer itself
Let F be the normalized quantum states with amplitudes only on feasible basis states (i.e. superpositions of optimal solutions to the problem minxϵ{0,1}n f(x)):

Let g: Rd → R be a function and G be the set of minimizers for g. g is a guiding function for f with respect to U if g is continuous and {U(θ)|0>⊗n: θ ∈ G} ⊆ Fquant
Hence every parameter θ that globally minimizes g must produce a circuit output supported only on optimal solutions of f. So minimizing g classically guarantees to recover minimizers of f. In other words: sample from U(θ), optimize g(θ) classically towards G, and by reaching G one finds a superposition of optimal solutions to the original problem. Note that there are no details on F, hence U needs to be able to reach any n-qubit state, ensured by universality of quantum gates!
How to find meaningful guiding functions? It holds that the mean function

with pθ(x) = |<x| U(θ) |0>⊗n|2 the probability of finding x when U(θ) |0>⊗n is measured, is a valid guiding function (for a formal proof, see [3])
3-qubit example:

Note: no entanglement! With cos(θi/2 – π/2) = cos(π/2 – θi/2) = sin(θi/2):

hence

and the probability to measure x in {0,1}3 is

Once you know gmean is a guiding function, a classical optimizer can minimize the continuous and differentiable function, e.g. via gradient descent (e.g. [10]), instead of searching directly over the exponentially large discrete space {0,1}ⁿ. Driving θ towards a minimizer of gmean it is guaranteed (by construction) to drive the circuit’s output distribution towards concentrating on optimal solutions of the actual combinatorial objective f! To see this, let’s calculate an easy example using this 3-qubit state circuit:
x1 should be close to 1, x2 close to 0, x3 close to 1: f = (1-x1) + x2 + (1-x3) = 2 – x1 + x2 – x3
Hence the obvious minimal solution by brute force results in f = 0 for x = (1,0,1)
gmean?
Since f is linear (i.e. qubits are separate) and the expectation E is linear it holds with qubit i prepared as the state RY(θi)|0> = cos(θi/2)|0> + sin(θi/2)|1>, i.e. P(xi=0) = cos2(θi/2), P(xi=1) = sin2(θi/2) and therefore, E[xi] = 0⋅P(xi=0) + 1⋅P(xi=1) = P(xi=1):
gmean(θ) = E[f] = 2 – E[x1] + E[x2] – E[x3] = 2 – sin2(θ1/2) + sin2(θ2/2) – sin2(θ3/2) which is minimal for gmean(θ) = 2 – 1 + 0 – 1 = 0 = fmin
and recalling the Bloch sphere: those angles where cos and sin hit 0 or 1 are exactly the values, where the circuit output collapses to a single deterministic state, here |101>. Hence the minimizers of g in G did map to Fquant!
Quantum Approximate Optimization Algorithm [3]
As we will see: QAOA is a specific realization of VQA. There will be a problem Hamiltonian for the actual combinatoric optimization problem, controled by a parameter γ. In addition a ‚mixer‘ Hamiltonian will be introduced for exploring the possible solution space, controlled by β. The circuit will be set up in p layers, applying both hamiltonians alternately. The parameters to be optimized classically will be (γ1β1, …,γpβp). The realization of QAOA is (NISQ-)quantum gate-based. So, let’s see:
Reformulate minxϵ{0,1}n f(x), assuming f(x) is polynomial and can be interpreted as a Hermitian Hamiltonian: Hf|ux> = f(x)|ux>, with Hf a Hermitian matrix, x in {0,1}n, looking for the lowest eigenvalues of Hf as solutions to the original problem. Construct Hf:
Because of xi in {0,1}n: xi2 = xi, and no variable has an exponent >1. With a = (a1,a2,…, an) in {0,1}n, the polynomial f can be written as

S all subsets Sa := {i: ai = 1} ⊆ [n],
S⊆[n] means a subset of the index set {1, …, n} (e.g. for n=3, [n]= {1,2,3} and the possible subsets are ∅,{1},{2},{3},{1,2},{1,3},{2,3},{1,2,3}, 2n of them, matching the 2n possible a ∈{0,1}n, such that each a is just the indicator vector of one such subset Sα, or in other word a → Sa is a bijection between {0,1}n and the 2[n] set of subsets (each of the 2n binary strings corresponds to exactly one subset), hence summing over all a∈{0,1}n is the same as summing over all subsets S⊆[n]) and ai = 0 factors do drop out, since xi0 = 1, hence each term is just the product of xi over the subset Sa
In addition: define zi = 1 – 2xi (xi = 0 → zi = 1, xi = 1 → zi = -1, which is bijective and linear, hence invertible in each variable independently): xiai = xi for ai = 1 and 1 for ai = 0, the same as for zi: ziai = zi for ai = 1 and 1 for ai = 0. But those are the eigenvalues of Pauli σz-operators on the computational basis: σz |xi> = (-1)xi |xi> = zi |xi>. Since also zi2 = 1, one gets again a unique polynomial, just with new real coefficients. Values minimizing minxϵ{0,1}n f(x) also minimize minzϵ{-1,1}n f’(z), with

and ha in R for every a in {0,1}n. This is the so-called QUBO – Ising equivalence, leading to an QAOA (cost ‚Spin Glass‘) Hamiltonian. With that: zi → σzi leads to

where σzi applies σz to the ith qubit
Note: σzi commute and are Hermitian and diagonal in the computational basis
Recall: the computational basis of a n-qubit Hilbert space are the 2n states |x> = |x1>⊗ … ⊗|xn>, x in {0,1}n. With σz |xi> = zi |xi>:

Since |x> is an orthonormal basis and Hf is diagonal (built only from σz’s) with |x> as eigenvectors, Hf’s 2n-dimensional matrix representation is Hf = diag(f(x))x in {0,1}n
Hence the classical cost function f(x) is mapped to the spectrum of Hf!
Example: minxϵ{0,1}2 f(x)) = x1 + 2x2 + 3x1x2
With zi = 1 – 2xi : minzϵ{-1,1}2 f′(z)) = 1/4 z1 – 1/4 z2 – 4/4 z1z2 + 3/4 , hence Hf = 1/4 σz⊗I – 1/4 I⊗σz – 3/4 σz⊗σz + 3/4 I⊗I
E.g. Hf |10> = 1/4 (σz⊗I) |10> – 1/4 (I⊗σz) |10> – 3/4 (σz⊗σz) |10> + 3/4 (I⊗I) |10> = 1/4 (-|1>⊗|0>) – 1/4 (|1>⊗|0>) – 3/4 (-|1>⊗|0>) + 3/4 (|1>⊗|0>) = – 1/4 |10> – 1/4 |10> + 3/4 |10> + 3/4 |10> = |10> = f(1,0) |10> , since f(1,0) = 1
Before continuing with QAOA, let’s introduce another, theoretically similar, approach:
Quantum Annealing
A different architecture to universal gate-model computer (and hence QAOA): quantum annealers, which are less flexible then general error-corrected gate quantum computers, but more stable and available today focusing on solving NP-hard problems. This approach is realized on specific analogous Quantum Annealing hardware and is continuous in time. Prerequisite:
Adiabatic Theorem (see e.g. [10] and Appendix B)
Be H the Hamiltonian describing a quantum system. If H is in its ground state, it will stay there even if H is changing ‘slowly’ enough (and by changing H the quantum system it describes is changing to a more complex one, but still in its ground state (although a different one)). Slowly enough is here characterized by the so-called minimum gap, i.e. the energy difference of the ground state and the first excited state during the system evolution: ∆(t) = E1(t) – E0(t)
Therefore:
•Choose Hi so, that the initial ground state can be easily set up
•Choose Hp so that its ground state encodes the answer to the problem at hand
•Start with H(t) = Hi in the ground state |ψ0(Hi)> and evolve H(t) slowly to H(T) = Hp with the ground state |ψ0(Hp)> , being the bit string minimizing the problem’s cost function
How to choose Hi and Hp?
Recall: we set the convention to work with qubits in the computational basis |0> and |1>, which is an eigenbasis of σz: σz|0> = +|0>, σz|1> = -|1>, i.e. any measurement will be along those axis
With this choice (e.g. instead of |+>, |->) every other operator is either along these axis (hence commuting with σz and hence diagonal in the computational basis) or ‘transverse’ (doesn’t commute with σz, e.g. σx)
What does this mean for the problem Hamiltonian Hp?
For a quadratic unconstrained binary optimization problem (QUBO) the classical cost function looks like (quadratic in s):

si in {0,1}, Jij describing the coupling of qubit i and j, hi describing the strength of qubit i (analogously: ‘Ising’ spin function with si = {-1,+1} instead of {0,1}).Translated to a Hamiltonian:

Since σzi is diagonal in |0>, |1>, so is any product/sum of σzi’s and any computational basis state |s1s2…sn> is diagonal and hence already an eigenstate of Hp! Therefore, by construction, the ground state of Hp is the computational basis state with minimum cost
So Hp is diagonal, what about Hi? If Hi would also be diagonal in the computational basis, not much would happen, it would just biases which of |0> and |1> is lower in energy, no quantum effects. Hence choose

since σxj anticommutes with σzj, meaning the Hi term does not commute with the diagonal Hp Hamiltonian (introducing quantum effects like tunneling and superposition, see below)
The easy to set up ground state of Hi would then be the uniform superposition |+>⊗n (easy compared to the Hp ground state describing the solution to some complex cost function and hence not ‘easy’ to initialize (otherwise you would have already a solution 😊))
Bringing everything together for n qubits:

with A(0) = 1, A(T) = 0, B(0) = 0, B(T) = 1
Note the i<j: σziσzj = σzjσzi are the same operator, since Pauli operators acting on different qubits commute, i.e. σzi⊗σzj and σzj⊗σzi describe the identical coupling Jij between qubits i and j
An overview of some Quantum annealing hardware providers can be found in [11], chapter 3
Example n = 2:
Hi = -(σx1 + σx2) = – (σx⊗I + I⊗σx)
Hp = -J12 σz1σz2 – h1σz1 – h2σz2 = -J12 σz⊗σz – h1 σz⊗I – h2 I⊗σz
H(t) = - A(t) (σx⊗I + I⊗σx) – B(t) (J12 σx⊗σx + h1 σx⊗I + h2 I⊗σx)
In the basis |00>, |01>, |10>, |11>: the ‘problem’ B(t) is built from σz’s, hence diagonal:

The (mixer) A(t) is purely off-diagonal, since σx flips bits:

Common choices for A and B are

and hence H(t) evolves smoothly from a purely off-diagonal matrix with a uniform superposition as ground state to a purely diagonal one with a single computational basis vector as ground state (the lowest entries on the diagonal)
Second example: QUBO [12]

x = (x1, …, xn)T, and J is symmetric (since Jij = Jji)
Be C(x1, x2, x3, x4) = – 4x1 – 2x2 – 5x3 – 3x4 + 4 x1x2 + 6 x1x3 + 2 x2x3 + 10 x3x4, xi in {0,1}.
Minimum?
xi are binary, i.e. xi = xi2, hence the linear part can be written as – 4x12 – 2x22 – 5x32 – 3x42, therefore

C(1,0,0,1) = -7 is the minimal solution
Note:
• Due to noise and other uncontrolled interactions with the environment, H(t) being in his ground state comes with a probability (heuristic optimization algorithms rather then deterministic)
• Higher order polynomial unconstrained optimization (PUBO)? One can formulate problems to kth-order, but the number of variables leads to an undesired scaling of the problem size. Alternatively: consider x1x2x3. With y1 := x1x2: y1x3, hence quadratic, but one needs to add a penalty to constrain y1: y1 = 1 only for x1 = x2 = 1, i.e. y1 corresponds to x1 XOR x2. This condition needs to be reflected by a penalty term: since x1, x2, y1 in {0,1}, x12 = x22 = y12 and with that formulate the ansatz: P = c0 + c1x1 + c2x2 +c3y1 + a1x1x2 + b1x1y1 + b2x2y1. Because of e.g. (x1, x2, x3) = (0, 0, 0) follows c0 = 0 (P needs to be 0 in this case), P can be reduced to P = a x1x2 + b(x1 + x2) y1 + c y1. In addition: for (0,0,1) it follows P = d, for (1,1,0) P = a, i.e. a > 0, for (0,1,1) or (1,0,1) P = b+d, so b+d>0 and finally for (1,1,1), P = a +2b +d must be zero, hence b = -(a+d)/2 (why 0? x1=1, x2=2, x1 XOR x2 = 1 = y1, hence x1 XOR x2 is fulfilled and the penalty must be zero!). Set a = 1: b = -2, c=3, leading to x1x2x3 = y1x3 + λ(x1x2 – 2(x1+x2)y1 + 3y1), λ > 1 a penalty scalar. Theoretically this can be used to replace any higher order term to a quadratic polynomial, but with the number of new variables introduced the problem becomes quickly intractable
Constrained optimization problems
Constraints on binary variables cannot be enforced in the QUBO formulation, since there is no mechanism for excluding a subset of bitstrings. Instead, you have to raise the energy for those bitstrings so that they are never optimal.
Consider e.g. x1+x2+x3 = 1, which is equivalent to λ(x1+x2+x3–1)2 = 0, adding to the cost function. The term is strictly positive and only zero (minimal) iff the constraint is met!
Generalized: add the penalty term

to the cost function. What about the constraint x1 + x2 + x3 ≤ 2? Adding auxiliary binary variables, one can write this as x1+x2+x3 = 2–y1–y2. For values violating the original constraint, this equation can never be fulfilled! Rewrite: λ (x1+x2+x3+y1+y2-2)2 = 0, generalizing to the penalty term

W the number of binary auxiliary (‘slack’) variables, with W = b at most)
Note: non-linear constraints cannot be included in the QUBO formalism using penalty functions
Quantum Annealing and quantum tunneling
Back to quantum annealers: as seen, it implements a time-dependent Hamiltonian that interpolates between a trivial ‘driver’ and the actual problem. Annealing is the continuous time version of QAOA (alternating between the mixer and the problem Hamiltonian)

has off-diagonal matrix elements between computational basis states that differ by ‘spin’ flips, namely Pauli σx operator

In an irregular Hp energy landscape (see picture), two nearby local minima can be separated by a ‘classically’ tall barrier of high energy, which can only be overcome by thermal exciting of the given quantum state, the rate depending on the height of the barrier

Here quantum tunneling comes into play, introduced by the off-diagonal elements of the transverse field: the system state can cross the barrier without the ‘thermal hopping’. It holds: if the barriers are tall and narrow, it is likely that the tunneling effect beats the thermal exciting by scaling with polynomial time (compared to exponential time with thermal exciting). For a wide barrier (many spins have to flip simultaneously to cross the barrier and reach the next local minimum), the tunneling rate decreases exponentially, [13]
QAOA – continued [15]
Now let’s return to QAOA. In Appendix A it is shown, that the time evolution of a Hamiltonian can be written as

Writing the Hamiltonian in the form H(t) = (1-t)Hi + tHf (see Adiabatic theorem) and apply the unitary time evolution, the initial state ψ0,i evolves into ψ0,f choosing the time interval [0,1]:

The Trotter approximation gives away the guarantee that the evolution reaches the ground state (only for the number of steps p→∞). In addition: the adiabatic theorem requires a very long and very slow evolution. To address that (in order to get a (realistically) faster result) define the kth layer operator Lk := e-i(1-tk)Hi ∆t e-itkHf ∆t and with that ψ0,f = U(1) ψ0,i ≈ Lp … L1 ψ0,i
Introduce free parameters βk/2 for (1-tk)∆t in the exponent and γk/2 for tk∆t (the 1/2, because we will see, that β and γ are rotation angles!), resulting in U(β,γ) = Lp(βp , γp) … L1 (β1 , γ1)
‘Define’ the lowest energy state when the evolution is truncated after p layer steps: Ψ(p)0,f = Lp(βp , γp) … L1 (β1 , γ1) ψ0,i with the guaranteed optimal solution (only) for limp→∞ Ψ(p)0,f
The starting Hamiltonian for the evolution is

hence the lowest energy state is

and can be created by applying Hadamard gates. Define the pth QAOA-layer as Lp(βp) = Ui(βp)Uf(γp) with


Then it holds
a)

i.e. Ui(βp) corresponds to a series of Rx gates with angle βp on every qubit!
b)




and with that

where CNOT(i,j) means apply CNOT on qubit j controlled by qubit i
For i=j: this only adds a global phase

Bringing everything together, this leads for the pth-layer QAOA operator expressed by gates:

Note: i) CNOT(i,j) [ I⊗Rz(θ) ] CNOT(i,j) corresponds to

and it equals

ii) In general: If x* is an optimal solution for a cost function C(x), then it is also an optimal solution for C(x)/k, with k > 0, since arg minx (C(x)) = arg minx (C(x)/k). Hence if s* is optimal for Hf(s)/k then it is for Hf(s), which is equivalent to rescaling the parameters without changing the optimal solution. But: with the rescaling one can constrain the rotation angles to smaller scales, removing the redundancy due to the 2π periodicity:

QAOA – Max Cut Example
G be a graph, V its vertices, E its edges. U ⊂ V and U’ its complement, and define the ‘cut’ δ(U) as all edges uu’ with |δ(U)| its size. It holds:

if uu’ in E
The Max-Cut Problem: find an U (may not be unique) maximizing |δ(U)|. Two examples to illustrate the problem:

In general, the Max-Cut problem is NP-hard. Include weights per edge:

Define xk = 1 if vertex k in U and xk = 0 if vertex k in U’. Furthermore: for jk in E consider xj(1-xk), which is 1 if j in U and k in U’, 0 otherwise. Define wjk = 0 for vertices j and k not connected by an edge. Then it holds for the cost function C(x), {V} the integer numbered count of vertices:

Change of variables from xi in {0,1} to si in {-1,1} (i.e. xj → 1/2(1-zj), as seen before) and introducing a (-1)-factor to switch from maximizing to minimizing:

(ignoring the constant sum in the last step)
Comparing with the general solution: aij = 1/2 if ij in E, 0 otherwise and bi = 0, hence the scaling coefficient is
k = maxi,j,h=1..n( |aij|, |bh|) = 1/2,
giving

Example for a one layer Max Cut problem given by the graph of vertices V = {0, 1, 2, 3} and edges E = {(0, 1),(1, 2),(2, 3),(3, 0)}.

Appendix A: Formulate the TSP Problem unitarily [5]
A directed graph for the TSP problem with 4 cities:

The weights assigned to the edges are phases of quantum states. These can be represented as

To formulate a unitary matrix: B = (eiAij) and with that, e.g. for ‘city’ 1, i.e. from the first column of B (n = 4 ‘cities’ = 2 qubits):
U1 = eiϕ(1,1) |00><00| + eiϕ(2,1) |01><01| + eiϕ(3,1) |10><10| + eiϕ(4,1) |11><11| which equals

giving U = U1 ⊗ U2 ⊗ U3 ⊗ U4. U has (n-1)! eigenstates (possible unique cycles) with eigenvalues representing the total cost of a tour as phase values, which have to be minimized to find an optimal tour. Hence, normalizing appropriately: minxϵ{0,1}n f(x)! A circuit for solving this can be found here: [6]
Appendix B: Time Evolution of Quantum States [7]
First note, that ‘time’ is not an observable, i.e. not eigenvalues of some operator. Define a time evolution operator
|ψ(t)> = U(t,t0) |ψ(t0)>
Then U needs to obey:
•|ψ(x,t)|2 is a probability density, hence <ψ(t)|ψ(t)> = ∫|ψ(x,t)|2 dx = 1 = <ψ(t0)|ψ(t0)>. This is equivalent to requiring the Hamiltonian to be Hermitian: d/dt <ψ|ψ> = 0 = <∂tψ|ψ> + <ψ|∂tψ> = i/ђ <Hψ|ψ> – i/ђ <ψ|Hψ> = i/ђ <ψ|(H+-H)|ψ> with Hψ(x,t) = iђ ∂t ψ(x,t) being the Schrödinger equation
•U(t0,t0) = 1
•U(t,t0) = U(t,t’) U(t’,t0), which together with U(t0,t0) = 1 is equivalent to U(t,t0) = U-1(t0,t)
From the Schrödinger equation, integrate iђ d/dt U(t,t0) = H(t) U(t,t0) with U(t0,t0) = 1:

and interpreting as an iteration the 2nd order would look like

This leads to the von Neumann series:

with t ≥ tn ≥ tn-1 ≥ … ≥ t1 ≥ t0 (since H(t1) and H(t2) generally do not commute)
In order to decouple the integrals, introduce the time-ordering operator T, reordering H(t1), …, H(tn) in time in descending order. For convenience: ђ = 1, and with 1/i = -i

It holds for ∆t = (t-t0)/p, tk = t0 + k∆t, ∆t small:
U(tk+1,tk) ≈ ei∆t H(tk) ≈ 1 + i∆t H(tk) and hence for p steps splitting the interval [t,t0]

This product gives for the 0th order 1 and for the pth order (i∆t)n H(tkn) … H(tk1) summed over all choices 0 ≤ K1 < … < Kn ≤ p-1. In addition, recall the strict time order (k runs up to p) and the error of ei∆t H approximated by 1 + i∆t H being for each step O(∆t2). Hence for p~1/∆t a total error of O(∆t) occurs, which vanishes for ∆t→0 (p→∞). All together this gives for the above expression

To proceed: Lie Trotter approximation (to first order): first, H(t) = (1-t)Hi + tHf (see the n=2 example in Quantum Annealing chapter) leads to e-i∆t H(tk) = e-i(1-tk)∆tHi – it ∆t Hf
Lie-Trotter approximation: eiA∆t+iB∆t = eiA∆t eiB∆t + O(∆t2), A,B potentially non-commuting operators
Proof: eiA∆t+iB∆t = 1 + iA∆t + iB∆t + O(∆t2) = (1 + iA∆t + O(∆t2)) (1 + iB∆t + O(∆t2)) = eiA∆t eiB∆t + O(∆t2)
With this and choosing A = -(1-tk)Hi, B = -tkHf (again see the n=2 example), and defining Xk := e-i(1-tk)∆tHi exp– it ∆t Hf

Note for line 3: in brackets is exactly the O(∆t2) error at the jth position respectively giving the complete O(∆t2) error sum when building the product of the (Xk+ O(∆t2))
So, finally:

Appendix C: Approximating Arbitrary Unitary Gates [8]
A set of quantum gates is universal, iff any unitary operation can be approximated to arbitrary accuracy by a quantum circuit involving only those gates. The goal is to find a set of unitary transformations, which can be performed efficiently. Be U a unitary 3×3 matrix.
A two-level unitary matrix acts non-trivially on at most two of the n basis vectors, everywhere else it’s the identity, e.g.

Decomposition theorem: any dxd unitary matrix factors into a product of at most d(d-1)/2 two-level unitaries, hence for a joint state (Hilbert-) space of n qubits: 2n(2n-1)/2
If there are two-level unitary matrices U1, U2, U3, such that U3U2U1U = I, then U = U1+ U2+ U3+, where Ui+ are also 2-level matrices. Actually, this holds true and can be generalized to a d-dimensional Hilbert space: U = V1V2…Vk, Vi two level unitary matrices, which can be constructed as described in [8], chapter 4.5.1, with k ≤ (d-1) + (d-2) + … + 1 = d(d-1)/2
Now show that single qubit gates and CNOT together can implement any 2-level unitary matrix on the state space of n qubits
Recall: the binary expansion s = s1s2…sn means s = s1 2n-1 + s2 2n-2 + … + sn 20 = (e.g. n = 4 and s = 11: s1s2s3s4 = 1011)
A ‘Gray code’ is connecting two binary numbers s and t:

Now suppose we want to implement the following two-level unitary transformation for 3 qubits:

with a, b, c, d in C such that

is a unitary matrix. U acts non-trivially only on |000> and |111>, hence the relevant Gray code is

This leads to

1) und 2) become CNOT gates G1, G2, the last the controlled U’:



Note: G1,2 = G1,2+ = G1,2-1 and hence U = (G2G1)+GU’G2G1 = G1G2GU’G2G1, leading to the circuit for U

But there is one problem:
Decomposition theorem → 2n−1(2n−1) = O(4n) 2-level unitaries, each acting on a pair (s,t) of n-bit strings
A Gray code has at most n+1 nodes (i.e. chain length), with n-1 ‘swap’ gates, one controlled U’ gate and n-1 ‘swap-back’ gates to reverse, hence 2(n-1)+1 = O(n); in addition: every swap gate is a CNOT (and once a U’ gate) multi-controlled on up to n-1 qubits, which need to be expressed by single qubit gates and CNOTs, hence another O(n)
So, altogether:
An arbitrary unitary operation of n qubits can be implemented using a circuit containing O(n24n) gates from a continuous universal set of gates, here single qubit and CNOT gates … which is in general not very practicable nor very efficient …
Therefore: try to approximate any unitary operation by a discrete set of gates. First define the meaning of ‘approximate a unitary operation U’. With V the unitary operator actually implemented over the same state space as U, define an error E as E(U,V) = maxψ||U-V||. Performing a measurement this is equivalent to |PU – PV| ≤ 2E(U,V), P being the probability of the results for U and V. The generalization to a sequence of gates behaves linear:

Consider the following discrete, universal set of gates: Hadamard and π/8-gate

Recall the rotation operators expressed by Pauli matrices:


being the rotation operator around the x-axis and analogously

Then, if n = (nx, ny, nz) a real unit vector in 3-dimensions with σ = (X,Y,Z)

Proof: first write

(i.e. Є123 = 1, Є213 = -1, Є231 = 1, …, and Є113 = 0) summarizing σi2 = I and [σi,σj] = 2i Єijk σk and anticommutation [σi,σj]– = 0 for i ≠ j. Hence

since |n| = 1. With that: M2j = I, M2j+1 = M for j ≥ 0, hence:

QED

Rn(θ) describes the rotation of a ‘Bloch’ vector r by the angle θ around the n-axis
Next: an arbitrary single qubit unitary operator can be written as U = eiα Rn(θ) = eiα Rz(β) Ry(γ) Rz(δ), α,β,γ,δ real numbers (the so-called Z-Y decomposition for a single qubit), θ is the fixed angle from the realized gate.
Proof:
U unitary, i.e. U+U = I. Write det U = e2iα, α in R. Define V = e-2iαU, then: V+V = I and det V = e-2iα det U = 1, hence V in SU(2), U = e2iαV in U(2), e2iα just an overall, unobservable global phase (by the way not shown on the Bloch sphere). For any

with det = 1:

and from unitarity

Comparing gives for any (complex) SU(2) matrix

with |a|2 + |b|2 = 1, hence 3 parameters: Re a, Im a, Re b, Im b minus one condition (being exactly the equation of the unit 3-sphere!). With


leads to

Comparing with the general SU(2) form gives

det (Rz(β) Ry(γ) Rz(δ)) = cos2γ/2 + sin2γ/2 = 1, hence in SU(2), so choose the overall phase α = 0 mod π. On the other side:

and with that

Hence with the Euler identity and by comparison for the diagonal entries:

therefore

Off-diagonal elements:

With that: (θ, nx, ny, nz) → (β,γ,δ) → Rz(β) Ry(γ) Rz(δ) reaches every element of SU(2) (the 3-unit sphere S3). Is |n|2 = nx2 + ny2 + nz2 = 1 fulfilled? Yes: From above (nx2 + ny2 + nz2) sin2 (θ/2) = sin2(θ/2) , hence nx2 + ny2 + nz2 = 1
QED
Now: an iteration of Rn(θ) can approximate any rotation Rn(α), with E(Rn(α),Rn(θ)n) < ε/3
For any unitary operator A: UAkU-1 = UA…AU = UAU-1UA…U-1UAU-1 = (UAU-1)k. Since the Hadamard gate H is Hermitian (H2 = I, i.e. H flips any vector by 180° on the Bloch sphere in order to return to the original value): HRn(α)kH = (HRn(α)H)k
Next: Any density matrix

of a qubit can be represented by a Bloch vector v written with Pauli matrices: p = 1/2 (I + v·σ). A unitary operation U on p gives p’ = UpU+ = U(1/2 (I + v·σ))U+ = 1/2(I+ U(v·σ)U+) = 1/2 (I + v’·σ) and hence v’·σ = U(v·σ)U+ := RU v with (RU)ij = 1/2 Tr(σiUσjU+), with RU in SO(3), the continuous, non-abelian Lie group of 3-dimensional rotations. Furthermore, it holds:

from before and together with the Pauli matrix identity(m·σ) (n·σ) = (m·n)I + i(mxn)·σ and with

it holds

using Rodrigues‘ rotation formula for […], α′ beeing the rotation angle of RU around n

So finally, with H

(rotation by π around h) leading to HRn(θ)H = Rm(θ), m = 2(n·h)h–n, for any unitary U = Rn(β)Rn’(γ)Rn(δ) with suitable n1, n2, n3 holds E(U, Rn(θ)n1HRn(θ)n2HRn(θ)n3) < ε, i.e. for any single qubit operator U and any ε > 0, U can be approximated within ε by a circuit build only from Hadamard gates and π/8-gates
For a m-qubit circuit: approximate each qubit unitary within ε/m to obtain from the chain above a quality of Є for the entire circuit
How efficient is the procedure? It holds the Solovay-Kitaev theorem, e.g. [14]: for a quantum circuit of m qubits to be approximated to error ε,

gates from a finite universal gate set are needed (c a constant), which is good
Not so good: if keeping ε fixed, while increasing the number of qubits, how behaves the number of gates needed to build an arbitrary n-qubit unitary operator? Unfortunately, the behavior is exponentially for almost all n-qubit unitaries, although each individual step can be done ‘Solovay-Kitaev-efficiently’! Therefore, quantum algorithms are useful for what they are doing realizing the unitaries needed (e.g. Quantum Fourier Transformation), not because arbitrary unitaries can be build efficiently (polynomial)
This leads to the question: which specific problems admit polynomial-size circuits? This is exactly the complexity class BQP (Bounded-Error Quantum Polynomial-Time), containing e.g. integer factorization, order finding, quantum chemistry simulation, local Hamilton simulation, and Simon’s problem. But as mentioned, in general one cannot decide if any quantum algorithm is in BQP except by proving polynomial runtime explicitly
Note: all classical Polynomial-time algorithms can be efficiently simulated on quantum computers, hence P ⊆ BQP. Shor’s algorithm is believed to be in BQP/P, though a formal proof that P ≠ BQP is missing
Sources
[1] Benchmarking Advantage and D-Wave 2000Q quantum annealers with exact cover problems , Wilsch et al., 2022
[2] Quantum optimization using a 127-qubit gate-model IBM quantum computer can outperform quantum annealers for nontrivial binary optimization problems , Sachdeva et al., 2024
[3] An introduction to variational quantum algorithms for
combinatorial optimization problems , Grange et al., 2024
[4] Variational quantum algorithms , Cerezo et al., 2021
[5] Using Quantum Computing to Improve on
the Traveling Salesman Problem , Master Thesis, Rychkova, 2022
[6] Efficient quantum algorithm for solving travelling salesman problem: An IBM quantum experience , Srinivasan et al., 2018
[7] ‘Grundkurs Theoretische Physik 5: Quantenmechanik, Teil 1: Grundlagen’, Nolting, Verlag Zimmermann – Neufang, 1992
[8] ‚Quantum Computation and Quantum Information‘, Nielsen, Chuang, Cambridge University Press, 10th Anniversary Edition 2010
[9]Deep Learning textbook , Goodfellow et al., 2016
[10] Quantum Annealing for Industry Applications: Introduction
and Review , Yarkoni et al., 2022
[11] Quantum Annealing Explained
[12] Introduction to Simulated Quantum Annealing , Rubez, 2021
[13] What is the Computational Value of Finite Range Tunneling? , Denchev et al., 2016
[14] THE SOLOVAY-KITAEV ALGORITHM , Dawson et al., 2005
[15] An Introduction to the
Quantum Approximate Optimization Algorithm by Giovagnoli, 2025

























































































































































































































































































































































































































































































































































