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

Module III_Quantum Computation

Engineering Physics Module 3 notes

Uploaded by

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

Module III_Quantum Computation

Engineering Physics Module 3 notes

Uploaded by

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

Introduction to Quantum Computers

• By 2020 to 2025, transistors will be so small and it will generate so much heat that
standard silicon technology may eventually collapse.

• Already intel has implemented 32 nm silicon technology.

• If scale becomes too small, electrons tunnel through micro-thin barriers between
wires corrupting signals.

• A quantum computer is a machine that performs calculations based on the laws of


quantum mechanics.

• A theoretical model is the quantum turing machine-Universal Quantum Computer.


Introduction to Quantum Computers
• In Quantum computing, the information is encoded/stored and manipulated using
single isolated atoms/photons/electrons.

• Since atoms/photons/electrons obey the law quantum mechanics, the algorithms are
also written based on quantum principles.

• The process of computation is incredibly fast but it has to be done by quantum


computers.
Eg:- 140 digit log number could be factored a billion times faster than classical computation.

• It is so powerful that a search engine can search every part of internet in half an hour.
Moore’s Law
• In the year 1965, Gardon Moore observed increasing
performance in the first few generations of the integrated-
circuit (IC) technology.
• Moore predicted that “the number of transistors per
square inch has doubled approximately every 2years
or 18 months” i.e. computing power doubles every 18
months”.
• The computer industry has followed this prediction since
then.

• The capabilities of many digital electronic devices are strongly linked to Moore’s law.
-Processing speed, memory capacity, sensors and even the number and size of pixels in digital cameras.
Plot shows the 50 years of Moore’s law
End of Moore’s Law
The question that arises is how long can Moore’s law
continues to hold and what are the ultimate
limitations……….!!!?.

According to the semiconductor size, the data size has reached


5 nanometer in 2021.

As the size of the semiconductors (Silicon) continues to


decrease, the use of transistors will end at the quantum level.

The most typical effects are electron tunneling among the


circuit.

Thus Quantum Computation is the option for the further


generation.
Differences Between Classical and Quantum Computing
Concept of Qubits & Properties
✓ The counterpart of a classical bit in quantum computing is Qubit.
✓ are similar to bits having two measurable states called 0 and 1.
✓ But Superposition, Entanglement, and Tunneling are all special
properties that define a qubit.

✓ Dirac representation: Qubits commonly expressed in quantum mechanical states


with mathematical formulism given by Dirac or “bra–ket” notation
✓ The state of a qubit is enclosed in the right half of an angled bracket, called the “ket”.
(i.e., |ψ⟩)
Qubits Properties

8
Qubits Properties
✓ Superposition: A qubit, |ψ⟩, is a superposition of both |0⟩ &|1⟩ : i.e., |ψ⟩ = α |0⟩ + β |1⟩

✓ Entanglement and Tunneling are the basic properties of a qubit.

✓ If measurements are carried out with a qubit in superposed state then the results will
be probabilistic. The total probability of a qubit must be 100%. i.e. |α|2 +|β|2 =1
(Normalization rule)

✓ Due to quantum nature, the qubit changes its state during its measurement. This
means, one cannot copy information from qubits the way we do in the present
computers, as there will be no similarity between the copy and the original. This is
known as ”no cloning principle”. 9
Representation of Qubit by Bloch Sphere
✓ Arrow represents the state of the Qubit.
✓ North & south poles are used to represent
the basis states |0⟩ and |1⟩.
✓ other locations are the superposition of
|0⟩ and |1⟩; |ψ⟩=α |0⟩ + β |1⟩ with α2 + β2 = 1.
✓ Hence Qubit can be any point on Bloch Sphere.
✓ Bloch sphere allows the state of the qubit
to be represented by spherical co-
ordinates (θ, ϕ) as;

