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

3-Module - Quantum Computing-Dr. GHP

Same as above

Uploaded by

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

3-Module - Quantum Computing-Dr. GHP

Same as above

Uploaded by

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

Module-III 2022 scheme Quantum Computing

Module-III
Quantum Computing
Syllabus: Principles of Quantum Information & Quantum Computing : Introduction to Quantum
Computing, Moore’s law & its end, Differences between Classical & Quantum computing. Concept of qubit and its
properties. Representation of qubit by Bloch sphere. Single and Two qubits. Extension to N qubits.

Dirac representation and matrix operations: Matrix representation of 0 and 1 States, Identity Operator I,
Applying I to|0 ⟩and |1 ⟩ states, Pauli Matrices and its operations on |0 ⟩and |1 ⟩states, Explanation of i) Conjugate of
a matrix and ii) Transpose of a matrix. Unitary matrix U, Examples: Row and Column Matrices and their multiplication
(Inner Product), Probability, and Quantum Superposition, normalization rule. Orthogonality, Orthonormality.

Quantum Gates: Single Qubit Gates: Quantum Not Gate, Pauli – X, Y &Z Gate, Hadamard Gate, Phase Gates- S & T
Multiple Qubit Gates: Controlled gate, CNOT Gate, (Discussion for 4 different input states). Representation of Swap
gate, Controlled -Z gate, Toffoli gate.

Numerical problems- Identity, Unitary, Inner Product, Orthogonality, Gates: X Gates, Hadamard Gate, CNOT
Gate, Relating T and S gates

Introduction to Quantum Computing:


Timeline of Quantum Computing:

Principles of Quantum Computing:


Quantum Computing is the area of study focused on developing computing methods based on the
principles/laws of quantum mechanics. It is a growing field at the intersection of Physics and Computer
Science. In Quantum computers, information is stored and manipulated using single isolated atoms or photons or
electrons. Since atoms, molecules and photons obey the law of quantum mechanics, quantum computers perform
computation and process information according to the laws of quantum mechanics. The novel features of these
computers have immense potential applications in the field of cryptography. (Cryptography is the science of
maintaining secrecy and security in communication)
Quantum computing is a multidisciplinary field comprising aspects of computer science, physics, and
mathematics that utilizes quantum mechanics to solve complex problems faster than on classical computers.

Dept. of Engg. Physics, GMIT, DVG 1


Module-III 2022 scheme Quantum Computing

Fig: Disciplines contributing towards quantum computation

Moore’s Law and its End:


In the year 1965, Gardon Moore observed increasing
performance in the first few generations of the integrated-circuit
(IC) technology. Moore predicted that, it would continue to
improve at an exponential rate with the performance per unit
cost increasing by one or two factor in every 18 months and so.
The computer industry has followed this prediction since then.
The plot shows the 50 years of Moore’s law.

Statement: “The number of transistors on a microchip doubles every year”

It describes the empirical regularity that number of transistors on IC chips double approximately every two
years. This advancement is important for other aspects of technological progress in computing-like processing
speed.
However, reduction in the size of the transistors causes problems for current microelectronics, which
results in electron tunneling. The end of the usage of transistors in the quantum scale could be expected as the
dimension decreases further and quantum effect come into the picture. ∴ Quantum Computation is the option
for the further computational studies.

Concept of Qubit and its properties:


Q: Define a bit and qubit and explain the properties of qubit. (6M)

Def.- A bit (binary digit) is the smallest unit of data that a computer can process and store.
It is always in one of two physical states, similar to an on/off light switch. The state is represented by a
single binary value, usually a 0 or 1.
Qubit: The counter part of a classical bits in quantum computing is quantum bits, called as “qubits”.

Dept. of Engg. Physics, GMIT, DVG 2


Module-III 2022 scheme Quantum Computing
The classical computers take, process and store everything in only two states; o or 1 not both. While, quantum
computers use qubits. Qubits are similar to bits having two measurable states called 0 and 1, and also be in a
superposition state of these 0 and 1 states, which can be expressed in quantum mechanical states with
mathematical formula. Dirac or “bra-ket” notation is commonly used in quantum mechanics and quantum
computing.
The state of a qubit is enclosed in the right half of an angled bracket, called the “ket”. A qubit, |ᴪ⟩ could
be in a |0⟩ or |1⟩ state, which is a superposition of both |0⟩ or |1⟩, as;

|ᴪ⟩ = 𝜶|𝟎⟩ + 𝜷|𝟏⟩


Where α and β are the amplitude of the states.

Qubit Properties:
 Superposition: a qubit is a superposition of both |0⟩ and |1⟩. i.e., |ᴪ⟩ = 𝛼|0⟩ + 𝛽|1⟩.
 Entanglement and tunneling are the basic properties of qubits.
(Entanglement - It is the state where two qubits are so strongly correlated that gaining information about one qubit will give
immediate information about the other no matter how far apart these qubits are.)
(Tunneling - It a quantum mechanical process where qubit can penetrate through a potential barrier. The transmission through
the potential barrier can be finite and relies exponentially on the barrier width and barrier height).
 Normalization rule: If measurements are carried out with a qubits in superposed state, then the result
will be probabilistic. The total probability must be 100%. i.e., |𝜶|𝟐 + |𝜷|𝟐 = 𝟏
 No cloning principle: Due to quantum nature, the qubit changes its state during its measurements. This
means, one can’t copy information from qubits the way we do in present computers, as there will be no
similarity between the copy and original.

Representation of Qubit by Bloch sphere:


Q: Explain the representation of qubit using Bloch Sphere. (6M)

The distinct states |𝟎⟩ and |𝟏⟩ can be represented as North


