1 of 62

Variational Quantum Algorithms

How do they work?

Michał Stęchły

13th July 2020�Warsaw QC group

2 of 62

Presentation plan

  1. About
  2. Intro to VQA
  3. VQE
  4. QAOA
  5. NISQ
  6. VQA anatomy

3 of 62

About me

  • Quantum Software Engineer at Zapata Computing
    • Building Orquestra
    • Implementing algorithms
    • Helping with research projects
  • Quantum Open Source Foundation
    • QC Mentorship program
  • Q4Climate
    • Getting it all started!
  • Musty Thoughts (blog)�

4 of 62

What is VQA?

5 of 62

6 of 62

Examples of VQA

  • VQE
  • QAOA
  • QNNs

7 of 62

Variational Quantum Eigensolver

8 of 62

Variational principle

Important concepts

  • Hamiltonian
  • Eigenstate
  • State energy
  • Ground state
  • Ground state energy

By definition:

  • Energy of any state is greater or equal ground state energy

9 of 62

Why do we care about ground state energy?

  • It’s useful
  • It’s hard to get with classical computing

10 of 62

What do we need?

  • Some method of encoding the problem
  • Some method for preparing the parametrizable state
  • Some method for finding a good set of parameters

11 of 62

Pauli Matrices

Good source: http://www.warrenalphonso.com/qc/hubbard

12 of 62

Simple example - hydrogen

H =

-0.1673 * I + 0.1625 * Z0 + 0.1625 * Z1 + -0.1974 * Z2 + -0.1974 * Z3

+ 0.1658 * Z0 Z1 + 0.1172 * Z0 Z2 + 0.1633 * Z0 Z3 + 0.1633 * Z1 Z2 + 0.1172 * Z1 Z3 + 0.1716 * Z2 Z3

+ -0.0461 * X0 X1 Y2 Y3 + 0.0461 * X0 Y1 Y2 X3 + 0.0461 * Y0 X1 X2 Y3 + -0.0461 * Y0 Y1 X2 X3

Good source: http://www.warrenalphonso.com/qc/hubbard

13 of 62

Ansatz!

14 of 62

Source: https://arxiv.org/abs/1905.10876

15 of 62

16 of 62

17 of 62

What a good ansatz has?

  • High (enough) expressibility
  • Low number of parameters
  • Low depth
  • “Hardware-awareness”

18 of 62

How to obtain energy?

  • Measure and calculate the expectation value

19 of 62

Simple example - hydrogen

H =

-0.1673 * I + 0.1625 * Z0 + 0.1625 * Z1 + -0.1974 * Z2 + -0.1974 * Z3

+ 0.1658 * Z0 Z1 + 0.1172 * Z0 Z2 + 0.1633 * Z0 Z3 + 0.1633 * Z1 Z2 + 0.1172 * Z1 Z3 + 0.1716 * Z2 Z3

+ -0.0461 * X0 X1 Y2 Y3 + 0.0461 * X0 Y1 Y2 X3 + 0.0461 * Y0 X1 X2 Y3 + -0.0461 * Y0 Y1 X2 X3

Good source: http://www.warrenalphonso.com/qc/hubbard

20 of 62

How to measure?

RY(pi/2)

21 of 62

Classical optimization

What a QPU does:

  • Given a set of parameters, returns us a set of measurements.

What a classical computer does:

  • Given a set of measurements calculates the energy value (it’s usually some kind of averaging)
  • Performs optimization procedure
  • Calculates what a new set of parameters should be
  • Checks whether we have reached the minimum
  • Makes sure we don’t make more iterations than we should have done

22 of 62

Example

H = 2Z + X + I

H = H1 + H2 + H3

E = E1 + E2 + E3

|𝚿> = RY(𝚹)

23 of 62

Example

H = 2Z + X + I

E (𝚹 = 0) = 2 + 0 + 1

E (𝚹 = π) = -2 + 0 + 1

24 of 62

Quantum Approximate Optimization Algorithm

25 of 62

Why do we care about combinatorial optimization?

26 of 62

It’s everywhere!

27 of 62

MaxCut

28 of 62

MaxCut

29 of 62

QAOA-related concepts

  • Adiabatic Quantum Computing
  • Ising Models
  • Time evolution
  • Trotterization

