0% found this document useful (0 votes)
21 views

Quantumcomputing Cern

The document provides an introduction to quantum computing concepts through a practical course. It discusses tools for quantum computing like Jupyter Notebooks and the IBM Quantum Experience. It explains that quantum computing uses quantum mechanical properties like superposition and entanglement to perform calculations. The document outlines models of quantum computing and technologies used to build quantum computers. It describes programming quantum computers using different frameworks and the basic elements of a quantum circuit like qubits, gates, and measurement.

Uploaded by

datumtatum
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views

Quantumcomputing Cern

The document provides an introduction to quantum computing concepts through a practical course. It discusses tools for quantum computing like Jupyter Notebooks and the IBM Quantum Experience. It explains that quantum computing uses quantum mechanical properties like superposition and entanglement to perform calculations. The document outlines models of quantum computing and technologies used to build quantum computers. It describes programming quantum computers using different frameworks and the basic elements of a quantum circuit like qubits, gates, and measurement.

Uploaded by

datumtatum
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 30

A Practical Introduction to Quantum

Computing: From Qubits to Quantum


Machine Learning and Beyond

Elı́as F. Combarro
[email protected]

CERN openlab (Geneva, Switzerland) - University of Oviedo (Oviedo, Spain)

CERN - November/December 2020


Part I

Introduction: quantum computing...


the end of the world as we know it?

2 / 30
I, for one, welcome our new quantum overlords

Image credits: sciencenews.org


3 / 30
Philosophy of the course

Image credits: Modified from an Instagram image by Bob MacGuffie

4 / 30
Tools and resources
• Jupyter Notebooks
• Web application to create and execute notebooks that
include code, images, text and formulas
• They can be used locally (Anaconda) or in the cloud
(mybinder.org, Google Colab...)
• IBM Quantum Experience
• Free online access to quantum simulators (up to 32 qubits)
and actual quantum computers (1, 5 and 15 qubits) with
different topologies
• Programmable with a visual interface and via different
languages (python, qasm, Jupyter Notebooks)
• Launched in May 2016
• https://quantum-computing.ibm.com/

Image credits: IBM 5 / 30


Tools and resources (2)

• Quirk
• Online simulator (up to 16 qubits)
• Lots of different gates and visualization options
• http://algassert.com/quirk
• D-Wave Leap
• Access to D-Wave quantum computers
• Ocean: python library for quantum annealing
• Problem specific (QUBO, Ising model...)
• https://www.dwavesys.com/take-leap

6 / 30
The shape of things to come

Image credits: Created with wordclouds.com

7 / 30
What is quantum computing?
Quantum computing
Quantum computing is a computing paradigm that exploits
quantum mechanical properties (superposition, entanglement,
interference...) of matter in order to do calculations

Image credits: Erik Lucero

8 / 30
Models of quantum computing
• There are several models of quantum computing (they’re
all equivalent)
• Quantum Turing machines
• Quantum circuits
• Measurement based quantum computing (MBQC)
• Adiabatic quantum computing
• Topological quantum computing
• Regarding their computational capabilities, they are
equivalent to classical models (Turing machines)

Image credits: Getty Images


9 / 30
Quantum and classical computational complexity

Image credits: wikipedia.org

10 / 30
What technologies are used to build quantum
computers?

Image credits: Graphic by C. Bickle/Science data by Gabriel Popkin

11 / 30
What is a quantum computer like?

Image credits: IBM

The Sounds of IBM: IBM Q


12 / 30
Programming a quantum computer
• Different frameworks and programming languages:
• qasm
• Qiskit (IBM)
• Cirq (Google)
• Forest/pyqil (Rigetti)
• Q# (Microsoft)
• Ocean (D-Wave)
• ...
• Most of them for quantum circuit specification

Image credits: IBM

13 / 30
What are the elements of a quantum circuit?

• Every computation has three elements: data, operations


and results
• In quantum circuits:
• Data = qubits
• Operations = quantum gates (unitary transformations)
• Results = measurements

Image credits: Adobe Stock

14 / 30
Part II

One-qubit systems: one qubit to


rule them all

15 / 30
What is a qubit?
• A classical bit can take two different values (0 or 1). It is
discrete.
• A qubit can “take” infinitely many different values. It is
continuous.
• Qubits live in a Hilbert vector space with a basis of two
elements that we denote |0i y |1i.
• A generic qubit is in a superposition
|ψi = α |0i + β |1i
where α and β are complex numbers such that
|α|2 + |β|2 = 1

Image credits: https://prateekvjoshi.com/ 16 / 30


Measuring a qubit
• The way to know the value of a qubit is to perform a
measurement. However
• The result of the measurement is random
• When we measure, we only obtain one (classical) bit of
information
• If we measure the state |ψi = α |0i + β |1i we get 0 with
probability |α|2 and 1 with probability |β|2 .
• Moreover, the new state after the measurement will be |0i
or |1i depending of the result we have obtained
(wavefunction colapse)
• We cannot perform several independent measurements of
|ψi because we cannot copy the state (no-cloning
theorem)

17 / 30
The Bloch sphere