and South poles of a sphere of unit radius called “Bloch Sphere”.
The state of a qubit is represented by vector in the sphere. Other
locations are the superposition of |0⟩ and |1⟩; |ψ⟩=α |0⟩ + β |1⟩ with
α2 + β2 = 1. Hence, Qubit can be any point on Bloch Sphere.

The Bloch sphere allows the state of the qubit to be


represented by spherical co-ordinates (θ, φ) as;
𝜃 𝜃
|ᴪ⟩ = 𝐶𝑜𝑠 ( 2 ) |𝟎⟩ + 𝑒 𝑖𝜑 𝑆𝑖𝑛 (2 ) |𝟏⟩

Where 0 ≤ 𝜃 ≤ 𝜋 and 0 ≤ 𝜑 ≤ 2𝜋

For φ = 0 and θ=0 Then, |ᴪ⟩ = |0⟩, which is along +z axis (i.e., North Pole)
φ = 0 and θ=𝜋 Then, |ᴪ⟩ = |1⟩, which is along -z axis (i.e., South Pole)
Dept. of Engg. Physics, GMIT, DVG 3
Module-III 2022 scheme Quantum Computing
Single qubit, Two qubits and extended up to N qubits:
Single Qubit: has two computational basis states |0⟩ and |1⟩. The pictorial representation of the single qubit
is as follows;

Let us examine a system of single qubit. Consider an electron in Hydrogen atom (H1), 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 either 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 Qubit: has four computational basis states |00⟩, |01⟩, |10⟩ and |11⟩. The pictorial representation of the
single qubit is as follows;

Let us examine Two qubits. Consider two electrons in Hydrogen atom (H2), each electron 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:

|ψ⟩ = α00 |00⟩ + α 01|01⟩+ α 10|10⟩ + α 11|11⟩

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;

Dept. of Engg. Physics, GMIT, DVG 4


Module-III 2022 scheme Quantum Computing
Difference between Classical computer and Quantum computer:
Q: Elucidate the differences between classical and quantum computing. (6M)

Classical Computer Quantum Computer


 Data stored with transistors are in the form 0 or 1.  Data stored in qubit are either in 0 or 1 or both.
 Processing performed through logic gates.  Processing performed through Quantum logic gates.
 Power increases in the ratio 1:1 with the number of  Power increases exponentially in proportion to the
transistors. number of qubits.
 Have low error rate and can operate at room  Have high error rate and need to operate at ultra-
temperature. cold conditions.
 Everyday processing is best handled by classical  Well suited for tasks like optimization problems,
computers. data analysis and simulations.
 Operations are governed by Boolean algebra.  Operations are by linear algebra and Hilbert space.
 Circuit behavior is defined by classical physics.  Circuit behavior is defined by quantum physics.
 Calculations are deterministic. It means  The calculations are probabilistic. It means there
repeating the same input results the same output. are multiple possible outputs to the same input.

Dirac Representation and Matrix Operations

Matrix representation of |𝟎⟩ and |𝟏⟩ :

Q: Explain the Matrix representation of 0 and 1 States and apply identity operator I to | 0⟩ and | 1⟩ states. (6M)

In matrix representation, a qubit (o or 1) is written as a two-dimensional vector, where the states are
the components of the vector. Hence, it is useful to use matrix algebra.
1 0
i.e., |𝟎⟩ = [ ] and |𝟏⟩ = [ ]
0 1
When writing one qubit in a superposition, |ᴪ⟩ = 𝛼|0⟩ + 𝛽|1⟩. It is useful to use matrix algebra. In
matrix representation, a qubit is written as a two-dimensional vector where the amplitudes are the
components of the vector.
𝛼
i.e., |ᴪ⟩ = [𝛽 ]

Identity operator (I):


“Identity matrix is an operator, operating on function/state, on which the function/state remains the same”.
Let the identity operator I operates on |𝟎⟩ state qubit.
1 0 1 1
𝝈𝟎 |𝟎⟩ = 𝑰 |𝟎⟩ = [ ] [ ] = [ ] = |𝟎⟩ → 𝝈𝟎 |𝟎⟩ = |𝟎⟩
0 1 0 0
Thus, when identity operator I applied on |0⟩ qubit state, remains the same after operating i.e., |𝟎⟩ qubit state.
Dept. of Engg. Physics, GMIT, DVG 5
Module-III 2022 scheme Quantum Computing
Similarly, let the Identity I operator operates on |𝟏⟩ state qubit.
1 0 0 0
𝝈𝟎 |𝟏⟩ = [ ] [ ] = [ ] = |𝟏⟩ → 𝝈𝟎 |𝟏⟩ = |𝟏⟩
0 1 1 1
Thus, identity operator I unchanged the |𝟏⟩ qubit state.

Pauli’s Matrices and its Operation on |𝟎⟩ and |𝟏⟩ states:

Q: State the Pauli matrices and apply Pauli matrices on the states | 0⟩ and | 1⟩ (8M)

Pauli matrices are 2 × 2 matrices, which are very much useful in the study of quantum computation and
quantum information. Usually indicated by the Greek letter sigma (σ), they used as spin operator.
Pauli matrices are given by,
1 0
𝝈𝟎 = 𝐼 = [ ]
0 1

0 1
𝝈𝒙 = 𝑋 = [ ]
1 0

0 −𝑖
𝝈𝒚 = 𝑌 = [ ]
𝑖 0

1 0
𝝈𝒛 = 𝑍 = [ ]
0 −1

Pauli matrix 𝝈𝒙 operates on |𝟎⟩ and |𝟏⟩ states:

