Quantum Approximate Optimization Algorithm

How it works

|++\ldots + \rangle
\exp(-\mathrm i \theta_{i+1}\sum_i X_i)
\exp(-\mathrm i \theta_i H_{\rm obj})

Quantum evolutiom

i \leftarrow i+2
| \varphi(\theta) \rangle

Thetas are optimized (somehow)!

Quantum annealing

Step 1.: write as a HOBO

A_1\sum\limits_{t=1}^N H_{\rm valid} (b_t) + A_2\sum\limits_{t=1}^N \sum\limits_{t'=t+1}^N H_{\neq}(b_t,b_{t'}) + B\sum\limits_{\substack{i,j=1\\i\neq j}}^N W_{ij} \sum\limits_{t=1}^N H_\delta (b_t,i)H_\delta (b_{t+1},j).

A sum of constraints and objective hamiltonians

Need to choose proper values A_1, A_2, B.

Quantum annealing

Step 2.: turn into a 2-local Ising model

H(b)=\sum_{I\subseteq \{1,\dots,n\}} \alpha_I \prod_{i\in I} b_i
H(s \cup s') = \sum_{i\neq j} J_{ij} s_is_j + \sum h_i s_i
H(s) =\sum_{I\subseteq \{1,\dots,n\}} \tilde \alpha_I \prod_{i\in I} s_i
b_i \leftarrow (1-s_i)/2

Alternatively turn to QUBO and then to 2-local Ising model

x_1x_2x_3 \leftarrow \min _z (zx_3 + B (x_1x_2 - 2 (x_1+x_2)z+3z)

non unique!

New qubits!

Quantum annealing

Step 3.: fit to interaction graph

H(s \cup s') = \sum_{i\neq j} J_{ij} s_is_j + \sum h_i s_i

J_{ij} != 0 iff s_i and s_j are connected - more qubits needed!

Quantum annealing

Conclusions

  • D-Wave technology requires 2-local interactions following special topology (Chimera, Pegasus)
  • Thus many qubits are required
  • As long as we can write as HOBO (and we can fit it) we can run it (the whole procedure is known)

QAOA

Step 1.: write as a HOBO

A_1\sum\limits_{t=1}^N H_{\rm valid} (b_t) + A_2\sum\limits_{t=1}^N \sum\limits_{t'=t+1}^N H_{\neq}(b_t,b_{t'}) + B\sum\limits_{\substack{i,j=1\\i\neq j}}^N W_{ij} \sum\limits_{t=1}^N H_\delta (b_t,i)H_\delta (b_{t+1},j).

A sum of constraints and objective hamiltonians

Need to choose proper values A_1, A_2, B.

QAOA

Step 2.: turn into a Ising model

H(b)=\sum_{I\subseteq \{1,\dots,n\}} \alpha_I \prod_{i\in I} b_i
H(s) =\sum_{I\subseteq \{1,\dots,n\}} \tilde \alpha_I \prod_{i\in I} s_i
b_i \leftarrow (1-s_i)/2

No extra qubits needed in principle!, however there may be more nonzero terms

QAOA

Step 2a.: how to implement mixer

\exp(-\mathrm i \theta_{i+1}\sum_i X_i)
\exp(-\mathrm i \theta_i H_{\rm obj})
\exp(-\mathrm i \theta_{i+1}\sum_i X_i) = \prod_i \exp(-\mathrm i \theta_{i+1}X_i)

Always commuting!

QAOA

Step 2b.: how to implement obj. Ham.

\exp(-\mathrm i \theta_{i+1}\sum_i X_i)
\exp(-\mathrm i \theta_i H_{\rm obj})
\exp(-\mathrm i \theta_{i}(\alpha_1 Z_1 Z_2 Z_3+ \alpha_2 Z_1Z_2 )) \\= \exp(-\mathrm i \theta_{i}\alpha_1 Z_1 Z_2 Z_3 ) \exp(-\mathrm i \theta_{i} \alpha_2 Z_1 Z_2 )

Always commuting!

\theta_i\alpha_1
\theta_i\alpha_2

QAOA

Step 2b.: how to implement obj. Ham.

\exp(-\mathrm i \theta_{i+1}\sum_i X_i)
\exp(-\mathrm i \theta_i H_{\rm obj})
\exp(-\mathrm i \alpha Z Z \cdots Z)

Extra qubit needed but CNOT-s commutes!

Note that not all qubits may be connected for QC as well - but we can SWAP

QAOA

Step 3.: run the optimizer

Depending on classical algorithm we use we may need:

  • Estimate energy (simple)
  • Estimate gradient (harder but manageable)
  • Estimate Hessian (super-hard)

The more derivatives we know - usually the better the algorithm works

Math

We need to estimate the energy of the state given Hamiltonian

|\varphi\rangle

Measurement

0100100...10

Hamiltonian

E_i

The mean of energies E_i is expectedly the correct energy

\langle \varphi | H |\varphi \rangle

Math

We may need to estimate the gradient

First way: calculate from the definition of gradient based on

(E_\theta)' \approx \frac{E_{\theta+\varepsilon} - E_{\theta-\varepsilon}}{2\varepsilon}
\mathbb E(E_\theta)' \neq \mathbb E \left ( \frac{E_{\theta+\varepsilon} - E_{\theta-\varepsilon}}{2\varepsilon} \right )

Problem:

One can choose a different linear combination of energies for different thetas, however then the time complexity grows

Math

Energy estimation techniques

1.\quad H = \sum_i \alpha_i P_i \implies \langle \varphi | H | \varphi \rangle = \sum_i\alpha_i \langle \varphi | P_i | \varphi \rangle

Hence we can estimate energy for each P_i independently.

2. Since all P_i commute, we can estimate energy based on bit-strings coming out from measurement.

\mathbb{P} (| X - \mathbb E X | \geq t ) \leq 2\exp\left (- \frac{2M t^2}{\max X-\min X} \right ).

NISQ assumptions

  • QC are noisy (we are not able to implement exactly the unitary gate)
  • Measurements are noisy (outputs, and by this energies are not always reliable,
  • We don't have much qubits

QAOA simulations

Levels of simulation truth

1. Calculate |phi> and then classicaly calculate <phi|H|phi>

 "fast", but completely unphysical

2. Calculate |phi>, then make measurements and estimate energy

perfect but super slow

3. Calculate (noisy) |phi>, then make (noisy) measurement  and estimate energy

slow, physical, but not NISQ-y

Order of ZZ...Z

What kind of quality measures can we have?

  • Number of qubits (super important!)
  • Depth of the circuit (super important!)
  • Number of Pauli terms (important!)
  • noise robustness (important)
  • Number of QC run/measurements

depth

Thank you!

Something extra

QAOA

By Adam Glos

QAOA

  • 107