The Synthesis and Improvement of Quantum Circuits and Programs - - PowerPoint PPT Presentation

the synthesis and improvement of quantum circuits and
SMART_READER_LITE
LIVE PREVIEW

The Synthesis and Improvement of Quantum Circuits and Programs - - PowerPoint PPT Presentation

The Synthesis and Improvement of Quantum Circuits and Programs David R. White & John A. Clark Dept. of Computer Science University of She ffi eld, UK With acknowledgements to Susan Stepney and Paul Massey Image Credit NIST:


slide-1
SLIDE 1

The Synthesis and Improvement of Quantum Circuits and Programs

David R. White & John A. Clark

  • Dept. of Computer Science

University of Sheffield, UK

With acknowledgements to Susan Stepney and Paul Massey

Image Credit NIST: https://www.flickr.com/photos/63059536@N06/5941055642

slide-2
SLIDE 2

Programming the Unprogrammable

Substrate-Dependent Efficiency-Aware Highly Constrained Incredibly Counterintuitive

slide-3
SLIDE 3

Outline

  • 1. Background: basics of Quantum Computation
  • 2. Quantum GP: discovery of quantum circuits and

parameterising algorithms by input size.

  • 3. Non-functional concerns and how to incorporate/improve

them - effective and efficient use of resources.

slide-4
SLIDE 4

A Very Brief Intro to QC

slide-5
SLIDE 5

Bit of Classical Memory for You

Classical bit takes one of two values. When you read the state, the given value is the value you see. We could write this (somewhat redundantly) as vectors:

Bit 1

slide-6
SLIDE 6

Single Qubits

A qubit is a two-level physical system. Can be a linear combination of both levels, a “superposition”. A “weighted sum” of each possibility. There is no classical analogue.

slide-7
SLIDE 7

Qubit State Space

A qubit is a linear sum of the two states: Measure the qubit observe:

slide-8
SLIDE 8

Ion Trap Computing Group, Oxford. Photo Credit (and thanks to) David Nadlinger.

http://klickverbot.at/blog/2018/02/photographing-a-single-atom/

slide-9
SLIDE 9

Single Qubit Gates

Applied to general qubit: One qubit operation defined by 2x2 unitary matrix. e.g. NOT Gate:

slide-10
SLIDE 10

Hadamard Gate

Hadamard gate: Applied to a qubit:

slide-11
SLIDE 11

A Bit More Classical Memory for You

A classical n-bit register takes one of 2n values:

bit bit

i.e. one of 000…000 to 111…111 Reading it you see the particular value it stores. Register described by n numbers (0 or 1).

bit bit bit bit 0/1 0/1 0/1 0/1 0/1 0/1

slide-12
SLIDE 12

Multiple Qubits

For n classical bits, keep track of n numbers (0 or 1). For n qubits, keep track of 2n complex numbers. 1000 qubits = 21000 states hence ≈ 10300 probability amplitudes. We can manipulate them simultaneously!

slide-13
SLIDE 13

For two qubits:

Multi-Qubit State

For three qubits:

slide-14
SLIDE 14

Entanglement

Most multi-qubit states can’t be decomposed into the state of the individual bits.

slide-15
SLIDE 15

CNOT Gate

A popular quantum gate is controlled-not: “NOT the second bit if first is set”

slide-16
SLIDE 16

Quantum Parallelism

When you apply a unitary operation to a superposition you obtain the superposition of the application of the operation to each element of the superposition. …the trick is extracting useful information!

slide-17
SLIDE 17

Quantum Circuit

H

x y

slide-18
SLIDE 18

Other Circuit Components

X

Swap Toffoli Measurement NOT

Uf

Oracle Qubit 1 Qubit 2 Qubit 3

slide-19
SLIDE 19

Example: Deutsch

Finding a Better-than-Classical Quantum AND/OR Algorithm using Genetic Programming. Spector et al. CEC 1999.

slide-20
SLIDE 20

Example: Quantum Fourier Transform

H 2

n-1 n

H 2

n-2 n-1

H 2 3 H 2 H Evolution of a human-competitive quantum fourier transform algorithm using genetic

  • programming. Massey et al. GECCO 2005.
slide-21
SLIDE 21

Quantum GP

With acknowledgements to Susan Stepney and Paul Massey

slide-22
SLIDE 22

GP Applications to QC

Evolving circuits using a set of gates:

  • Decompose a target linear transform (matrix) into gates.
  • Find a circuit that passes test cases.

Evolving useful artefacts rather than computations:

  • Entangled states.
  • Circuits that efficiently generate entanglement.
slide-23
SLIDE 23

Representations

1st Order: List Representing a Circuit

e.g. list representing a circuit, with qubit indexing.

