0% found this document useful (0 votes)
17 views80 pages

Jaygambetta Webinarslides Compressed-1

QISKit is an open-source software development kit designed for building quantum computing applications, addressing the evolving nature of quantum hardware. It aims to provide tools for near-term quantum systems, including support for short-depth circuits and error mitigation techniques. The document discusses the potential of quantum computing to solve intractable problems and outlines various types of quantum computing systems.

Uploaded by

homeidea2018
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views80 pages

Jaygambetta Webinarslides Compressed-1

QISKit is an open-source software development kit designed for building quantum computing applications, addressing the evolving nature of quantum hardware. It aims to provide tools for near-term quantum systems, including support for short-depth circuits and error mitigation techniques. The document discusses the potential of quantum computing to solve intractable problems and outlines various types of quantum computing systems.

Uploaded by

homeidea2018
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 80

QISKit

Jay Gambetta

1
Exploring Quantum Possibilities
The image part with relationship ID rId2 was not found in the file.

Quantum hardware is evolving


rapidly, with many approaches
being pursued
Even individual qubits exhibit day-
to-day performance variability IBM


???
Quantum software and architectures

http://vandersypenlab.tudelft

http://topocondmat.org/
w2_majorana/braiding.html
2
http://www.quantumoptics.at © 2017 IBM Corporation
Exploring Quantum Possibilities
The image part with relationship ID rId2 was not found in the file.

QISKit goal is to provide an


open-source platform for
building quantum programs that
can keep up with changing
hardware IBM

• Quantum software and architectures


QISKit
http://vandersypenlab.tudelft

http://topocondmat.org/
w2_majorana/braiding.html
3
http://www.quantumoptics.at © 2017 IBM Corporation
The image part with relationship ID rId2 was not found in the file.

QISKit

• Quantum Information Software Kit.



• Is an open source software development kit for writing
quantum computing experiments, programs, and
applications.

4 © 2017 IBM Corporation


5
6
7
8
The image part with relationship ID rId2 was not found in the file.

Overview

• Why is quantum computing exciting?


 Why Now?
 To solve problems that are intractable for classical computers
 Fault-tolerant vs approximate quantum computing

• What does QC look like today?


 IBM Q superconducting hardware

• QISKit

9 © 2017 IBM Corporation


The image part with relationship ID rId2 was not found in the file.

Moore’s Law
Performance

12 © 2017 IBM Corporation


The image part with relationship ID rId2 was not found in the file.

Moore’s Law

Quantum computing is a new


model of computation
Performance

13 © 2017 IBM Corporation


The image part with relationship ID rId2 was not found in the file.

Exponential scaling

There's a famous legend outlined in “IBM Mathematics Peep Show”

The inventor of chess showed it to the emperor of India, and the emperor was so impressed
he said "Name your reward!"
The man responded. "Oh emperor, my wishes
are simple. I only wish for this. For the next 64
days I will come back and for the first day please
only give me one grain of rice for the first square
of the chessboard, on the second day two grains
for the next square, four for the next, eight for the
next and so on for all 64 squares, with each
square having double the number of grains as
the square before."

The emperor agreed, amazed that the man had


asked for such a small reward - or so he thought.
..
14 © 2017 IBM Corporation
On the first day…

Photo: thepowerofimpossibility.com
After one week…127 grains of rice

Photo: wikimedia
After one month… 1,070,000,000 grains of rice
After 64 days … 535 billion metric tons of rice
Limitations of conventional computers

There are many intractable problems where the best known algorithm has
runtime that scales exponentially with input size

Hard Problems
NP(exponential)
“Hard” problems (exponential)

P
“Easy” Problems
(Polynomial) Linear
programming
Linear Programming

19
The image part with relationship ID rId2 was not found in the file.

A new model of computation

a physical system in a perfectly definite state can still behave randomly

two systems that are too far apart to influence each other can nevertheless behave in ways
that, though individually random, are somehow strongly correlated.

Quantum Applications is about working out how to use these two


principles in a new model of computation

20 © 2017 IBM Corporation


Superposition

Runs 1024

The outcomes appear to be random


Superposition
Superposition

Runs 1024

Doing it twice makes it certain again. Can not be a classical random mixture
Entanglement
Entanglement

Runs 4096

qubit 1 it has no information about the quantum state. It is not superposition or a


computational state.
Entanglement

Runs 4096

Correlated in the computational basis


Entanglement

Exp 5. Preparing the qubit in the “00+11” state

Runs 4096

Correlated in the superposition basis


Quantum Computing and Quantum Circuits I
The image part with relationship ID rId2 was not found in the file.

Quantum Computing and Quantum Circuits II

