MULT90063 Introduction to Quantum Computing
Week by week
(1) Introduction to quantum computing
(2) Single qubit representation and operations
Copyright By PowCoder代写 加微信 powcoder
(3) Two and more qubits
(4) Simple quantum algorithms
(5) Quantum search (Grover’s algorithm)
(6) Quantum factorization (Shor’s algorithm)
(7) Quantum supremacy and noise
(8) Programming real quantum computers (IBM Q)
(9) Quantum error correction (QEC)
(10) QUBO problems and Adiabatic Quantum Computation (AQC)
(11) Variational/hybrid quantum algorithms (QAOA and VQE)
(12) Solving linear equations, QC computing hardware
MULT90063 Introduction to Quantum Computing
3.1 The representation for qubits
3.2 Quantum operations on qubits
3.3 Qubit gates in matrix form and the Pauli matrices
4.1 The Pauli gates X, Y and Z and the QUI
4.2 Qubit operations around non-cartesian axes – H and R gates 4.3 Matrix exponential and arbitrary rotations
Practice class 2
Bloch sphere and single qubit logic operations on the QUI
MULT90063 Introduction to Quantum Computing
Opportunity to be a student representatives
Your feedback is valuable to us.
If you would like to representative for this subject, email me at
MULT90063 Introduction to Quantum Computing
Lecture 2 recap
A qubit in “ket” notation:
Prepared state |𝜓ñ Outcome
✓ ◆ “0” | i=a0|0i+a1|1i= or
|𝜓ñ “collapsed” to | i!|0i
|a0|2 + |a1|2 = 1 Outcome probability
Prob[“0”]=|a0|2 Prob[“1”]=|a1|2
measurement “1” ! | i = |a0|ei✓0 |0i + |a1|ei✓1 |1i
| i!|1i Amplitudes in polar notation
“matrix” notation: dual “bra” notation:
|0i=1 |1i=0 a0 a0 | i=a0|0i+a1|1i= | i=
h | = [a⇤0 a⇤1 ] a0,a1 2 C
h| i⌘h|| i innerproduct“bra-ket”: | i= a | i= c h | i⌘h || i =⇥ a⇤ b⇤ ⇤ c
= a⇤ b⇤=a⇤c+b⇤d d
MULT90063 Introduction to Quantum Computing
More detail about measurement
MULT90063 Introduction to Quantum Computing
Projective measurement
What is the state of the system after a measurement is made?
Two useful operators, known as projectors:
P0 =|0ih0| P1 =|1ih1|⌦I
=1 0 ⌦1 0 =0 0 000101
610007 200003
010067 Can also easily construct other projectors (using outer product).0 0 0 0
= 64 0 0 0 0 75 = 64 0 0 1 0 75 0000 0001
MULT90063 Introduction to Quantum Computing
One-qubit measurement
Measurement on a two-qubit state:
(1) Apply projector into the measured state p (2) Renormalize the state
| i=a|0i+b|1i
Apply Born’s rule to work out the measurement probabilities.
0 a|0i i✓ |i=p =e0|0i
In quantum mechanics measurement necessarily disturbs the state you are measuring! Taking a superposition and measuring it, a superposition of many different states becomes just one. This is known as the “collapse” of the wavefunction.
If state is measured to be to be “0”, apply
P0 and renormalize to get the collapsed state:
If state is measured to be “1”, apply
P1 and renormalize to get the collapsed state:
0 b |1i i✓
Pm| i p(m)
| i = p|b|2 = e 1 |1i
MULT90063 Introduction to Quantum Computing
The representation for qubits
MULT90063 Introduction to Quantum Computing
A convenient geometric representation of single qubit states is the Bloch sphere:
|0i |1i hYi
|0i i|1i
|0i + |1i p2
|0i + i|1i
MULT90063 Introduction to Quantum Computing
What is the z-projection?
Let’s relate the Bloch sphere to states. Average, or “expectation” of the measured z component:
+1 value measured for “0” state
|0i |1i h Y pi 2
|0i i|1i
|0i + |1i p2
|0i + i|1i hXi
-1 value measured for “1” state
Average, or “expectation” value of the z (after measurement):
hZi = (+1)P0 + ( 1)P1
MULT90063 Introduction to Quantum Computing
Z-projection continued
Expressing probabilities p0 and p1 in terms of the state:
Pp =|a |2 =a⇤a =h |0ih0| i 0 0 00
Therefore,
P1=|a| =aa =h |1ih1| i
p hZi=(+1) +( 1)P1
=(+1)h |0ih0| i+( 1)h |1ih1| i =h (|0ih0| |1ih1|) i
Z=10 0 1
MULT90063 Introduction to Quantum Computing
Expectation Values
The expectation value of an operator is given by: hAi=h |A| i
Hermitian operators correspond to physical observables – the expectation value then gives the average value of that quantity when measured in a given state.
For example, consider measuring the the total energy of the system represented by the energy operator, i.e. the “Hamiltonian” 𝓗 which in matrix representation is
H=✓E0 0◆ 0 E1
h1|H|1i = E1
Expectation values:
h0|H|0i = E0
MULT90063 Introduction to Quantum Computing
Expectation values in a superposition state
For example, consider measuring the the total energy of the system
H=✓E0 0◆ 0 E1
For the equal superposition state:
|0i + |1i |+i = p2
h+|H|+i= E0 +E1 2
The expectation value is:
MULT90063 Introduction to Quantum Computing
Can think about the expectation along any of the cartesian axes. Equivalent to taking expectation values of any of these matrices:
Y=0 i i0
Z=10 0 1
These matrices are known as the Pauli matrices. Worth remembering!
MULT90063 Introduction to Quantum Computing
Pauli matrices & Bloch sphere axes
The expectation values of the Pauli matrices (operators) define the axes on the Bloch sphere.
|0i i|1i
|0i + i|1i hXi
MULT90063 Introduction to Quantum Computing
Expectation of
Recall: expectation value for an operator:
| 0 i = 10
hXi=⇥1 0⇤0 1 1 =0
⇥ ⇤0 i 1
hYi=10 i0 0=0 p
|0i i|1i
⇥ ⇤ |0i+|1i
hAi = h |A| i
hZi=10101=1 p2 0 1 0
|0i + i|1i hXi
MULT90063 Introduction to Quantum Computing
Expectation of
Recall: expectation value for an operator:
| 1 i = 01 hXi=⇥0 1⇤0 1 0 =0
hAi = h |A| i hZi
101 hYi=⇥0 1⇤0 i 0 =0
|0i i|1i
|0i + i|1i i01 p
⇥ ⇤1 0 0 hZi= 0 1 0 1 1 = 1
MULT90063 Introduction to Quantum Computing
Expectation values of Pauli matrices
Recall: expectation value for an operator:
|0i + |1i |+i = p2
hXi=1⇥1 1⇤0 1 1 =1 2101
hAi = h |A| i hZi
hYi=1⇥1 1⇤0 i 1 =0
hZi=1⇥1 1⇤1 0 1 =0 2 0 11
|0i i|1i
|0i + |1i p2
|0i + i|1i hXi
MULT90063 Introduction to Quantum Computing
Transformation to Bloch form
Recall,arbitraryqubitstate:
Probability normalisation:
We can rearrange as:
| i=ei✓0 ⇣|a0||0i+|a1|ei(✓1 ✓0)|1i⌘=ei✓global ✓cos✓B |0i+sin✓Bei B |1i◆ 22
| i=a |0i+a |1i=
! | i = |a |e 0 |0i + |a |e 1 |1i
0 1 0a1 1 |a0|2 + |a1|2 = 1
|a0|⌘cos✓B NB: cos!! “+ sin!! “=1 2″”
B ⌘ ✓1 ✓0
|a1| ⌘ sin ✓B 2
i.e. |a0|2+|a1|2=1
For single qubit we ignore global phase 𝜃#$%&’$ → state expressed via “Bloch” angles 𝜃( , 𝜙( Suggests a representation on a sphere – the
MULT90063 Introduction to Quantum Computing
Re-writing the state…
So, a qubit state (global phase set to zero) can be represented by two angles:
| i = a |0i + a |a i 011
| i=a0|0i+a1|1i=!cos |0i+sin e B |1i a1 2 2
The real variables 𝜃B and 𝜙B dictate the position of this state on the Bloch sphere.
| i=a0|0i+a1|a1i
Definitionof𝜃B: |a|⌘sin✓B |a1|
And the azimuthal angle 𝜙( runs from 0 to 2𝜋
NB. angles distinct from amplitude polar angles…
p|a0|2 +|a1|2 =1
✓ ⌘✓ ✓ ✓ ✓B BB 1 0 |Ba | ⌘ cos
s |0i+sin eB|1i2
MULT90063 Introduction to Quantum Computing
Qubit states on the Bloch sphere
||ii=aa|0|0ii+aa||a1ii=!cos |0i+sin
00 111 a12 2
B ⌘ ✓1 ✓0 |a0| ⌘ cos ✓B
BBp2 𝜙p2BB
𝜃B=0, 𝜙B=0 | i
𝜃 =𝜋/2, 𝜙 =3𝜋/2|0i i|1i
p2 𝜃B=𝜋/2, 𝜙B=𝜋
|0i + i|1i 𝜃 =𝜋/2, 𝜙 =𝜋/2
|0i + |1i p2
𝜃B =𝜋/2, 𝜙B=0
|1i 𝜃B=𝜋,𝜙B=0
MULT90063 Introduction to Quantum Computing
Polar co-ordinates and global phase
Recall, an arbitrary qubit state: Which we can rearrange to be:
i=|a|ei✓a |0i+|b|ei✓b |1i |1
| i = a |0i + b
| i=ei✓a ⇣|a||0i+|b|ei(✓b ✓a)|1i⌘=ei✓a ⇣|a||0i+|b|ei(✓b ✓a)|1i⌘
| i = ei✓a ✓cos ✓ |0i + sin ✓ei(✓b ✓a) |1i◆ = ei✓global ✓cos ✓ |0i + sin ✓ei |1i◆ 22 22
The global phase is unimportant, and Definition
can never be measured in experiment. of 𝜃: |b|
The other variables 𝜃 and 𝜙 relate to the position of this state on the Bloch sphere:
| i=a|0i+b|1i!cos2✓|0i+sin2✓ei |1i
p|a|2 + |b|2 = 1
MULT90063 Introduction to Quantum Computing
States on the Bloch sphere
| i=a|0i+b|1i!cos2✓|0i+sin2✓ei |1i
p2 𝜃=𝜋/2, 𝜙= 𝜋
𝜃=𝜋/2, 𝜙= 3𝜋/2
|0i i|1i p2
|0i + |1i p2
𝜃=𝜋/2, 𝜙=0
|0i + i|1i p2
𝜃=𝜋/2, 𝜙= 𝜋/2
MULT90063 Introduction to Quantum Computing
Qubit states on the Bloch sphere – example (Prac Class 1)
p3 i ✓a0◆ Recall, in the prac class we produced the state: ||0i != a0 |0|i0i++a1 |1i|1=i = a
i.e. |a0| = 0.866, 𝜃- = 0
We want to express this on the …
𝜙 =𝜃-𝜃 =−$=−90& ! ” # %
i.e. |a1| = 0.500, 𝜃+ = – 𝜋/2
| | ii==aa |0|0ii+aa ||a1ii=! cos |0i + sin e 00 111 a12 2
cos!” = ) ⟶𝜃( =2cos*+ ) =60, “””
𝜃B p3 i ✓a0 ◆
| | 0 i i != a 0 | 0 | i 0 i + + a 1 | 1 i | 1 = i = a 221
|0i |1i h Y p i 2
sin!” =sin30=+ ⟶𝑒./” =−𝑖 “”,
⟶ 𝜙(= – 90
|0i i|1i
p2 “X”axis
|0i + i|1i hXi
p2 “Y” axis
MULT90063 Introduction to Quantum Computing
Qubit states on the Bloch sphere – example (Prac Class 1)
p3 i ✓a0◆ Recall, in the prac class we produced the state: ||0i != a0 |0|i0i++a1 |1i|1=i = a
i.e. |a0| = 0.866, 𝜃- = 0
We want to express this on the …
𝜙 =𝜃-𝜃 =−$=−90& ! ” # %
QUI Bloch spheres:
i.e. |a1| = 0.500, 𝜃+ = – 𝜋/2
| | ii==aa |0|0ii+aa ||a1ii=! cos |0i + sin e 00 111 a12 2
𝜃B p3 i ✓a0 ◆
| | 0 i i != a 0 | 0 | i 0 i + + a 1 | 1 i | 1 = i = a 221
|0i |1i h Y p i 2
|0i i|1i
p2 “X”axis
|0i + i|1i hXi
p2 “Y” axis
|𝜓 ⟩ = 2 |0⟩ + 2 |1⟩
MULT90063 Introduction to Quantum Computing
The – Cartesian Axes
Bloch sphere representation:
||ii=aa|0|0ii+aa||a1ii=!cos
00 111 a12 2
|0i i|1i
C/f cartesian axes labelling: z
|0i |1i hYpi2
p2 “X”axis
|0i + i|1i hXi
p2 “Y” axis
These X, Y and Z axes are not our usual “real space” cartesian axes…these are a
representation of the space in which the single-qubit states live… …but they are used a lot in describing quantum logic operations!
MULT90063 Introduction to Quantum Computing
Quantum operations on qubits
MULT90063 Introduction to Quantum Computing
Quantum operations in general
A quantum operation “U ” takes a state |𝜓⟩ and changes it to a new state |𝜓0⟩ |𝜓⟩ U |𝜓:⟩
Mathematically, we write this as: 𝑈|𝜓⟩ = |𝜓0⟩
i.e. U acting on the state |𝜓⟩ gives the new state |𝜓0⟩
The Bloch sphere is a useful way to visualise how these operations work…(and how it’s done in the QUI)
|0i“Z” axis
The operation “U ” moves the state across the surface of the Bloch sphere.
MULT90063 Introduction to Quantum Computing
Qubit operations/Bloch sphere – example, (Prac Class 1)
Recall, in the prac class we produced the state:
p3 i ✓a0◆ ||0i != a0 |0|i0i++a1 |1i|1=i = a
|0i + |1i Operation U
i.e. |a0| = 0.866, 𝜃- = 0
We want to express this on the …
𝜙 ! = 𝜃 ” – 𝜃 # = − $% = − 9 0 & QUI animations:
i.e. |a1| = 0.500, 𝜃+ = – 𝜋/2
p3 i ✓a◆ |0i 0
|0i i|1i
p2 “X”axis
|0i |1i h Y p i 2
| | 0 i i != a 0 | 0 | i 0 i + + a 1 | 1 i | 1 = i = a | 0 i + 221
|0i + i|1i hXi
p2 “Y” axis
|𝜓 ⟩ = 2 |0⟩ + 2 |1⟩
MULT90063 Introduction to Quantum Computing
Qubit gates in matrix form and the Pauli matrices
MULT90063 Introduction to Quantum Computing
The “Cartesian” quantum operations: X, Y, Z
We can specify the state moving across the Bloch sphere in many ways, but the “Cartesian” operations are very simple – a rotation of 𝜋 (180o) about any of X, Y, or Z axes:
“X” axis |#$⟩
NB. Perspectives not 100% accurate!
| i!| 0i hYi
hY i “hYX”iaxis
hXi “Y” axis
Y-gate: rotate around Y-axis by !
X-gate: rotate around X-axis by !
|1i “hYX”iaxis
Z-gate: rotate around Z-axis by ! |1i
The cartesian rotations are usually referred to as the “Pauli” operators X, Y, Z
MULT90063 Introduction to Quantum Computing
The X gate – acting on the basis states |0⟩ and |1⟩
Circuit symbol:
“X” axis |#$⟩
e.g. system starts in: |𝜓⟩ = |0⟩ (north pole)
hYi “hYX”iaxis
“hYX”iaxis
𝜋 (180o) sends to |𝜓’⟩ = |1⟩
X gate: rotation about X-axis by (south pole)
e.g. system starts in: |𝜓⟩ = |1⟩ (south pole)
X-gate: rotate around X-axis by !
|”$⟩ |1i “Z” axis
h gate: rotation about X-axis by (north pole)
“hYX”iaxis
𝜋 (180o) sends to |𝜓’⟩ = |0⟩
We write X|𝜓⟩ = |𝜓0⟩
X|0⟩ = |1⟩ X|1⟩ = |0⟩
hence: “flip gate”
MULT90063 Introduction to Quantum Computing
The X gate – acting on general states 𝑎<|0⟩ + 𝑎=|1⟩
Circuit symbol:
“X” axis |#$⟩
hYi “hYX”iaxis
On the computational states the X-gate operation is a “bit flip”:
X|0⟩ = |1⟩ X|1⟩ = |0⟩
Quantum mechanics is inherently linear, so the X-gate acting on a linear superposition is:
X-gate: rotate around X-axis by !
X(a0|0i+a1|1i)= 0 1 a0 = a1 10a1 a0
i.e. X(a0|0i+a1|1i)=a1|0i+a0|1i Or we can write in “ket” notation:
a0 |0i + a1 |1i ! a1 |0i + a0 |1i
MULT90063 Introduction to Quantum Computing
The X gate in matrix form
Action of X-gate in “ket” form: a0 |0i + a1 |1i ! a1 |0i + a0 |1i
What is the X-gate in “matrix” form?
Recall“matrix” 1 0 a0 | i=a0
notation: |0i= 0 |1i= |1i=a0|0i+a1|1i= a1 a1
Operations in matrix representation: Action of X-gate in matrix form:
|𝜓!⟩ = 𝑈 |𝜓⟩ 𝑎-0 =2x2 𝑎-
𝑎 0⟩+𝑎 1⟩= 𝑎! ⟶𝑎 0⟩+𝑎 1⟩= 𝑎" ! " 𝑎" " ! 𝑎!
𝑎- X 𝑎+ i.e. 𝑎+⟶𝑎-
In matrix notation, in general:
X𝑎!=0 1 𝑎!=𝑎" 𝑎" 10𝑎" 𝑎!
MULT90063 Introduction to Quantum Computing
The X gate in matrix form – the Pauli matrices
|𝜓!⟩ = 𝑋 |𝜓⟩
𝑎-0 =01𝑎- 𝑎+0 1 0 𝑎+
All cartesian axes – the Pauli matrices for X, Y and Z:
This is the so-called matrix...one of three Pauli matrices representing X, Y and Z operations...
hY i “hYX”iaxis
“hYX”iaxis
X-gate: rotate around X-axis by !
Y-gate: rotate around Y-axis by !
“hYX”iaxis Z-gate: rotate around Z-axis by !
MULT90063 Introduction to Quantum Computing
3.1 The representation for qubits
3.2 Quantum operations on qubits
3.3 Qubit gates in matrix form and the Pauli matrices
4.1 The Pauli gates X, Y and Z and the QUI
4.2 Qubit operations around non-cartesian axes – H and R gates
4.3 Programming sequences over the qubit logic gate library 4.4 Note on the context and use of angles
Practice class 2
Bloch sphere and single qubit logic operations on the QUI
MULT90063 Introduction to Quantum Computing
Subject outline
Lecture topics (by week)
1 – Introduction to quantum computing and maths basics 2 – Single qubit representations and logic operations
3 – Two qubit states and logic gates
4 – Multi-qubit states and quantum arithmetic
5 – Classical complexity and simple quantum algorithms 6 – Cryptography and Shor’s quantum factoring algorithm
7 – Post quantum cryptography and quantum key distribution 8 – Quantum search algorithms
9 – Quantum algorithms for option pricing
10 – Optimisation problems on quantum computers
11 – Portfolio optimisation using quantum computers 12 – Quantum machine learning
Assignment schedule:
#1: Hand out in Week 2 #2: Hand out in Week 8
程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com