((HADAMARD 2) (HADAMARD 1) (U-THETA 0 0.7853981633974483) (ORACLE ORACLE-TT 2 1 0) (HADAMARD 2) (CNOT 2 1) (HADAMARD 2) (U-THETA 2 1.5707963267948966) (U-THETA 1 1.5707963267948966))

2nd Order: Functions that Create Gates as Side Effects

Parameterised function: create_H(x), returns x. Also have standard arithmetic functions etc. iterate(n, body): create body n times, return n.

Parameterised 2nd Order: Create a Family of Circuits

Allow generalisation by parameterising by input size.

slide-24
SLIDE 24

Example: 3 Qubit Circuit

Hardwired for 3 qubits. ROOT(
 2,
 Create_CP(3, Create_CH(1,1), Create_CP(1,2,2)),
 2,
 Create_H(2),
 Create_CP(2,3,2),
 Create_CCN(
 Create_CP(
 Create_CCN( Create_CP(3,1,3), Create_N(1), 1 ),
 3, 2),
 Create_H(3), 1),
 Create_CN(1,3),
 2, 3)

slide-25
SLIDE 25

Example 2nd Order

Create_CP(c, x, a) 2 3 Create_H(x) 2 Create_CP(c, x, a) 1 2 1 Root(p1…pn) Create_H(x)

slide-26
SLIDE 26

Example 2nd Order

Create_CP(3, x, a) 2 Create_H(x) 2 Create_CP(c, x, a) 1 2 1 Root(p1…pn) Create_H(x)

slide-27
SLIDE 27

Example 2nd Order

Create_CP(3, x, a) 2 Create_H(1) 2 Create_CP(c, x, a) 2 1 Root(p1…pn) Create_H(x)

slide-28
SLIDE 28

Example 2nd Order

Create_CP(3, 1, a) 2 2 Create_CP(c, x, a) 2 1 Root(p1…pn) Create_H(x)

H

1

slide-29
SLIDE 29

Example 2nd Order

Create_CP(3, 1, a) 2 Create_CP(1, 2, 2) Root(p1…pn) Create_H(x)

H

1

slide-30
SLIDE 30

Example 2nd Order

Create_CP(3, 1, 2) 2 Root(p1…pn) Create_H(x)

H

1 2

2

slide-31
SLIDE 31

Example 2nd Order

2 Root(1…pn) Create_H(x)

H

1 2

2 2

3

slide-32
SLIDE 32

Example 2nd Order

Root(1…pn) Create_H(2)

H

1 2

2 2

3

slide-33
SLIDE 33

Example 2nd Order

Root(1,2)

H

1 2

2 2 H

3

slide-34
SLIDE 34

Example 2nd Order

H

1 2

2 2 H

3

Create_CP(c, x, a) 2 3 Create_H(x) 2 Create_CP(c, x, a) 1 2 1 Root(p1…pn) Create_H(x)

slide-35
SLIDE 35

Quantum Simulators

QGAME

http://faculty.hampshire.edu/lspector/qgame.html

MS Quantum Development Kit Q#

https://www.microsoft.com/en-gb/quantum/development-kit

IBM QISKit

https://github.com/Qiskit/qiskit-terra

Comprehensive List:

https://quantiki.org/wiki/list-qc-simulators

slide-36
SLIDE 36

Cost Functions: Matrix Decomposition

Deviation from target matrix U:

Value of R varies, e.g. R=2. Only possible in limited circumstances (no partial measurement).

f(S, U) =

2n

i=1 2n

j=1

|Uij − Sij|R

slide-37
SLIDE 37

Cost Functions: Test Cases

Polar form Correctness

slide-38
SLIDE 38

Landscape Analysis

Leir and Banzhaf investigated for 2 and 3-qubit boolean problems (Deutsch-Joza). Examined two landscape measures:

  • Autocorrelation
  • Information Measures

Complex and rugged landscapes: beyond two steps most of the points of the landscape path become almost uncorrelated!!!

Exploring the search space of quantum programs. Leier and Banzhaf. CEC 2003.

slide-39
SLIDE 39

Conclusions

Most work uses a standard GP approaches with side-effects and a fixed number of qubits or is parameterised to generalise. Parameterised 2nd order representation has successfully evolved a size-independent QFT. Often a solution is already known: e.g. matrix decomposition, existing abstract circuits designed by hand.

slide-40
SLIDE 40

Quantum Program Optimisation

slide-41
SLIDE 41

Implementing Quantum Computing

Qubits must be realised in hardware. Requisite capabilities:

  • 1. Prepare state.
  • 2. Apply operations to them as desired. Universal gate set is

machine-dependent.

  • 3. Make measurements.