30 of 62

Adiabatic Quantum Computing

31 of 62

Adiabatic Quantum Computing - issues

  • Isolation
  • Time
  • Universal gate-based quantum computer

32 of 62

Ising Models

Source: Thermalisation and Relaxation of Quantum Systems, Sascha Wald

33 of 62

Ising Models

Source: Thermalisation and Relaxation of Quantum Systems, Sascha Wald

34 of 62

Ising Model – MaxCut

Source: https://lucaman99.github.io/new_blog/2020/mar16.html

35 of 62

Time evolution

36 of 62

Function approximation

37 of 62

Trotterization

Source: https://ocw.mit.edu/courses/nuclear-engineering/22-51-quantum-theory-of-radiation-interactions-fall-2012/lecture-notes/MIT22_51F12_Ch5.pdf

38 of 62

What’s QAOA?

Source: https://arxiv.org/abs/1411.4028

39 of 62

QAOA – relation to AQC

Source: https://arxiv.org/abs/1712.05304

40 of 62

QAOA – cost Hamiltonian

Source: https://arxiv.org/abs/1411.4028

41 of 62

QAOA - mixer Hamiltonian

Source: https://arxiv.org/abs/1411.4028

42 of 62

QAOA - mixer Hamiltonian

What makes a good mixer Hamiltonian?

  • Easy to implement
  • Does not commute with cost Hamiltonian

43 of 62

Example

44 of 62

Example

45 of 62

Relationship between VQE and QAOA

QAOA can be viewed as a special case of VQE.

However:

  • The ansatz form is limited
  • Restricted to Ising Hamiltonian
  • Different goal of the algorithm

46 of 62

NISQ

47 of 62

NISQ challenges

  • Noise
  • Life time of qubits
  • Number of qubits
  • Set of available gates
  • Connectivity

48 of 62

How does it affects us?

Source: https://arxiv.org/abs/2004.04197

49 of 62

Why VQA are good for NISQ?

  • Usually allow for variable circuit depth
  • They show some resistance to noise
  • They don’t necessarily require a lot of qubits

50 of 62

Structure of VQA

51 of 62

Circuit

QVM/QPU

Measurements

52 of 62

What about...

  • Chip layout?
  • Gate set?

53 of 62

Executable circuit

QVM/QPU

Measurements

Abstract circuit

Compiler

QPU specs

54 of 62

What about...

  • Ansatz?
  • Readout correction?
  • Measurement strategy?
    • Grouping strategy?
    • Shots allocation?
  • Noise models (for simulation)?

55 of 62

Executable circuit

QVM/QPU

Measurements

Abstract circuit

Compiler

QPU specs

Ansatz

Parameters

Noise models

Readout correction

Measurement strategy

Target operator

Grouping strategy

“Shots budget”

56 of 62

CIRCUIT PREPARATION REALM

EXECUTION/MEASUREMENTS REALM

Executable circuit

QVM/QPU

Measurements

Abstract circuit

Compiler

QPU specs

Ansatz

Parameters

Noise models

Readout correction

Measurement strategy

Target operator

Grouping strategy

“Shots budget”

57 of 62

What about...

  • Problem definition?
    • Constraints?
    • Cost function?
    • Parameter bounds?
  • Optimizer?
    • Algorithm?
    • Algorithm params?
    • Initial parameters?
    • Gradient calculation?

58 of 62

VQA

PROBLEM DEFINITION

CIRCUIT PREPARATION

EXECUTION/�MEASUREMENTS

Cost Function

Parameters

Target operator

Ansatz

Constraints

Parameter bounds

Gradient calculation strategy

Parameter initialization strategy

Initial optimizer settings

Measurement strategy

Optimizer

59 of 62

Challenges of VQAs

  • Ansatz design
  • Optimization
    • Barren plateaus
    • Just optimization
    • Calculating gradients
  • Measurement problem
  • Provable speedups?
  • All the various possible improvements
  • How to benchmark?
  • Simulation vs Experiment

60 of 62

Summary

61 of 62

What have we covered?

  • VQE
  • QAOA
  • Algorithms for NISQ era
  • Structure of VQAs

62 of 62

Thank you!