• A common way of representing the state of a qubit is by


means of a point in the surface of the Bloch sphere
• If |ψi = α |0i + β |1i with |α|2 + |β|2 = 1 we can find angles
γ, δ, θ such that
θ
α = eiγ cos
2
θ
β = eiδ sin
2
• Since an overall phase is physically irrelevant, we can
rewrite
θ θ
|ψi = cos |0i + eiϕ sin |1i
2 2
with 0 ≤ θ ≤ π and 0 ≤ ϕ < 2π.

18 / 30
The Bloch sphere (2)
• From |ψi = cos 2θ |0i + eiϕ sin 2θ |1i we can obtain spherical
coordinates for a point in R3
(sin θ cos ϕ, sin θ sin ϕ, cos θ)

Image credits: wikipedia.org


19 / 30
What are quantum gates?

• Quantum mechanics tells us that the evolution of an


isolated state is given by the Schrödinger equation

• In the case of quantum circuits, this implies that the


operations that can be carried out are given by unitary
matrices. That is, matrices U of complex numbers verifying

UU † = U † U = I

where U † is the conjugate transpose of U.


• Each such matrix is a possible quantum gate in a quantum
circuit

20 / 30
Reversible computation
• As a consequence, all the operations have an inverse:
reversible computing
• Every gate has the same number of inputs and outputs
• We cannot directly implement some classical gates such
as or , and, nand, xor ...
• But we can simulate any classical computation with small
overhead
• Theoretically, we could compute without wasting energy
(Landauer’s principle, 1961)

Image credits: wikipedia.org 21 / 30


One-qubit gates

• When we have just one qubit |ψi = α |0i + β |1i, we usually


 
α
represent it as a column vector
β
• Then, a one-qubit gate can be identified with a matrix
 
a b
U= that satisfies
c d
    
a b a c 1 0
=
c d b d 0 1

where a, b, c, d are the conjugates of complex numbers


a, b, c, d.

22 / 30
Action of a one-qubit gate

• A state |ψi = α |0i + β |1i is transformed into


    
a b α aα + bβ
=
c d β cα + dβ

that is, into the state |ψi = (aα + bβ) |0i + (cα + dβ) |1i
• Since U is unitary, it holds that

|(aα + bβ)|2 + |(cα + dβ)|2 = 1

23 / 30
The X or NOT gate

• The X gate is defined by the (unitary) matrix


 
0 1
1 0

• Its action (in quantum circuit notation) is

|0i X |1i

|1i X |0i
that is, it acts like the classical NOT gate
• On a general qubit its action is

α |0i + β |1i X β |0i + α |1i

24 / 30
The Z gate

• The Z gate is defined by the (unitary) matrix


 
1 0
0 −1

• Its action is
|0i Z |0i

|1i Z − |1i

25 / 30
The H or Hadamard gate
• The H or Hadamard gate is defined by the (unitary) matrix
 
1 1 1

2 1 −1
• Its action is
|0i+|1i
|0i H √
2

|0i−|1i
|1i H √
2
• We usually denote

|0i + |1i
|+i := √
2
and
|0i − |1i
|−i := √
2
26 / 30
Other important gates

• Y gate
 
0 −i
i 0
• S gate
 
1 0
π
0 ei 2
• T gate
 
1 0
π
0 ei 4
• The gates X , Y and Z are also called, together with the
identity, the Pauli gates. An alternative notation is σX , σY ,
σZ .

27 / 30
Rotation gates

• We can define the following rotation gates

cos 2θ −i sin 2θ
 
−i θ2 X θ θ
RX (θ) = e = cos I − i sin X =
2 2 −i sin 2θ cos 2θ

cos 2θ − sin 2θ
 
θ θ θ
RY (θ) = e−i 2 Y = cos I − i sin Y =
2 2 sin 2θ cos 2θ

θ
!
e−i 2
 
−i θ2 Z θ θ 0 1 0
RZ (θ) = e = cos I−i sin Z = ≡
2 2 0
θ
ei 2 0 eiθ

• Notice that RX (π) ≡ X , RY (π) ≡ Y , RZ (π) ≡ Z ,


RZ ( π2 ) ≡ S, RZ ( π4 ) ≡ T

28 / 30
Using rotation gates to generate one-qubit gates

• For any one-qubit gate U there exist a unit vector


r = (rx , ry , rz ) and an angle θ such that

θ θ θ
U ≡ e−i 2 r ·σ = cos I − i sin (rx X + ry Y + rz Z )
2 2
• For instance, choosing θ = π and r = ( √1 , 0, √1 ) we can
2 2
see that
θ 1
H ≡ e−i 2 r ·σ = −i √ (X + Z )
2
• Additionally, it can also be proved that there exist angles α,
β and γ such that

U ≡ RZ (α)RY (β)RZ (γ)

29 / 30
Hello, quantum world!

• Our very first quantum circuit!

|0i H

• After applying the H gate the qubit state is

|0i + |1i

2
• When we measure, we obtain 0 or 1, each with 50%
probability: we have a circuit that generates perfectly
uniform random bits!

30 / 30

You might also like