slide-42
SLIDE 42

Quantum Technologies

Qubit representations:

  • Electron and Nuclear Spin
  • Charge
  • Photon polarisation

Technologies:

  • Ion traps
  • Photons and nonlinear optical media
  • Cavity quantum electrodynamic devices
  • NMR with Molecules (high temperature) (pseudostates of

e.g. 10^18 molecules)

slide-43
SLIDE 43

Operations

Implemented by altering state using lasers, RF pulses, etc. Operations have different characteristics, e.g. they vary in time to execute a given operation. Operations have imperfect fidelity: probability of failure.

slide-44
SLIDE 44

Decoherence

One of the greatest obstacles to constructing useable quantum computers. Qubits interact with the environment and desired state evolution is lost.

slide-45
SLIDE 45

CNOT

Qubit 1

Topological Constraints

Qubit 2 Qubit 3 Qubit 4

CNOT(1,4)

SWAP(3,4) SWAP(2,3) CNOT(1,2)
 SWAP(2,3) SWAP(3,4) CNOT(1,4) =

slide-46
SLIDE 46

Non-Functional Objectives

  • Minimise cost of operations
  • Minimise path length (max gate distance from input to output)
  • Minimise loss of fidelity
  • Reduce required entanglement
  • Reduce number of oracle calls
  • Reduce number of qubits required (including ancillaries)
  • Optimise location of entangled qubits to reduce swapping
slide-47
SLIDE 47

Quantum Cost Models

Straightforward gate count can be misleading. Decompose into elementary operations supported by a substrate. For example: time taken to implement a Ck -NOT gate may require (2k+3) laser pulses for a particular trapped ion implementation.

Synthesis and Optimization of Reversible Circuits - A Survey. Saeedi and Markov. ACM

  • Comp. Surveys 45, 2, 2013.
slide-48
SLIDE 48

Using a GA to optimise EF pulse sequences

  • 1. To implement gates, e.g. CNOT
  • 2. For state preparation, e.g. Bell States.

Representation: matrix describing sequence of pulses (amplitude, phase) and delay. Fitness: match expected matrix or target state, using projection for comparison.

Singlet-state creation and universal quantum computation in NMR using a genetic

  • algorithm. Manu and Kumar. Phys. Rev. A 86, 022324, 2012.
slide-49
SLIDE 49

Parity and hidden subgroup problems. Gate set: Hadamard, two single-bit rotation gates, CNOT. Linear genome. Fitness function: managing probability of error and minimising circuit length, targeting NMR.

Probabilistic Blackbox (Oracle) Analysis + Circuit Length

Evolving blackbox quantum algorithms using genetic programming. Stadelhoffer et al. Artificial Intelligence for Engineering Design, Analysis and Manufacturing 2008, 22

slide-50
SLIDE 50

Gates: Hadamard, Rotations, CNOT, CPHASE, Measurement Problem: probabilistically approximate an AND-OR tree (predict result of boolean function). Fitness: Misses, Maximum Error (across test cases), Oracle Calls, Number of Gates. Many others in Spector’s book.

Finding a Better-than-Classical Quantum AND/OR Algorithm using Genetic Programming. Spector et al. CEC 1999.

Finding a Better-than-Classical Quantum AND/OR Algorithm using Genetic Programming

slide-51
SLIDE 51

Post-Synthesis Optimisation

Template application Libraries Adding ancillae Swap insertion, placement, optimisation Manual cleanup.

Quantum Circuit Simplification and Level Compaction. Maslov et al. IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems. 27/3 2008.

slide-52
SLIDE 52

Summary

slide-53
SLIDE 53

Established Field

Quantum circuit and algorithm synthesis via metaheuristics is an established area. Evolving Quantum Artefacts:

  • 1. Circuits and algorithms (sometimes parameterised by size).
  • 2. Gate implementation using lower level primitives.
slide-54
SLIDE 54

Quantum Program Synthesis is heavily under-explored!

Very few quantum algorithms are known.

  • Highly counterintuitive: GP doesn’t care about intuition!

Implementation details are of great importance.

  • Search for better implementations.
  • Improvement of human-written circuits?
slide-55
SLIDE 55

Plug for Gin: GI Tool

https://github.com/gintool/gin

slide-56
SLIDE 56

Further Reading

An Introduction to Quantum Computing for Non-Physicists. Rieffel & Polak. (1998). ACM Computing Surveys. 32. 10.1145/367701.367709. Automatic Quantum Computer Programming: A Genetic Programming Approach.

  • Spector. Springer. 2004.

Quantum Computation and Quantum Information: 10th Anniversary Edition. Nielson & Chuang. Cambridge University

  • Press. 2011.