10
here 0 ≤ θ ≤ π & 0 ≤ ϕ ≤ 2π
Single and Two Qubit and Extension to N Bits
✓ A Single Qubit has two computational basis states |0⟩ and |1⟩. The pictorial
representation of the single qubit is as follows.

|0⟩

|ψ⟩ = α |0⟩ + β |1⟩

|1⟩
✓ let us examine a system of single qubit. Consider a electron in H2, regarded as 1-state quantum system:
✓ Since electron can be in either of the ground or excited state, classically the electron is in one of two
states – 0 or 1 – and represent 1 bit of classical information.
✓ By superposition principle, the quantum state of electron can be linear combination of these two states:

|ψ⟩ = α |0⟩ + β |1⟩


Two Qubits and Extension to N Bits
✓ A Two Qubits has four computational basis states |00⟩, |01⟩, |10⟩ and |11⟩. The pictorial
representation of the single qubit is as follows.

|0⟩ |0⟩

|1⟩ |1⟩
✓ let us examine Two qubits: Consider two electrons in H2, each regarded as 2-state quantum system:
✓ Since electron can be in either of the ground or excited state, classically the two electrons are in one of
four states – 00, 01, 10, or 11 – and represent 2 bits of classical information.
✓ By superposition principle, the quantum state of electron can be linear combination of these four states:

|ψ⟩ = a00 |00⟩ + a01 |01⟩+ a10 |10⟩ + a11 |11⟩


Single & Two Qubits and Extension to N Bits

✓ A multi-qubit system of N qubits has 2N computational basis states. For example a


state with 3 qubits has 23 computational basis states. Thus for N qubits the
computational basis states are denoted as |00 · · · 00⟩, |00 · · · 01⟩, |00 · · · 10⟩, |00 · · ·
11⟩ · · · |11 · · · 11⟩. The block diagram of representation of N qubits is as follows.

|0⟩ |0⟩ |0⟩ |0⟩

··· ···
|1⟩ |1⟩ |1⟩ |1⟩

13
Fundamentals of matrix
Matrix algebra has at least two advantages:
✓ Reduces complicated systems of equations to simple expressions
✓ Adaptable to systematic method of mathematical treatment and well suited to
computers

Definition:
A matrix is a set or group of numbers arranged in a square or rectangular array
enclosed by two brackets
𝒂𝟏𝟏 𝒂𝟏𝟐 𝒂𝟏𝟑 ⋯ 𝒂𝟏𝒏
 4 2 a b  𝒂𝟐𝟏 𝒂𝟐𝟐 𝒂𝟐𝟑 ⋯ 𝒂𝟐𝒏
1 −1  − 3 0 c d  ⋮ ⋮ ⋮ ⋱ ⋮
    𝒂𝒎𝟏 𝒂𝒎𝟐 𝒂𝒎𝟑 ⋯ 𝒂𝒎𝒏
Fundamentals of matrix
Order of matrix
1 2 3
Dimension 4 5 6 2×3
Rows × columns

Square matrix – A matrix, where the number of rows and columns are equal

2 3 𝑖
A= 6 3 1
0 2 5 3×3
– A matrix with one column and any number of rows A =
3
−𝑖
6 3×1
Row matrix – A matrix with one row and any
number of columns 𝐴 = −1 𝑜 𝑖 1×3
Fundamentals of matrix operations
Matrix Operations:
• Matrix addition and subtraction
– Both matrices must have same order
– Add or subtract corresponding elements
– COMMUTATIVE 3 1 0 −1 𝟑 𝟎
0 2 + −2 −3 = −𝟐 −𝟏
−4 −1 −4 −5 −𝟖 −𝟔

• Scalar multiplication
– Multiply matrix with number
– Distribute 1 2 3 𝟑 𝟔 𝟗
𝑨= 3 =
0 −1 −2 𝟎 −𝟑 −𝟔
Fundamentals of matrix operations

• Matrix multiplication
-N0. of columns in 1st = N0. of rows in 2nd