𝝈𝒙 |0⟩ = [0 1 1 0
] [ ] = [ ] = |𝟏⟩ → Pauli matrix 𝝈𝒙 changes the |0⟩ state to |1⟩
1 0 0 1

𝝈𝒙 |1⟩ = [0 1 0 1
] [ ] = [ ] = |𝟎⟩ → Pauli matrix 𝝈𝒙 changes the |1⟩ state to |0⟩
1 0 1 0

Pauli matrix 𝝈𝒚 operates on |𝟎⟩ and |𝟏⟩ states:


0 −𝑖 1 0
𝝈𝒚 |0⟩ = [ ] [ ] = [ ] = 𝑖|1⟩ → Pauli matrix 𝝈𝒚 changes |0⟩ state to i times |1⟩
𝑖 0 0 𝑖

𝝈𝒚 |1⟩ = [0 −𝑖] [0] = [−𝑖] = −𝑖|0⟩ → Pauli matrix 𝝈𝒚 changes |1⟩ state to -i times |0⟩
𝑖 0 1 0

Pauli matrix 𝝈𝒛 operates on |𝟎⟩ and |𝟏⟩ states:

1 0 1 1
𝝈𝒛 |0⟩ = [ ] [ ] = [ ] = |0⟩ → Pauli matrix 𝝈𝒛 unchanged the |0⟩
0 −1 0 0

1 0 0 0
𝝈𝒛 |1⟩ = [ ] [ ] = [ ] = −|1⟩→ Pauli matrix 𝝈𝒛 changes the |1⟩ state to -|1⟩
0 −1 1 −1
Dept. of Engg. Physics, GMIT, DVG 6
Module-III 2022 scheme Quantum Computing
Explanation of Conjugate of a matrix:
It is possible to find the conjugate for a given matrix by replacing each element of the matrix with its
complex conjugate. Mathematically, a conjugate matrix is a matrix, obtained by replacing the complex
conjugate of all the elements of the matrix.
The conjugate of a complex number is found by just switching the sign of the imaginary part (i.e.,
+i to −i and vice versa). The complex conjugate of any real number is just a real number itself.

Ex: If A is a 2 × 2 complex matrix, then 𝑨∗ is the complex conjugate of A;

0 3+𝑖 0 3−𝑖
i.e., 𝐴= [
−𝑖 1
] ↔ 𝑨∗ = [
𝑖 1
]

Explanation of Transpose of matrix:


Transpose of a matrix is defined as, “a matrix which is formed by turning all the rows of a given
matrix into columns and vice-versa.”,
Ex: If A is the given matrix, then AT is the transpose of matrix A;

0 3+𝑖 0 −𝑖
𝐴= [
−𝑖 1
] ↔ 𝑨𝑻 = [
3+𝑖 1
]

Explanation of Conjugate Transpose of matrix:


The conjugate transpose of matrix is a matrix obtained by first transposing and then applying complex
conjugate on each elements. It is denoted by the symbol †.
Ex: If A is 2×2 matrix, then 𝑨† is the conjugate transpose of matrix A.

0 3+𝑖 0 𝑖
𝑨= [
−𝑖 1
] ↔ 𝑨† = (𝐴∗)𝑇 = (𝐴𝑇 )∗ = [
3−𝑖 1
]

Unitary matrix:
The matrix U is said to be unitary if and only if, 𝑼𝑼† = 𝑼† 𝑼 = 𝑰
It is a square matrix of complex numbers. The product of the conjugate transpose of a unitary
matrix, with the unitary matrix, gives an identity matrix.
1 𝑖 1 𝑖

𝑈 † = (𝑈 ∗ )𝑇 = [√−𝑖 √2
2 √2 2
Ex: Let us consider a matrix; 𝑈 = [√−𝑖 −1
] then −1]
√2 √2 √2 √2
1 𝑖 1 𝑖 1 𝑖2 𝑖 𝑖 1 1
− − + 0 1 0
[√−𝑖 √2
[√−𝑖 √2
2 2
𝑈𝑈 † = −1] −1] = [2 2 2
𝑖2
2
] = [2 2
1 1] = [ ]=𝐼
−𝑖
+
𝑖
− +
1
0 + 0 1
√2 √2 √2 √2 2 2 2 2 2 2

∴ 𝑈𝑈 † = 𝐼
The given matrix U is unitary matrix.
Dept. of Engg. Physics, GMIT, DVG 7
Module-III 2022 scheme Quantum Computing
Row and Column Matrices:
Row matrix: Matrix having only one row and any number columns i.e., of order 1×n is called row matrix.
In quantum Physics, ‘bra’ vector is represented by the ‘row matrix’ and denoted by left half bracket ‘⟨ |’.
It is actually a complex conjugate of ‘ket’ vector.