A quantum computation: for all

The 2 – qubit CNOT gate CNOT with all single

 A universal set of gates

29 © 2017 IBM Corporation


Quantum math in a single slide
Probability Theory: Quantum Theory:

Linear transformations that conserve 1-norm of probability Linear transformations that conserve 2-norm of amplitude
vectors: Stochastic matrices vectors: Unitary matrices

There exists efficient ways to simulate this exponential There does not exist efficient ways to simulate this
exponential (negative sign)

It is like “Probability theory with Minus Signs”


The image part with relationship ID rId2 was not found in the file.

A Quantum Algorithm

The spread The problem The magic


First part of the algorithm The second part is to The magic of quantum
is make a equal encode the problem into algorithms is to interfere all
superposition of all 2n this states (phases on the these states back to a few
states. Apply H gates on the all 2n states. outcomes containing the
31 solution © 2017 IBM Corporation
The image part with relationship ID rId2 was not found in the file.

Quantum speedups

…Quantum computers are the only novel hardware which changes the
game
NP
Hard Problems (exponential)
Hard Problems

Problems (polynomial, P)

Quantum Easy P
Easy Problems Factoring
(Polynomial) Linear
programming

Simulating Quantum Mechanics What else is in here?


32 © 2017 IBM Corporation
32
The image part with relationship ID rId2 was not found in the file.

Types of quantum computing

Universal fault-tolerant quantum computer


The holy grail of quantum information science. Allows one to run useful quantum algorithms which achieve
exponential speed ups over their classical counterparts. However the over head of quantum error correction
estimates 1M-5M qubits

Approximate quantum computer


A quantum device which does not have fault tolerance, with the goal of demonstrating a useful application
by interacting with a classical computing system, e.g. quantum chemistry, optimization. Estimate 1K-5K
qubits

Analog / quantum Annealing


A special built system which uses quantum effects to solve/emulate a specific problem. It has limited
programmability and unclear if and when it has a speed up over conventional computers.

33 © 2017 IBM Corporation


The image part with relationship ID rId2 was not found in the file.

Types of quantum computing

Universal fault-tolerant quantum computer


The holy grail of quantum information science. Allows one to run useful quantum algorithms which achieve
exponential speed ups over their classical counterparts. However the over head of quantum error correction
estimates 1M-5M qubits

Approximate quantum computer


A quantum device which does not have fault tolerance, with the goal of demonstrating a useful application
by interacting with a classical computing system, e.g. quantum chemistry, optimization. Estimate 1K-5K
qubits

Analog / quantum Annealing


A special built system which uses quantum effects to solve/emulate a specific problem. It has limited
programmability and unclear if and when it has a speed up over conventional computers.

34 © 2017 IBM Corporation


The image part with relationship ID rId2 was not found in the file.

Toward a Quantum Approximate computer

Small circuits, Universal


can not predict fault-tolerant
Circuit depth (# of operations)

(next several QC (distant


1,000,000 years) future)

Simple “toy” Goal: solve real problems with


• Quantum software and architectures
small quantum processors
demonstrations
(present day) • Step 1: Build them
1,000 • Step 2: Program them!

Quantum advantage

1 1,000 1,000,000
35
Circuit width (# of qubits) © 2017 IBM Corporation
The image part with relationship ID rId2 was not found in the file.

Technical goals for QISKit software platform

 Plan for continued improvement of quantum devices


– Increasing size, capability, and fidelity
 Build software tools for working with these near-term quantum computing systems
– Short-depth circuits: enable investigation of algorithms toward quantum advantage
– Pre-fault-tolerance: enable exploration of broad error mitigation techniques
 Create a framework for experiments, simulations, and analysis
– Backend-independent interface for running experiments
– Multiple simulators and analysis tools
– Circuit rewriting infrastructure
 Optimization, scheduling, hardware mapping
 Increase capabilities and add features over time
– Expose lower level control interfaces and extend mapping framework
 Access to timing and pulse shape
36
– Introduce higher level abstractions © 2017 IBM Corporation
The image part with relationship ID rId2 was not found in the file.

• Quantum software and architectures

IBM Quantum Experience

37 © 2017 IBM Corporation


The image part with relationship ID rId2 was not found in the file.

Anatomy of a superconducting qubit device

Qubits:
Single-junction transmon
Frequency ~ 5 GHz
Anharmonicity ~ 0.3 GHz

Resonators:
Co-planar waveguide
Frequency ~ 6 – 7 GHz
Roles:
Individual qubit readout
Qubit coupling (“bus”)
1 mm

38 Corcoles et al., Nat. Commun. 6, 6979 (2015)


© 2017 IBM Corporation
100 nm

0.5 cm

FIXED-FREQUENCY SUPERCONDUCTING
JOSEPSON JUNCTION QUBIT
 Anharmonic oscillator (“transmon*” qubit) with ~ 5% anharmonicity
 Using two lowest energy eigenstates as a qubit

*Transmon pioneered by Schoelkopf group, from Yale University. Koch et. al. PRA 76, 04319 (2007)
The image part with relationship ID rId2 was not found in the file.

COULPING QUBITS BY BUS RESONATOR

Qubit

g1 g2
Bus

 Bus frequency detuned from qubit


frequencies. |fqubit – fbus| >> g
 Two-qubit exchange interaction J via
virtual photons is mediated by the bus
1 mm
40
resonator. © 2017 IBM Corporation
The image part with relationship ID rId2 was not found in the file.

Devices used in the IBM Q Experience

•Properties of current devices:


– Single-junction transmon qubits
– T1 ~ T2 ~ 50 µs
– 1Q gate fidelities > 99%
– 2Q gate fidelities > 95%
– Measurement fidelities > 93%
– Nearest-neighbor couplings

•Current device offerings:


– 5-qubit device (“ibmqx4”): access via web GUI and QISKit API
– 16-qubit device (“ibmqx5”): access via QISKit API only

41 © 2017 IBM Corporation


The image part with relationship ID rId2 was not found in the file.

Circuit building blocks: single-qubit basis gates


 Goals: achieve universal qubit control, maximize fidelity, minimize need for calibrations
 Arbitrary rotation on the Bloch sphere = up to 3 successive rotations around fixed axes:

Z
|𝟎⟩
 Good news: arbitrary Rz can be done instantaneously and exactly
– Just adjust phase of carrier to change reference frame
|−⟩
 Bad news: can’t calibrate Ry(θ) to high fidelity for arbitrary θ |⟩ |⟩
– Solution: re-write arbitrary gates to use N frame changes plus
N - 1 well-calibrated gates with fixed axis and angle (N = 1, 2, or 3)
Y
|+⟩
|𝟏⟩
X
Yπ/2
FC = frame change
GD = Gaussian w/ DRAG
Xπ/2 X−π/2

42 © 2017 IBM Corporation


The image part with relationship ID rId2 was not found in the file.

Circuit building blocks: two-qubit basis gate

 In conjunction with the single-qubit gates, need just a single


entangling gate for universal control (ideally well-calibrated)
 Due to physics of the cross resonance effect, optimal direction of
CNOT (i.e. which qubit is control vs. target) depends on
frequency and anharmonicity of the qubits involved
–Implement CNOT in only one direction for each qubit pair
–Include directionality in coupling map given to user
 In practice, cross-resonance tone is split in half, with a refocusing
pulse in the middle to cancel slow fluctuations CNOT gates on a 5-qubit
chip Arrows go from
control to target

43 © 2017 IBM Corporation


The image part with relationship ID rId2 was not found in the file.

Different Backends

44 https://quantumexperience.ng.bluemix.net/qx/devices © 2017 IBM Corporation


Additional backend information
https://github.com/QISKit/ibmqx-backend-information
Much more than superconducting qubits on the cloud!
Community of over 60,000 users

Over a million
experiments… from all
seven continents!

Explanatory videos
The image part with relationship ID rId2 was not found in the file.

• Quantum software and architectures


OpenQASM

47 © 2017 IBM Corporation


OpenQASM (Quantum Assembly Language)
The image part with relationship ID rId2 was not found in the file.

Express data dependency but not explicit


timing of instructions; separation of
quantum and classical processing;
hardware agnostic
https://arxiv.org/abs/1707.03429
Open to discussions about
https://github.com/QISKit/openqasm extensions and modifications!
48 © 2017 IBM Corporation
OpenQASM features
The image part with relationship ID rId2 was not found in the file.

 Define quantum and classical registers: qreg qr[8]; creg cr[8];


 Apply built-in unitary operations U and CX: U(pi/2,0,pi) qr[0]; CX
qr[0],qr[1];
 Define additional gates as subroutines using combinations of U and CX:
gate swap a,b { //swap the quantum states of qubits a and b
CX a,b;
CX b,a;
CX a,b;
}

 Include subroutines defined in other files: include “qelib1.inc”


 Perform register-level operations: h qr; CX qra,qrb;
 Measure qubits: measure qr[0] -> cr[0];
 Use barriers to limit compiler optimizations: x qr[0]; barrier qr[0]; x
qr[0];
 Apply classically conditioned operations: if (cr[0]==1) { x qr[1]; }
49 © 2017 IBM Corporation
The image part with relationship ID rId2 was not found in the file.

QISKIT API
• Quantum software and architectures

50 © 2017 IBM Corporation


QISKit API: an interface to quantum hardware
Submit requests for processing by quantum
hardware
– Name of quantum backend to use
High-level controller
– Quantum circuit(s) to run, in QASM format
– # of trials (“shots”) to run

Retrieve results and metadata for client-side


processing online 16Q 5Q
– Probability of each outcome sims controller controller
– Execution time and duration
– Most recent calibration data at time of execution

Get backend details


– Static properties: device type, qubit coupling map, basis gates, description/comments
– Dynamic properties: coherence times, operation fidelities, time of last calibration
– Status: availability, length of job queue

Token-based authentication, tracking of


“credits”
QISKit API: connecting to the IBM Q Experience
 Connect the QISKit API (see github.com/QISKit/qiskit-api-py) to the IBM Q Experience

 Get a list of IBM Q Experience backends currently online

 Get details about a given backend

...
QISKit API: making a Bell state
Submit job with QASM for making Bell state

...

Check job status

Retrieve results

 As expected, 00 and 11 appear with similar probabilities


and 01 and 10 are suppressed
That’s great, but…

What if I want to work with many qubits?


What if I want to optimize my program to maximize fidelity?
What if I want to assemble complex circuits from simple ones?
What if I want to use a high level language to construct my circuits?
What if I want to avoid certain qubits based on device calibration
data?
What if I want to run the same circuit on completely different
quantum hardware?
What if …. ?
The image part with relationship ID rId2 was not found in the file.

QISKIT SDK
• Quantum software and architectures

55 © 2017 IBM Corporation


Documentation from getting
started to developing

Open development process


PYTHON

SWIFT

JAVASCRIPT
QISKit SDK Quantum Program
Quantum and Classical Registers
 Goal: enable research and further
development of applications for near-term
quantum backends
Quantum Circuits
Central components:
– Quantum Program class (see illustration)
– Quantum circuit transcompiler
– Quantum circuit backends

Typical workflow: Backend Directory


1. Initialize quantum program
2. Define quantum and classical registers
3. Build quantum circuits
4. Rewrite circuits to run on target backend
5. Execute job
Execution Results
6. Analyze results
State Counts
00000 439
github.com/QISKit/qiskit-sdk-py 00011 561
The image part with relationship ID rId2 was not found in the file.

QISKit: Getting started

 Download qiskit-tutorial from https://github.com/QISKit/qiskit-tutoriall


• Install qiskit (optionally download SDK from https://github.com/QISKit/qiskit-sdk-py)
• Navigate to qiskit-tutorial folder and launch Jupyter notebook

• Create a new Python 3 notebook and import qiskit

59 © 2017 IBM Corporation


Initializing a quantum program

The main interface to QISKit is the QuantumProgram class.


• Collection of quantum circuits and methods to interact with them
• Build and store quantum circuits
• Import or export OpenQASM text circuits
• Interface with backends to run experiments (on real hardware or simulators)

Basic steps to initialize a new program


1. Create a new QuantumProgram
2. Add 1 or more quantum registers
3. Add 1 or more classical registers
Bell state with QISKit: building a basic circuit

Create quantum program and


associated registers

Define a circuit to prepare a


Bell state
qiskit.extensions.standard
defines methods for common
operations (similar to qelib1.inc).
Need others? Add an extension!
Define a circuit to measure
both qubits in the default (Z)
basis
What’s in the standard extension?

Available circuit operation methods:


• Single qubit gates
• iden, x, y, z, h, s, sdg, t, tdg, u1, u2, u3, rx, ry, rz
• Two qubit gates (cx, cy, cz, cu1, cu2)
• Three qubit gates (ccx, cswap)
• Measurement, reset, and barrier (measure, reset, barrier)
Additional circuit construction methods:
 Invert gates with .inverse
– mycirc.u1(pi/8).inverse()
 Add a classical control with .c_if
– mycirc.x(q[0]).c_if(outcome,1)
Bell state with QISKit: getting some information

Get quantum circuit and


program register names

Get OpenQASM text for the


quantum circuits
Bell state with QISKit: harnessing circuit modularity

For more evidence the qubits are actually entangled, measure in a


different basis and verify that the correlation persists
Make a circuit for measuring in the X basis:

Now add two new circuits to our Quantum Program, each made by
combining the Bell state preparation circuit with one of the
measurement circuits:
Bell state with QISKit: inquiring about backends

Request backend names from


the program object

Configure the API to access the


online backends
Bell state with QISKit: execution
 Send both circuits to the IBM Q Experience’s 5-qubit chip for execution:

 … and in a couple minutes:

 Indeed, outcomes are correlated regardless of the choice of measurement basis



Bell state with QISKit: circuit rewriting
 Q: But how did these circuits even run at all?!
From qiskit.extensions.standard.cx:

ibmqx4
Wrong direction!

 A: Execute = compile + run

Original QASM Rewritten QASM


Rewrite gates in backend’s basis
Re-map circuit given coupling map

 Transcompiler goals:
– Map a given circuit into one that can be run on target backend
– Optimize circuit performance by eliminating redundancies in instruction sequences
Nuts and bolts: basic circuit rewriting
The circuit rewriting methods (mapper module) execute a few simple
fixed passes
– 1. “unroll”: expands gate definitions to some level, expands loops
– 2. “swap_mapper”: selects a layout and inserts SWAP gates as needed
– 3. “cx_cancellation”: removes even runs of CNOT gates
– 4. “optimize_1q_gates”: simplifies runs of single qubit gates

SWAP insertion algorithm solves using a randomized, greedy layer-


by-layer approach

Single qubit gate optimization attempts to minimize number of pulses

Modular framework in development to enable extensibility and


research
Bell state with QISKit: local Python simulators

Often we would like to examine the expected quantum state


• Using the simulator in QISKit we may “cheat” and ask directly for the state
Run these examples on circuits that don’t contain measurement

Set ”shots=1” for this


behavior
Bell state with QISKit: plotting states
Plotting a state using the visualization module:
• The qiskit.tools.visualization model contains several methods of visualizing
quantum states:
Example of advanced QISKit features

• To fully determine a 2-qubit state experimentally, we need to obtain


counts from 9 different measurement circuits corresponding to the
Pauli group elements, i.e. we need to do quantum state
tomography.

Is there an easier way to implement this?


• Yes! We have the full power of Python, so write functions that
automate necessary steps
• Many useful routines are already implemented in QISKit modules,
and more are coming!
Bell state with QISKit: state tomography

• We can implement quantum state tomography using the QISKit


tomography module:

• This automates generating of measurement circuits, and


reconstructing the density matrix:
• Generate measurement circuits:
Bell state with QISKit: state tomography

• Execute the circuits on a simulator to obtain count results:


Bell state with QISKit: state tomography

• Post-process data to reconstruct state


The image part with relationship ID rId2 was not found in the file.

Prepare a trial state 𝝍 𝜽 Use classical optimizer to choose


and compute its energy 𝑬(𝜽) a new value of 𝜽 to try
75 © 2017 IBM Corporation
The image part with relationship ID rId2 was not found in the file.

76 © 2017 IBM Corporation


The image part with relationship ID rId2 was not found in the file.

77 © 2017 IBM Corporation


The image part with relationship ID rId2 was not found in the file.

Experimental Results (2 qubits): Hydrogen Molecule

HA: 1s1 HB: 1s1


4 spin orbitals mapped to 2 qubits
Equilibrium d = 0.735 Å
H = (-1.05237)II+(0.39735)ZI+(0.39735)IZ+
(0.11279)ZZ+(0.18093)XX
Dissociation d = 4 Å HA HB
H = (-0.70461)II+(0.00012)ZI+(0.00012)IZ+
(1.6673e-10)ZZ+(0.33438)XX
d
Equilibrium Dissociation
(d=0.735 Å) (d=4 Å)
Exact -1.858 -1.0655
1 UENT -1.8365 -1.0595
2 UENT -1.8229 -1.0586
arXiv:1704.05018
78 February © 2017 IBM Corporation
2017
78
Toolboxes and tutorials
Toolboxes (part of SDK): libraries of helper
functions for…
– Quantum state visualization and analysis
– Optimization problems
– Quantum chemistry problems
– Verification and validation
– File I/O

Tutorials (github.com/QISKit/qiskit-
tutorial): Jupyter notebooks illustrating
concepts, usage, applications, etc.
– Currently 24 notebooks spanning 5 categories:
1. Introduction to the tools
2. Exploring quantum information concepts
3. Verification tools for quantum information science
4. Applications of short-depth quantum circuits
5. Quantum games
- Interface for experiments or simulations to enable research and applications pre-fault-tolerance
- Growing software stack, including higher-level tutorials and examples
- Interface to quantum devices: IBM QX and local devices
- Open source development
- New releases every few months
- Ongoing projects to improve circuit rewriting architecture, simulators, visualizers, backend interfaces

explore https://www.qiskit.org/

contribute https://github.com/QISKit

help define https://qiskit.slack.com/

You might also like