𝒎×𝒏 ∙ 𝒏×𝒑

-Order of product m × p

-Order is important

-Multiplication - NOT COMMUTATIVE


Example 1 0
2 −1 7 2 ∙ 0 + −1 −2 + 7 ∙ 3
• × −2 =
0 6 −3 2×3 0 ∙ 0 + 6 ∙ −2 + −3 ∙ 3 2×1
3 3 ×1
23
= 2×1
−21
Example 2)

A= 4 5 8 B= 2
1×3
6 1x3 = 3x1
9 3×1
Now, A x B.
2
Multiplication of a
4 5 8 × 6 = 4 (2) + 5 (6) + 8(9) = 110 Column by a Row
9
Fundamentals of matrix
Identity Matrix – This acts like “number one” for matrices, denoted as I. This matrix
must be a square matrix and have the number 1 in the main diagonal and 0’s everywhere else.

1 0 0
1 0 𝐼= 0 1 0
𝐼= 𝐴𝐼 = 𝐴
0 1 2×2 0 0 1 3×3

Transpose of a Matrix : Transpose of a matrix, switches rows with columns. i.e.


The first row turns into the first column, second row turns into the second column.

2 3 𝑖 2 6 0 3
𝐴= 6 3 1 𝐴𝑇 = 3 3 2 𝐴 = −𝑖 𝐴𝑇 = 3 −𝑖 6 1×3
0 2 5 3×3 i 1 5 3×3 6 3×1
Explanation of Conjugate of a matrix
Complex Conjugate of a matrix : The conjugate of a complex number is
found by switching the sign of the imaginary part. The complex conjugate of any real number
is just a real number itself. The complex conjugate of imaginary number +i is −i.

0 3+𝑖 ∗0 3−𝑖
𝐴= 𝐴 =
−𝑖 1 2×2
𝑖 1 2×2

0 3+𝑖
Conjugate Transpose of a Matrix: 𝐴=
−𝑖 1 2×2
Step 1 : Take the transpose Step 2 : Take the conjugate

𝑇 0 −𝑖 𝑇 ∗ 0
† 𝑖
𝐴 = 𝐴 =𝑨 =
3+𝑖 1 2×2 3−𝑖 1 2×2
Unitary Matrix
Defn: A matrix is said to be Unitary, if and only if

Example 1) Check the given matrix is unitary or not?

Solution:

Conjugate: Conjugate transpose:

Yes:
Example 2) Show that matrix U is unitary.

22
Dirac Representation of Qubit
✓ Qubit: A bit of data is represented by a single atom that is in one of two
states denoted by |0> and |1>. A single bit of this form is known as a
qubit
✓ Dirac representation: Qubits commonly expressed in quantum mechanical states
with mathematical formulism given by Dirac or “bra–ket” notation
✓ State of a qubit is enclosed in right half of an angled bracket, called the “ket”. (i.e., |ψ⟩)
✓ A physical implementation of a qubit could use the two energy levels of an atom. An
excited state representing |1> and a ground state representing |0>.
Light pulse of
frequency  for
Excited time interval t
State

State State
|0> |1>
Nucleu
Ground s
State
Electro
n
Matrix Representation of |0⟩ & |1⟩
✓ Superposition: A qubit, |ψ⟩, is a superposition of both |0⟩ &|1⟩ :
i.e., |ψ⟩ = α |0⟩ + β |1⟩ 1
|0⟩ =
0

1 0 0
✓ Matrix Represantation: |ψ⟩ = α +β |1⟩ =
0 1 1

✓ In matrix representation, a qubit is written as a two-dimensional vector where the


amplitudes are the components of the vector. α
|ψ⟩ = β
with α2 + β2 = 1
Identity Operator
Identity Matrix – This acts like “number one” for matrices, denoted as I. This matrix
must be a square matrix and have the number 1 in the main diagonal and 0’s everywhere else.
1 0 1 0 0
𝐼= 𝐼= 0 1 0 𝐴𝐼 = 𝐴
0 1 2×2 0 0 1 3×3

