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: https://www.flickr.com/photos/63059536@N06/5941055642
Programming the Unprogrammable Substrate-Dependent Efficiency-Aware Highly Constrained Incredibly Counterintuitive
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 .
A Very Brief Intro to QC
Bit of Classical Memory for You Classical bit takes one of two values. Bit When you read the state, the given value is the value you see. 0 1 We could write this (somewhat redundantly) as vectors:
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.
Qubit State Space A qubit is a linear sum of the two states: Measure the qubit observe:
Ion Trap Computing Group, Oxford. Photo Credit (and thanks to) David Nadlinger. http://klickverbot.at/blog/2018/02/photographing-a-single-atom/
Single Qubit Gates One qubit operation defined by 2x2 unitary matrix. e.g. NOT Gate: Applied to general qubit:
Hadamard Gate Hadamard gate: Applied to a qubit:
A Bit More Classical Memory for You A classical n-bit register takes one of 2 n values: bit bit bit bit bit bit 0/1 0/1 0/1 0/1 0/1 0/1 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).
Multiple Qubits For n classical bits, keep track of n numbers (0 or 1). For n qubits, keep track of 2 n complex numbers. 1000 qubits = 2 1000 states hence ≈ 10 300 probability amplitudes. We can manipulate them simultaneously!
Multi-Qubit State For two qubits: For three qubits:
Entanglement Most multi-qubit states can’t be decomposed into the state of the individual bits.
CNOT Gate A popular quantum gate is controlled-not: “NOT the second bit if first is set”
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!
Quantum Circuit x H y
Other Circuit Components NOT Oracle Toffoli Qubit 1 X U f Qubit 2 Measurement Qubit 3 Swap
Example: Deutsch Finding a Better-than-Classical Quantum AND/OR Algorithm using Genetic Programming. Spector et al. CEC 1999.
Example: Quantum Fourier Transform H 2 n n-1 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.
Quantum GP With acknowledgements to Susan Stepney and Paul Massey
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.
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.
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)
Example 2nd Order Root(p1…pn) Create_CP(c, x, a) Create_H(x) 3 Create_H(x) Create_CP(c, x, a) 2 2 1 1 2
Example 2nd Order Root(p1…pn) Create_CP(3, x, a) Create_H(x) Create_H(x) Create_CP(c, x, a) 2 2 1 1 2
Example 2nd Order Root(p1…pn) Create_CP(3, x, a) Create_H(x) Create_H(1) Create_CP(c, x, a) 2 2 1 2
Example 2nd Order Root(p1…pn) Create_CP(3, 1, a) Create_H(x) Create_CP(c, x, a) 2 2 1 2 H 1
Example 2nd Order Root(p1…pn) Create_CP(3, 1, a) Create_H(x) Create_CP(1, 2, 2) 2 H 1
Example 2nd Order Root(p1…pn) Create_CP(3, 1, 2) Create_H(x) 2 H 1 2 2
Example 2nd Order Root(1…pn) Create_H(x) 2 H 2 1 2 2 3
Example 2nd Order Root(1…pn) Create_H(2) H 2 1 2 2 3
Example 2nd Order Root(1,2) H 2 1 2 H 2 3
Example 2nd Order Root(p1…pn) Create_CP(c, x, a) Create_H(x) 3 Create_H(x) Create_CP(c, x, a) 2 2 1 1 2 H 2 1 2 H 2 3
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
Cost Functions: Matrix Decomposition Deviation from target matrix U: 2 n 2 n ∑ ∑ | U ij − S ij | R f ( S , U ) = i =1 j =1 Value of R varies, e.g. R =2. Only possible in limited circumstances (no partial measurement).
Cost Functions: Test Cases Polar form Correctness
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.
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.
Quantum Program Optimisation
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.
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)
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.
Decoherence One of the greatest obstacles to constructing useable quantum computers. Qubits interact with the environment and desired state evolution is lost.
Topological Constraints CNOT(1,4) CNOT Qubit 1 Qubit 2 Qubit 3 Qubit 4 SWAP(3,4) SWAP(2,3) CNOT(1,4) = CNOT(1,2) SWAP(2,3) SWAP(3,4)
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
Quantum Cost Models Straightforward gate count can be misleading. Decompose into elementary operations supported by a substrate. For example: time taken to implement a C k -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.
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.
Probabilistic Blackbox (Oracle) Analysis + Circuit Length 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. Evolving blackbox quantum algorithms using genetic programming. Stadelho ff er et al. Artificial Intelligence for Engineering Design, Analysis and Manufacturing 2008, 22
Recommend
More recommend