∗ ∗ ∗ ∗ ]
i.e., ⟨𝛙| = [𝑎11 𝑎12 𝑎13 … … … 𝑎1𝑛 1×𝑛 is the example of ‘bra’ vector.

Column matrix: Matrix having only one column and any number of rows i.e., of order m×1 is called column
matrix. In quantum Physics, ‘ket’ vector is represented by ‘column matrix’ and denoted by right half bracket
‘| ⟩’.
𝑎11
𝑎21
𝑎31
i.e., |𝛙⟩ = . is the example of ‘ket’ vector.
.
[𝑎𝑛1 ]𝑛×1

 The ‘bra’ is a conjugate transpose of ‘ket’ vector; {⟨ψ| = (|ψ⟩∗ )𝑇 } and vice-versa.
 For every ‘ket’ vector, there is corresponding ‘bra’ vector and vice-versa.
1
Example; |ψ⟩ = [2 + 3𝑖 ] is ‘ket’ vector, then corresponding ‘bra’ is; ⟨ψ| = [1 2 − 3𝑖 5𝑖 ]1×3
−5𝑖 3×1

Matrix Multiplication (Inner Product):


For a given |ψ⟩ “ket” vector and ⟨ψ| “bra” vector, one can calculate an “inner product” as;
𝑎11
𝑎21
∗ ∗ ∗ ∗ ]
𝑎31
⟨𝛙| 𝛙⟩ = [𝑎11 𝑎12 𝑎13 … … … 𝑎1𝑛 ∙ . = 𝒂∗𝟏𝟏 𝒂𝟏𝟏 + 𝒂∗𝟏𝟐 𝒂𝟐𝟏 + ⋯ … … . . +𝒂∗𝒏𝟏 𝒂𝟏𝒏
.
[𝑎𝑛1 ]
1 − 2𝑖 5
Ex: Calculate the inner product of the given vectors; |A⟩ = [ −3𝑖 ] & |B⟩ = [3 − 9𝑖 ].
6 −4𝑖
5
Soln: ⟨A|B⟩ = [1 + 2𝑖 3𝑖 6] ∙ [3 − 9𝑖 ]
−4𝑖

⟨𝐀|𝐁⟩ = 𝟓(𝟏 + 𝟐𝒊) + 𝟑𝒊(𝟑 − 𝟗𝒊) + 𝟔(−𝟒𝒊) → ⟨𝐀|𝐁⟩ = 𝟑𝟐 − 𝟓𝒊

1 − 2𝑖
⟨B|A⟩ = [5 3 + 9𝑖 4𝑖 ] ∙ [ −3𝑖 ]
6

⟨𝐁|𝐀⟩ = 𝟓(𝟏 − 𝟐𝐢) + (𝟑 + 𝟗𝐢)(−𝟑𝐢) + 𝟒𝐢(𝟔) → ⟨𝐁|𝐀⟩ = 𝟑𝟐 + 𝟓𝒊

Note: Inner products of any two same vectors are complex conjugate: ⟨𝐀|𝐁⟩ = ⟨𝐁|𝐀⟩∗

Dept. of Engg. Physics, GMIT, DVG 8


Module-III 2022 scheme Quantum Computing
Orthogonality and Orthonormality:
Q: Explain Orthogonality and Orthonormality with an example for each. (6M)

Orthogonality: The two states |ψ⟩ and |φ⟩ are said to be orthogonal, if their inner product ⟨ψ|φ⟩ is zero.
⟨𝛙|𝛗⟩ = 𝟎

1 0
Ex: Consider |0⟩ and |1⟩ are the two states; |0⟩ = [ ] & |1⟩ = [ ]
0 1
0
Then their inner product is, ⟨𝟎|𝟏⟩ = [1 0] ∙ [ ] = (1 ∙ 0 + 0 ∙ 1) = 𝟎
1

& ⟨𝟏|𝟎⟩ = [0 1] ∙ [1] = (0 ∙ 1 + 1 ∙ 0) = 𝟎


0

Since, their inner product is 0, then two states |0⟩ and |1⟩ are said to orthogonal.

Orthonormality: The two states |ψ⟩ and |φ⟩ are said to be orthonormal, if and only if their inner product is;
1 𝑖𝑓 ψ = φ
⟨ψ|φ⟩ = 𝛿ψφ = {
0 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒

1 |φ⟩ = |1⟩ = [0]


Ex: Consider the two states; |ψ⟩ = |0⟩ = [ ] &
0 1

1
Then their inner product is, ⟨𝟎|𝟎⟩ = [1 0] ∙ [ ] = (1 ∙ 1 + 0 ∙ 0) = 𝟏
0

⟨𝟏|𝟏⟩ = [0 1] ∙ [0] = (0 ∙ 0 + 1 ∙ 1) = 𝟏
1

⟨𝟎|𝟏⟩ = [1 0] ∙ [0] = (1 ∙ 0 + 0 ∙ 1) = 𝟎
1

⟨𝟏|𝟎⟩ = [0 1] ∙ [1] = (0 ∙ 1 + 1 ∙ 0) = 𝟎
0
Since, their inner product is 1 for ψ = φ , and 0 for ψ ≠ φ. Therefore two states |0⟩ and |1⟩ are said to be
orthonormal.

Dept. of Engg. Physics, GMIT, DVG 9


Module-III 2022 scheme Quantum Computing

Quantum Gates
Introduction: The classical computers manipulate ‘bits’ using classical logic gates, such as; OR, AND,
NOT, NAND, NOR, etc. Similarly, quantum computers manipulate ‘qubits’ using quantum logic gates.
The quantum logic gates are the basic quantum circuits or mathematical entities, which are applied to
qubits, the qubits state will be changes depending on which gate is applied. A quantum algorithm has to
be implemented on a quantum computer using the quantum gates. After running a quantum algorithm
gates, the result is retrieved by measuring the qubits state.

Q: Explain Single qubit gate and multiple qubit gate with an example for each. (8M)
Based on number of input qubits, the quantum gates are classified as; single and multiple qubit gates.

Single Qubit Gate


If the input qubits are single states such as; |0⟩ and |1⟩, quantum computing requires single quantum gates
such as; Quantum NOT gate (X), Pauli X, Y, Z gates, Hadamard gate, and phase gates (Z, S, and T-gates).

Quantum NOT gate (X):


Q: Discuss the working of quantum not gate mentioning its matrix representation and truth-table. (6M)

In classical computer, NOT gate takes one input & reverse its present value. Ex: changes 0 to 1 & vice versa.
The Quantum NOT gate (X) is similar in that, if qubit in a state |0⟩, changes to |1⟩ and vice versa. When
the qubit is in a superposition, then the superposition also flips.

Matrix representation: The quantum NOT gate is mathematically represented by Pauli ‘X’ matrix;
0 1
i.e., 𝑋= [ ]
1 0

0 1 1 0
Let the Quantum NOT gate ‘X’ operates on |𝟎⟩ qubit state; X|𝟎⟩ = [ ] [ ] = [ ] = |𝟏⟩
1 0 0 1

0 1 0 1
Similarly, Quantum NOT gate operates on |𝟏⟩ qubit state. X|𝟏⟩ = [ ] [ ] = [ ] = |𝟎⟩
1 0 1 0
⸫The Quantum NOT gate (X) reverse the given input state of the system.

Gate Representation: Truth Table:


|0⟩ X |1⟩ Inputs Output
|0⟩ |1⟩

|1⟩ X |0⟩ |1⟩ |0⟩

𝜶|𝟎⟩ + 𝜷|𝟏⟩ 𝜶|𝟏⟩ + 𝜷|𝟎⟩


𝜶|𝟎⟩ + 𝜷|𝟏⟩ X 𝜶|𝟏⟩ + 𝜷|𝟎⟩

Dept. of Engg. Physics, GMIT, DVG 10


Module-III 2022 scheme Quantum Computing
Pauli X, Y, Z gates:
Q: Discuss the working of Pauli gate mentioning its matrix representation and truth-table. (6M - any one Gate)

Pauli ‘X’ Gate: It is similar to the Quantum NOT gate.

Pauli ‘Y’ Gate: is a single qubit gate which operates as per the Pauli ‘Y’ matrix. It rotates the given input
through π radians around the y-axis.

Matrix representation: The Pauli ‘Y’ gate is mathematically represented by Pauli ‘𝜎𝑦 ’ matrix or ‘Y’;
0 −𝑖
i.e., 𝑌= [ ]
𝑖 0
0 −𝑖 1 0
Let the Pauli Y gate operates on |𝟎⟩ state qubit; 𝒀|𝟎⟩ = [ ] [ ] = [ ] = 𝒊|𝟏⟩
𝑖 0 0 𝑖

Similarly, Pauli Y gate operates on |𝟏⟩ state; 𝒀|𝟏⟩ = [0 −𝑖 ] [0] = [−𝑖 ] = −𝒊|𝟎⟩
𝑖 0 1 0

⸫The Pauli ‘Y’ gate reverse the given input along with transformation /rotation of π radians.
Gate representation: Truth Table:
|0⟩ Y i|1⟩ Inputs Output
|0⟩ i|1⟩

|1⟩ Y -i|0⟩ |1⟩ -i|0⟩

𝜶|𝟎⟩ + 𝜷|𝟏⟩ 𝒊(𝜶|𝟏⟩ − 𝜷|𝟎⟩)


𝜶|𝟎⟩ + 𝜷|𝟏⟩ Y 𝜶 𝒊|𝟏⟩ − 𝜷 𝒊|𝟎⟩)

Pauli Z gate: is a single qubit gate which operates as per the Pauli ‘Z’ matrix. Its operation takes along the
z-axis.
Matrix representation: The Pauli ‘Z’ gate is mathematically represented by Pauli ‘𝜎𝑧 ’ matrix or ‘Z’;
1 0
i.e., 𝑍= [ ]
0 −1

1 0 1 1
Let the Pauli ‘Z’ gate operates on |0⟩ state qubit; 𝒁|𝟎⟩ = [ ] [ ] = [ ] = |𝟎⟩
0 −1 0 0

1 0 0 0
Similarly, Pauli Z gate operates on |1⟩ state qubit; 𝒁|𝟏⟩ = [ ] [ ] = [ ] = −|𝟏⟩
0 −1 1 −1

⸫ When Pauli Z gate operates on |0⟩ state, which remains the same state, and operates on |1⟩ state,
reverse the direction of the system.

Dept. of Engg. Physics, GMIT, DVG 11


Module-III 2022 scheme Quantum Computing
Gate Representation: Truth Table:
|0⟩ Z |0⟩
Inputs Output
|0⟩ |0⟩
|1⟩ Z -|1⟩
|1⟩ -|1⟩

𝜶|𝟎⟩ + 𝜷|𝟏⟩ 𝜶 | 𝟎⟩ − 𝜷 | 𝟏⟩
𝜶|𝟎⟩ + 𝜷|𝟏⟩ Z 𝜶 | 𝟎⟩ − 𝜷 | 𝟏⟩

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; 𝑯𝑯† = 𝑯† 𝑯 = 𝑰

Matrix representation: The Hadamard gate is mathematically represented by matrix ‘H’;

1 1 1
𝑯= [ ]
√2 1 −1
Let the Hadamard gate operates on |0⟩ state qubit;

1 1 1 1 1 1 1 1 0 𝟏
𝑯|𝟎⟩ = [ ][ ] = [ ]= ([ ] + [ ]) = (|𝟎⟩ + |𝟏⟩)
√2 1 −1 0 √2 1 √2 0 1 √𝟐

Similarly, let the Hadamard gate operates on |1⟩ state qubit;

1 1 1 0 1 1 1 1 0 𝟏
𝑯|𝟏⟩ = [ ][ ] = [ ]= ([ ] − [ ]) = (|𝟎⟩ − |𝟏⟩)
√ 1
2 −1 1 √2 −1 √ 2 0 1 √𝟐

⸫The Hadamard gate operates on |0⟩ and |1⟩ states, which puts each into superposition state.

Gate representation: Truth Table:


𝟏
|0⟩ H (|𝟎⟩ + |𝟏⟩) Inputs Output
√𝟐
|0⟩ 𝟏
(|𝟎⟩ + |𝟏⟩)
√𝟐

𝟏 𝟏
|1⟩ H (|𝟎⟩ − |𝟏⟩) |1⟩ (|𝟎⟩ − |𝟏⟩)
√𝟐
√𝟐

𝜶 𝜷
(|𝟎⟩ + |𝟏⟩) + (|𝟎⟩ − |𝟏⟩)
𝜶|𝟎⟩ + 𝜷|𝟏⟩ √𝟐 √𝟐

𝜶 𝜷
𝜶|𝟎⟩ + 𝜷|𝟏⟩ H (|𝟎⟩ + |𝟏⟩) + (|𝟎⟩ − |𝟏⟩)
√𝟐 √𝟐

Dept. of Engg. Physics, GMIT, DVG 12


Module-III 2022 scheme Quantum Computing
Phase gates:
 In phase gates, the phase angle Φ is responsible to manipulate the phase of quantum states.
 Phase is actually manipulating the qubit states as ; |0⟩ → |0⟩ and |1⟩ → eiΦ|1⟩.
 The probability of measuring a |0⟩ or |1⟩ unchanged after applying this gate, however it modifies only the
phase of the qubit state.
𝟏 𝟎
 Matrix representation of phase gates is; 𝑃 = [ ] where, 𝑒 𝑖∅ = 𝑐𝑜𝑠∅ + 𝑖𝑠𝑖𝑛∅
𝟎 𝒆𝒊∅
𝜋 𝜋
 On the basis of phase angle value; 𝜋, 2 , and 4 , the gates are classified as Z, S, and T, respectively.

Z Gate: It is similar to Pauli Z gate.

S Gate:
Q: Discuss the working of Phase gate mentioning its matrix representation and truth-table. (6M - any one 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 only modifies the phase of the qubit state.
Phase gate (S) satisfies the unitary condition; 𝑺𝑺† = 𝑺† 𝑺 = 𝑰

Matrix representation: The S gate is mathematically represented by matrix ‘S’;


1 0
𝑆=[ ]
0 𝑖
1 0 1 1
Let the S gate operates on |0⟩ state qubit; 𝑺|𝟎⟩ = [ ] [ ] = [ ] = |𝟎⟩
0 𝑖 0 0
1 0 0 0
Similarly, let the S gate operates on |1⟩ state qubit; 𝑺|1⟩ = [ ] [ ] = [ ] = 𝑖|𝟏⟩
0 𝑖 1 𝑖
⸫The S gate operates on |0⟩ and |1⟩ states, which remains the state and only changes their phase.

Gate Representation: Truth Table:


|0⟩ S |0⟩ Inputs Output
|0⟩ |0⟩

|1⟩ S i|1⟩ |1⟩ i|1⟩

𝜶|𝟎⟩ + 𝜷|𝟏⟩ 𝜶|𝟎⟩ + 𝒊𝜷|𝟏⟩


𝜶|𝟎⟩ + 𝜷|𝟏⟩ S 𝜶|𝟎⟩ + 𝒊𝜷|𝟏⟩

𝝅
T Gate or ( ) gate:
𝟖
𝟏+𝒊
Phase gate (T) actually map the qubit states |0⟩ → |0⟩ and |1⟩ → |1⟩.
𝟐

The probability of measuring a |0⟩ or |1⟩ unchanged after applying this gate, however, it only modifies the
phase of the qubit state.

Dept. of Engg. Physics, GMIT, DVG 13


Module-III 2022 scheme Quantum Computing
Matrix representation: The T gate is mathematically represented by matrix ‘T’;
−𝑖𝜋
1 0 𝑖𝜋
↔ 𝑇 = 𝑒 [𝑒 0]
8
𝑇 = [0 1+𝑖 ] 8
𝑖𝜋
√2 0 𝑒8
1 0 1 1
Let the T gate operates on |0⟩ state qubit; 𝑻|𝟎⟩ = [0 1+𝑖 ] [ ] = [ ] = |𝟎⟩
√2 0 0
1 0 0 0 𝟏+𝒊
Similarly, let the T gate operates on |1⟩ state qubit; 𝑻|𝟏⟩ = [0 ] [ ] = [ ] = |𝟏⟩
1+𝑖 1+𝑖
√2 1
√𝟐
√2

⸫The T gate operates on |0⟩ and |1⟩ states, which remains the state and only changes their phase.

Gate Representation: Truth Table:


Inputs Output
|0⟩ T |0⟩
|0⟩ |0⟩

𝟏+𝒊 𝟏+𝒊
|1⟩ T |𝟏⟩ |1⟩ |𝟏⟩
√𝟐 √𝟐

𝟏+𝒊
𝜶|𝟎⟩ + 𝜷 |𝟏⟩
𝜶|𝟎⟩ + 𝜷|𝟏⟩ √𝟐
𝟏+𝒊
𝜶|𝟎⟩ + 𝜷|𝟏⟩ T 𝜶|𝟎⟩ + 𝜷 |1⟩
√𝟐

Multiple Qubit Gates


The Multiple qubits are placing an important role in quantum computing. The multiple quantum gates are
working on qubits containing two or more states. Among those states previous states are Control qubits and
last one is Target qubit.
In multiple quantum gates one qubit state is controlled by other qubit states hence, multiple quantum
gates are also called controlled gates.
Ex: The |𝐴𝐵⟩ qubit is the two-state qubit, among which ‘A’ is control qubit & ‘B’ is target qubit.
 The target qubit is altered if and only if the control qubit is |1⟩, otherwise unaltered.
 The control qubit ‘A’ is unaltered during transformation.
On the basis of modes of operation, we classify the controlled gates are; Controlled NOT gate, Controlled Z-
gate, Taffoli gate, Swap gate, etc.,

Controlled NOT gate (CNOT):


Q: Discuss the CNOT gate and its operation on four different input states. (6M)

 CNOT gate is a typical multi-qubit logic gate, it is similar to the conventional NOT gate, which reverse
the present state of the qubit.
 In CNOT gate transformation of Target qubit will be controlled by Control qubit.
 The target state will alter the state during transformation only when control state is |1⟩, otherwise unaltered.

Dept. of Engg. Physics, GMIT, DVG 14


Module-III 2022 scheme Quantum Computing
Gate Representation;

Discussion of 4 different input states: Consider CNOT gate operating on 4 states; |00⟩, |01⟩, |10⟩, & |11⟩
1. Operation of CNOT gate on |𝟎𝟎⟩: Here, control qubit is |0⟩, hence, target qubit doesn’t alter.
i.e., |00⟩ → |00⟩
2. Operation of CNOT gate on |𝟎𝟏⟩: Here, control qubit is |0⟩, hence, target qubit doesn’t alter.
i.e., |01⟩ → |01⟩
3. Operation of CNOT gate on |𝟏𝟎⟩: Here, control qubit is |1⟩, ⸫ target qubit is altered from |0⟩ to |1⟩
i.e., |1𝟎⟩ → |1𝟏⟩
4. Operation of CNOT gate on |𝟏𝟏⟩: Here, control qubit |1⟩, ⸫ target qubit is altered from |1⟩ to |0⟩.
i.e., |1𝟏⟩ → |1𝟎⟩

Matrix representation: Truth Table of CNOT gate:


It is mathematically represented by matrix ‘UCN’; Inputs Output

1 0 0 0 |00⟩ |00⟩

= [0
1 0 0] |01⟩ |01⟩
𝑈𝐶𝑁
0 0 0 1
0 0 |10⟩ |11⟩
1 0
|11⟩ |10⟩

Controlled Z gate (CZ):


Q: Describe the working of controlled-Z gate mentioning its matrix representation and truth-table. (6M)

 CZ gate is a typical multi-qubit logic gate, it is similar to the conventional Z gate, which transform the
Target qubit (i.e., |𝐵⟩) as per Pauli Z operation if control qubit is |1⟩, otherwise remains same.
 In CZ gate transformation of Target qubit will be controlled by Control qubit.

Gate Representation:

Matrix representation: Truth Table:


It is mathematically represented by matrix ‘UCZ’; Inputs Output
1 0 0 0 |00⟩ |00⟩
𝑈𝐶𝑍 = [0 1 0 0] |01⟩ |01⟩
0 0 1 0
0 0 0 −1 |10⟩ |10⟩
|11⟩ -|11⟩

Dept. of Engg. Physics, GMIT, DVG 15


Module-III 2022 scheme Quantum Computing
Swap gate:
• SWAP gate is a typical two-qubit operation.
• It just swaps the state of the two qubits involved in the operation.
• It is a combined circuit of 3 CNOT gates & overall effect is; 2 input qubits are just swapped at the output.
Gate Representation;

Matrix representation: Truth Table:


It is mathematically represented by matrix ‘USwap’;
Inputs Output
1 0 0 0
|00⟩ |00⟩
𝑈𝑆𝑤𝑎𝑝 = [0 0 1 0]
|01⟩ |10⟩
0 1 0 0
|10⟩ |01⟩
0 0 0 1
|11⟩ |11⟩

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.

Gate representation:

Matrix representation: Truth Table:


It is mathematically represented by matrix ‘UT’ Inputs Output

1 0 0 0 0 0 0 0 |000⟩ |000⟩
0 1 0 0 0 0 0 0 |001⟩ |001⟩
0 0 1 0 0 0 0 0 |010⟩ |010⟩

𝑈𝑇 = 0
0 0 1 0 0 0 0 |011⟩ |011⟩
0 0 0 0 1 0 0 0 |100⟩ |100⟩
0 0 0 0 0 1 0 0 |101⟩ |101⟩
0 0 0 0 0 0 0 1 |110⟩ |111⟩
[0 0 0 0 0 0 1 0] |111⟩ |110⟩

Dept. of Engg. Physics, GMIT, DVG 16


Module-III 2022 scheme Quantum Computing

Solved Examples
Example 1. A linear operator ‘𝑋’ operates on qubit states such that 𝑋|0⟩ = |1⟩ and 𝑋|1⟩ = |0⟩. Find
the matrix representation of ‘𝑋’. (MQP-I, VTU June 2023)

Soln: Given 𝑋|0⟩ = |1⟩


𝑋|1⟩ = |0⟩
𝑋=?

𝑥11 𝑥12
Consider X is 2×2 matrix; 𝑋 = [𝑥 𝑥22 ]
21

From, 𝑋|0⟩ = |1⟩

𝑥11 𝑥12 1 𝑥11 × 1 + 𝑥12 × 0 0


[𝑥 𝑥22 ] [0] = [𝑥21 × 1 + 𝑥22 × 0] = [1]
21

Hence, 𝒙𝟏𝟏 = 𝟎 and 𝒙𝟐𝟏 = 𝟏

Then from, 𝑋|1⟩ = |0⟩

𝑥11 𝑥12 0 𝑥11 × 0 + 𝑥12 × 1 1


[𝑥 𝑥22 ] [1] = [𝑥21 × 0 + 𝑥22 × 1] = [0]
21

Hence, 𝒙𝟏𝟐 = 𝟏 and 𝒙𝟐𝟐 = 𝟎

𝟎 𝟏
Then 𝑋 becomes; 𝑿=[ ]
𝟏 𝟎
𝟏 𝟏

Example 2. Show that given matrix 𝑼 = [√𝟐


𝒊
√𝟐
−𝒊 ] is unitary or not.
√𝟐 √𝟐

Soln: The matrix is said to be unitary if and only if, 𝑼𝑼† = 𝑼† 𝑼 = 𝑰


1 1 1 −𝑖

𝑈 † = (𝑈 ∗ )𝑇 = [√1 √2
2 √2 2
𝑈 = [√𝑖 −𝑖 ] 𝑖 ]
√2 √2 √2 √2
1 1 1 −𝑖 1 1 −𝑖 𝑖 1 1
+ + + 0
2 2 2 2 1 0
𝑈𝑈 =† [√𝑖2 √2
−𝑖 ] [√12 √2
𝑖 ] = [𝑖 𝑖2 𝑖2
] = [ 2 2
1 1] = [ ]=𝐼

𝑖
− − 0 + 0 1
√2 √2 √2 √2 2 2 2 2 2 2

1 −𝑖 1 1 1 1 −𝑖 𝑖 1 1
+ + + 0
† √2 √2 √2 √2 2 2 2 2 2 2 1 0
𝑈 𝑈= 1 𝑖 𝑖 −𝑖
=[ 2 2] = [ 1 1
]= [ ]=𝐼
𝑖 𝑖 𝑖 𝑖 0 1
− − − 0 +
[√2 √2] [√2 √2 ] 2 2 2 2 2 2
∴ 𝑼𝑼† = 𝑼† 𝑼 = 𝑰
Hence, the given matrix is unitary matrix.

Dept. of Engg. Physics, GMIT, DVG 17


Module-III Quantum Computing
Example 3. Using matrix multiplication, show that on applying Hadamard gate twice to a |0⟩ results
in its original state.
Soln: Show that HH|0⟩ = |0⟩
1 1 1
If H is a Hadamard gate, 𝐻= [ ]
√2 1 −1

Since we know that, 𝐼 |0⟩ = |0⟩

⸫ HH |0⟩ = |0⟩

Thus Hadamard gate operate twice on any state it gives same state.

Example 4. Prove that Hadamard gate is a unitary gate.


Soln: Show that 𝐻𝐻 † = 𝐻 † 𝐻 = 𝐼
1 1 1
If H is a Hadamard gate, 𝐻= [ ]
√2 1 −1

1 1 1
Then 𝐻 † = (𝐻 ∗ )𝑇 = [ ]
√2 1 −1

1 1 1 1 1 1 1 1+1 1−1 1 2 0
𝐻𝐻 † = [ ]∙ [ ]= [ ]= [ ]=𝐼
√2 1 −1 √2 1 −1 2 1−1 1+1 2 0 2

1 1 1 1 1 1 1 1+1 1−1 1 2 0
and 𝐻† 𝐻 = [ ]∙ [ ]= [ ]= [ ]=𝐼
√2 1 −1 √2 1 −1 2 1−1 1+1 2 0 2

∴ 𝑯𝑯† = 𝑯† 𝑯 = 𝑰

Hence proved Hadamard gate is unitary gate.

Example 5. Show that S gate can be formed by connecting two T gates in series.
Soln: Show that T2 = S
1 0
If T gate is; 𝑇 = [0 1+𝑖]
√2

⸫ T2 = S

Dept. of Engg. Physics, GMIT, DVG 18


Module-III Quantum Computing

Example7. Find the inner product of states |𝟎⟩ and |𝟏⟩ and draw the conclusions on the results.

Solution:
|0 ⟩ = [ 1 ] & |1⟩ = [0]
0 1

Then their inner product is, ⟨𝟎|𝟏⟩ = [1 0] ∙ [0] = (1 ∙ 0 + 0 ∙ 1) = 𝟎


1

& ⟨𝟏|𝟎⟩ = [0 1] ∙ [1] = (0 ∙ 1 + 1 ∙ 0) = 𝟎


0
Since, their inner product is 0, then two states |0⟩ and |1⟩ are said to orthogonal.

⟨𝟎|𝟎⟩ = [1 0] ∙ [1] = (1 ∙ 1 + 0 ∙ 0) = 𝟏
0

⟨𝟏|𝟏⟩ = [0 1] ∙ [0] = (0 ∙ 0 + 1 ∙ 1) = 𝟏
1
Since, their inner product is 1, therefore two states |0⟩ and |1⟩ are said to be orthonormal.
α1 β
Example 8. Given |ᴪ⟩ = [α ] and |∅⟩ = [ 1 ] prove that ⟨ᴪ|∅⟩ = ⟨∅|ᴪ⟩∗ . (MQP-II, 2023)
2 β2
β
Solution: ⟨ᴪ|∅⟩ = [α1∗ α∗2 ] ∙ [ 1]
β2

= β1α1∗ + β2α∗2 …….. (1)


α
⟨∅|ᴪ⟩ = [β1∗ β∗2] [α1 ]
2

= α1 β1∗ + α2 β∗2

⟨∅|ᴪ⟩∗ = (α1 β1∗ + α2 β∗2)

= β1α1∗ + β2α∗2 …….. (2)

Thus from (1) and (2): ⟨ᴪ|∅⟩ = ⟨∅|ᴪ⟩∗

Dept. of Engg. Physics, GMIT, DVG 19

You might also like