Identity Operator (I): The identity matrix is an operator, operating on function, on


which the function remains the same.
Applying I to |0⟩ & |1⟩ states to show there is no change:
Let the identity operator I operates on |0⟩ state qubit. 1 0 1
𝐼= |0⟩ =
0 1 0

Now,
1 0 1 1
𝐼 |0⟩ = × = = |0⟩ 𝐼 |0⟩ = |0⟩
0 1 0 0
Applying I to |1⟩ states to show there is no change:
Let the identity operator I operates on |1⟩ state qubit. 1 0 0
𝐼= |1⟩ =
0 1 1

Now,
1 0 0 0
𝐼 |1⟩ = × = = |1⟩ 𝐼 |1⟩ = |1⟩
0 1 1 1
Pouli’s Matrices and Its Operations on |0⟩ & |1⟩ states
Pauli matrices are 2 × 2 matrices, Which are very much useful in the study of quantum
computation and quantum information.

Pauli matrices are given by,


Pouli’s Matrix σ0 Operating on |0⟩ & |1⟩ states

0
1 |1⟩ =
|0⟩ = 1
0

1 0 1 1 1 0 0 0
σ0 |0⟩ = × = = |0⟩ σ0 |1⟩ = 0 1 × 1 = 1 = |1⟩
0 1 0 0

Pouli matrix σ0 does not change the |0⟩ state Pouli matrix σ0 does not change the|1⟩ state.
Pouli’s Matrix σ1 (σx) Operating on |0⟩ & |1⟩ states

0
1 |1⟩ =
|0⟩ = 1
0

0 1 0 1
0 1 1 0 σx |1⟩ = × = = |0⟩
σx |0⟩ = × = = |1⟩ 1 0 1 0
1 0 0 1

Pouli matrix σx changes the |0⟩ state to |1⟩ state. Pouli matrix σx changes the|1⟩ state to |0⟩ state.
Pouli’s Matrix σ2 (σy) Operating on |0⟩ & |1⟩ states

0
1 |1⟩ =
|0⟩ = 1
0

0 −𝑖 0 1
σy |0⟩ = 0 −𝑖
×
1
=𝑖
0
= 𝑖|1⟩
σy |1⟩ = 𝑖 0
×
1
= −𝑖
0
= −𝑖|0⟩
𝑖 0 0 1

Pouli matrix σy changes the |0⟩ state to i times |1⟩ Pouli matrix σy changes the|1⟩ state to –i times |0⟩
Pouli’s Matrix σ3 (σz) Operating on |0⟩ & |1⟩ states

0
1 |1⟩ =
|0⟩ = 1
0

1 0 0 0
σz |1⟩ = × = = −|1⟩
1 0 1 1 0 −1 1 −1
σz |0⟩ = × = = |0⟩
0 −1 0 0

Pouli matrix σZ does not change the |0⟩ state. Pouli matrix σZ changes the|1⟩ state to – |1⟩
Inner product (Row and Column matrix )
✓ Dirac representation: Qubits commonly expressed in quantum mechanical states
with mathematical formulism given by Dirac or “bra–ket” notation (i.e., ‫ۦ‬ψ|ψ⟩ )
✓ Right half of bracket, called the “ket” (i.e., |ψ⟩ -represented by Column Matrix
Left half of bracket, called the “bra” vector (i.e., ‫ۦ‬ψ| -represented by Row Matrix
✓ For every “ket” vector there is a corresponding “bra” vector & vice versa
Examples: 1
|ψ⟩ =
𝑎11
𝑎21
𝑎31
.
. Examples: 2
𝑎𝑛1 𝑛×1

‫ۦ‬ψ| = 𝑎11 ∗ ∗ ∗
𝑎12 𝑎13 … … … 𝑎1𝑛 1×𝑛
Inner product (Row and Column matrix )
For a given “ket” vector and “bra” vector, we can calculate an “inner product”
|ψ⟩ =
𝑎11
𝑎21 ∗
‫ۦ‬ψ| = 𝑎11 ∗
𝑎12 ∗
𝑎13 ∗
… … … 𝑎1𝑛 1×𝑛
𝑎31
.
.
𝑎𝑛1 𝑛×1 𝑎11
𝑎21
𝑎31
‫ۦ‬ψ| ψ⟩ = 𝑎11
∗ ∗
𝑎12 ∗
𝑎13 ∗
… … … 𝑎1𝑛 ∙ . = 𝒂∗𝟏𝟏 𝒂𝟏𝟏 + 𝒂𝟏𝟐

𝒂𝟐𝟏 + ⋯ … … . . +𝒂∗𝒏𝟏 𝒂𝟏𝒏
.
𝑎𝑛1

This is a generalization of the dot product for real vectors 33


Inner product (Row and Column matrix )
Examples: 1 Calculate the inner product for the given vectors.
3𝑖
and |w⟩=
1
|v⟩ =
1 + 2𝑖 3

3𝑖
Sol: |w⟩= → ‫ۦ‬w| = −3𝑖 3
3
1
∴ ‫ۦ‬w| v⟩ = −3𝑖 3 ∙ = −𝟑𝒊 ∙ 𝟏 + 𝟑 𝟏 + 𝟐𝒊 = 𝟑 + 𝟑𝒊
1 + 2𝑖

3𝑖
Next, ‫ۦ‬v|w ⟩ = 1 1 − 2𝑖 ∙ = 𝟏 ∙ 𝟑𝒊 + 𝟏 − 𝟐𝒊 𝟑 = 𝟑 − 𝟑𝒊
3

Complex conjugate of inner product: 34


Inner product (in Computational Basis)
Examples: 2 Calculate the inner product for the given computational basis.
1 0
|0⟩ = |1⟩ =
0 and 1

1 0
Sol: |0⟩ = → ‫ۦ‬0| = 1 0 and |1⟩ = → ‫ۦ‬1| = 0 1
0 1

‫ۦ‬0| 0⟩ = 1
1
∴ 0 ∙ = 𝟏 ∙ 𝟏 + (𝟎 ∙ 𝟎) =𝟏
0
0
Next, ‫ۦ‬1|1 ⟩ = 0 1 ∙ = 𝟎∙𝟎 + 𝟏∙𝟏 =𝟏
1 Inner product of
0 computational basis elements:
Further, ‫ۦ‬0| 1⟩ = 1 0 ∙ = 𝟏 ∙ 𝟎 + (𝟎 ∙ 𝟏) = 𝟎
1

1
‫ۦ‬1| 0⟩ = 0 1 ∙ = 𝟎 ∙ 𝟏 + (𝟏 ∙ 𝟎) = 𝟎
0 Kronecker delta
36
Inner product (in Computational Basis)
Examples: 3 Calculate the inner product for the given vectors

37
Probability, Quantum Superposition & Normalization rule
Quantum Superposition: Any quantum state/qubit, |ψ⟩, is a superposition (i.e., linear
combination) of both |0⟩ &|1⟩.
where α and β are amplitudes and
i.e., |ψ⟩ = α |0⟩ + β |1⟩
1 𝟎
|0⟩ = |1⟩ =
1 0 0 𝟏
∴ |ψ⟩= α +β
0 1

Probability and Normalization rule: If measurements are carried out with a qubit in
superposed state then the results will be probabilistic. The total probability of a qubit
must be 100%. i.e. |α|2 +|β|2 =1
38
Probability, Quantum Superposition & Normalization rule

39
Orthogonality & Orthonormality
Orthogonal: The two states |ψ⟩ and |φ⟩ are said to be orthogonal, if their inner product
is zero.

i.e. ‫ۦ‬ψ|φ⟩ = 0
1 0
Example: Consider the inner product of |0⟩ and |1⟩. i.e., |0⟩ = and |1⟩ =
0 1
Orthonormality
Orthonormal: The two states |j⟩ and |k⟩ are said to be orthonormal, if and only if their
inner product; (Kronecker delta)
1 0
Example: The inner product of |0⟩ and |1⟩ i.e., |0⟩ = |1⟩ =
0 and 1
1 0
Sol: |0⟩ = ‫ۦ‬0| = 1 0 and |1⟩ = ‫ۦ‬1| = 0 1
0 → 1 →
Example 1. A Linear Operator ’𝑋’ operates such that 𝑋 |0⟩ = |1⟩ and 𝑋 |1⟩ = |0⟩. Find the matrix
representation of ’𝑋’. Model QP1-2023
Data:, 𝑋 |0⟩ = |1⟩ & 𝑋 |1⟩ = |0⟩ Next, 𝑋 |1⟩ = |0⟩

𝑥11 𝑥12 0 1
→ ∙ =
To find: 𝑥21 𝑥22 1 0
Solution: We have, & 𝑥11 ∙ 0 + 𝑥12 ∙ 1 1
→ =
Given, 𝑋 |0⟩ = |1⟩ 𝑥21 ∙ 0 + 𝑥22 ∙ 1 0
𝑥11 𝑥12 1 0 𝑥12 1
→ ∙ = → =
𝑥21 𝑥22 0 1 𝑥22 0
𝑥11 ∙ 1 + 𝑥12 ∙ 0 0 Equating Matrices on both side, we
→ = get,
𝑥21 ∙ 1 + 𝑥22 ∙ 0 1 𝒙𝟏𝟐 = 𝟏 & 𝒙𝟐𝟐 = 𝟎
𝑥11 0
→ = 𝑥11 𝑥12
𝑥21 1 0 1
∴ =
Equating Matrices on both side, we 𝒙𝟏𝟏 = 𝟎 & 𝒙𝟐𝟏 = 𝟏 𝑥21 𝑥22 1 0
Example 2.


Example 3.
Example 4. Find the inner product of states |1⟩ 𝑎𝑛𝑑 |0⟩ and draw conclusions on the result.

1 0
Solution: The inner product of |0⟩ and |1⟩ i.e., |0⟩ = and |1⟩ =
0 1

1 0
|0⟩ = → ‫ۦ‬0| = 1 0 and |1⟩ = → ‫ۦ‬1| = 0 1
0 1

Then, ‫ۦ‬0| 1⟩ = 1 0 ∙ 0 = 𝟏 ∙ 𝟎 + (𝟎 ∙ 𝟏) =𝟎
1

Orthogonal
‫ۦ‬1| 0⟩ = 0 1 ∙ 1 = 𝟎 ∙ 𝟏 + (𝟏 ∙ 𝟎) = 𝟎
0

Conclusion: The states |0⟩ and |1⟩ are orthogonal.


Model QP2-2023

Example 5.
Quantum Gates

Quantum Gates

Single Qubit Gate Multiple Qubit Gate

49
Single Qubit Gates
1. Quantum NOT gate (X):
• In classical computer, the NOT gate takes one input and reverse its value. Ex: changes 0 to 1 or 1 to 0.
• Quantum NOT gate (X) is similar in that a qubit in a state |0⟩ changes to |1⟩ and vice versa. When the
qubit is in a superposition of all basis states, then the superposition also flips.
• Matrix Representation: • Quantum NOT gate (X) Circuit & Truth Table

50
Single Qubit Gates
2. Pauli X, Y & Z Gates:

2.1 Pauli X Gate: It is nothing but Quantum NOT gate (X)

Matrix Representation: • Pauli X gate Circuit & Truth Table

51
Single Qubit Gates
2.2. Pauli Y gate:
• It is represented by the Pauli matrix σy (Y).
Pouli matrix σy maps the |0⟩ state to i |1⟩ Pouli matrix σy maps the|1⟩ state to –i |0⟩

• Matrix Representation: 0 −𝑖
Y= • Pauli Y gate Circuit & Truth Table
𝑖 0

• Thus Y gate defines the transformation as

52
Single Qubit Gates
2.3. Pauli Z gate:
• It is represented by the Pauli matrix σz (Z).
Pauli matrix Z output does not for input |0⟩ . Pouli matrix Z output changes – |1⟩ for input |1⟩

• Matrix Representation: • Pauli Z gate Circuit & Truth Table

• Thus Z gate defines the transformation as

53
3. Hadamard Gate (H):
• Hadamard gate is very important in quantum computing. If the qubit states in a definite |0⟩ or |1⟩
state, the Hadamard gate puts each into a superposition of |0⟩ and |1⟩ states.
• Hadamard gate (H) satisfies the Unitary condition;
• Hadamard gate (H) Circuit & Truth Table
• Matrix Representation:

• Thus H gate defines the transformation as

54
3. Phase Gates:
• Phase shift is actually map the qubit states |0⟩ → |0⟩ and |1⟩ →eiΦ |1⟩. The probability of measuring a
|0⟩ or |1⟩ unchanged after applying this gate, however it modifies the phase of the qubit state.

• Matrix Representation:

Phase
Gates

Z Gate S Gate T Gate


3.1 Phase Gate (S gate):
• Phase gate (S) actually map the qubit states |0⟩ → |0⟩ and |1⟩ → i |1⟩. The probability of measuring a
|0⟩ or |1⟩ unchanged after applying this gate, however it modifies the phase of the qubit state.
• Phase gate (S) satisfies the Unitary condition;

• Matrix Representation: • Phase gate (S) Circuit & Truth Table

• Thus S gate defines the transformation as

56
• Matrix Representation:
• T gate (T) Circuit & Truth Table

• Thus T gate defines the transformation as


57
Multiple Qubit Gates
• Multiple qubit gates operate on two or more input qubits. Usually one of them is a control qubit
• Multiple qubit gates play an important role in quantum computing

1. Controlled Gates:
Def: A Gate with operation of kind "If 'A' is True then do 'B‘ is called Controlled Gate.
✓ The ‘ |A⟩ ' Qubit is called Control qubit and ‘ |B⟩ ' is the Target qubit.
✓ The target qubit is altered if and only if the control qubit is |1⟩. The control qubit remains unaltered
during the transformations.

Controlle
d Gates

CNOT Swap Controlle Toffoli


Gate Gate d Z Gate Gate
CNOT Gate
• CNOT gate is a typical multi-qubit logic Operation of CNOT gate for input |00⟩
Here the control qubit is |0⟩. Hence, no change in the state of
gate and the circuit is as follows.
Target qubit |0⟩

Operation of CNOT gate for input |01⟩


Here also control qubit is |0⟩. Hence, no change in the state of
Target qubit |0⟩

Operation of CNOT gate for input |10⟩


Here the control qubit is |1⟩. Hence, the state of Target qubit
• Matrix
Representation: changes from |0⟩ to |1⟩
Operation of CNOT gate for input |11⟩
Here the control qubit is |1⟩. Hence, the state of Target qubit
• The CNOT gate transformation
changes from |1⟩ to |0⟩
could be as
Consider the operations of CNOT gate on • CNOT gate Truth Table
four inputs map |00⟩ , |01⟩ , |10 ⟩ & |11 ⟩
SWAP Gate
• SWAP gate is a typical two-qubit operation • Matrix Representation:

• It just swaps the state of the two qubits involved in the operation.
• The circuit is as follows

• SWAP gate Truth Table

• It is a combined circuit of 3 CNOT gates and overall effect is that


two input qubits are just swapped at the output.
• SWAP gate Action
Controlled Z Gate
• In Controlled Z gate, the operation of Z gate is controlled by a Control qubit.
• If the control qubit is |A⟩ = |1⟩ then only the Z gate transforms the |B⟩ as per the Pauli Z operation.
• The circuit is as follows

• Controlled Z gate Truth Table

• Matrix Representation:

61
Toffoli Gate
• Toffoli gate, is also known as CCNOT gate (Controlled-Controlled-Not).
• It has 3 inputs, out of which two are Control qubits and one is Target qubit.
• The Target qubit flips only when both control qubits are |1⟩. The two Control qubits are not
altered during the operation.
• Toffoli gate Truth Table
• The circuit is

• Matrix Representation:

62
Example 1. Using matrix multiplication show that on applying Hadamard gate twice to a |0⟩
results in its original state.

Solution: To show that 𝐻𝐻 |0⟩ = |0⟩

Since 𝐼 |0⟩ = |0⟩

⸫ HH |0⟩ = |0⟩

Thus applying two Hadamard gates result in the original state of |0⟩

64
Example 2. Using tw0 X gates in series show that two NOT gates in series are equivalent to a quantum
wire.

Solution: To show that XX |0⟩ = |0⟩

Since 𝐼 |0⟩ = |0⟩

⸫ XX |0⟩ = |0⟩

Hence two Not gates in series result in Quantum Wire.


65
Example 3. Show that Hadamard gate is a Unitary


Solution: To show that 𝐻 𝐻 = 𝐼


Hence, 𝐻 𝐻 = 𝐼

the Hadamard Gate is Unitary 66


Example 4. Two qubits are passed through CNOT gate. If the first qubit is the control quibit then what is the
output for the following initial states (i) |00⟩ (ii) |01⟩ (iii) |11⟩.

Solution: The Operation of the CNOT gate could be represented as |𝑥, 𝑦⟩ → |𝑥, 𝑥 ⊕ 𝑦⟩

67
Example 5. Show that S gate can be formed by connecting two T gates in series.

Solution: The T gate is is given by

68
Fundamentals of matrix
Identity Matrix – This acts like “number one” for matrices, denoted as I. This matrix
must be a square matrix and have the number 1 in the main diagonal and 0’s everywhere else.

Transpose of a Matrix : Transpose of a matrix, switches rows with columns. i.e. The
first row turns into the first column, second row turns into the second column.
Unitary Matrix
Defn: A matrix is said to be Unitary, if and only if

Example 1) Check the given matrix is unitary or not?

Solution:

Conjugate: Conjugate transpose:

Yes:
Example 2) Show that matrix U is unitary.

71
Inner product (Row and Column matrix )
Examples: 1 Calculate the inner product for the given vectors.

Sol:

Complex conjugate of inner product: 72


Inner product (in Computational Basis)
Examples: 2 Calculate the inner product for the given computational basis.
and

Sol: and

Inner product of
computational basis elements:

Kronecker delta
73
Inner product (in Computational Basis)
Examples: 3 Calculate the inner product for the given vectors

74
Example 4. A Linear Operator ’𝑋’ operates such that 𝑋 |0⟩ = |1⟩ and 𝑋 |1⟩ = |0⟩. Find the matrix
representation of ’𝑋’. Model QP1-2023
Data:, 𝑋 |0⟩ = |1⟩ & 𝑋 |1⟩ = |0⟩ Next, 𝑋 |1⟩ = |0⟩

To find:

Solution: We have, &

Given, 𝑋 |0⟩ = |1⟩

Equating Matrices on both side, we


get,

Equating Matrices on both side, we


Example 5.
Example 6.
Example 7. Find the inner product of states |1⟩ 𝑎𝑛𝑑 |0⟩ and draw conclusions on the result.

and

and

Orthogonal
Model QP2-2023

Example 8.

You might also like