Module 3 - Quantum Computing
Module 3 - Quantum Computing
RNS INSTITUTE OF
TECHNOLOGY
Autonomous Institution Affiliated to VTU, Recognized by GOK, Approved by AICTE
(NAAC Accredited with ‘A+ Grade’ Accredited, NBA Accredited (UG - CSE, ECE, ISE, EIE and EEE)
Channasandra, Dr. Vishnuvardhan Road, Bengaluru - 560 098
Ph: (080)28611880, 28611881 URL: [Link]
Module-3
QUANTUM COMPUTING
QUANTUM COMPUTING
Module-3
QUANTUM COMPUTING:
Moore’s law - limitation of VLSI, Classical vs Quantum Computation, bit,
Qubit and its properties, Bloch Sphere, Dirac notation, Brief discussion
on types of qubits, Superconducting qubits, Charge qubit, Matrix
representation of qubits, Pauli matrices, Inner product, Quantum Gates
– Pauli Gates, Phase gate (S, T), Hadamard Gate, two qubit gates –
CNOT gate, C-Z gate, Toffolli Gate, Predicting the outputs of various
combinations of single and multiple qubit gates. Numerical Problems.
Syllabus
© Dr. Akshay Arjun
5/4/2026
Department of Physics, RNS Institute of Technology © Dr. Akshay Arjun
3
Objectives
COURSE OBJECTIVES
After successfully completing the course, the student will be able to:
Discuss the basic principles of Quantum Mechanics and their application in Quantum
Computing.
As integration density increases, we achieve exponential improvements in speed, size, and cost-effectiveness.
Physical Challenges:
Bit Values Bits are either 0 or 1 at any instant Qubits can be 0, 1, or both (superposition)
Output Deterministic (same input gives same output) Probabilistic (outcome may vary on measurement)
Gates Used Logic gates: AND, OR, NOT Quantum gates: X, Y, Z, H, CNOT, etc.
Circuit Implementation Macroscopic (e.g., CMOS) – fast and scalable Microscopic (e.g., NMR) – delicate and slower
© Dr. Akshay Arjun
5/4/2026
Department of Physics, RNS Institute of Technology © Dr. Akshay 18
Arjun
Concept of Qubit and its Properties
From Bits to Qubits
Bit (Classical):
• A digital computer uses bits: either 0 or 1
• A bit can represent two distinct physical configurations:
• Light bulb: on/off
• Coin: heads/tails
• Electrical signal: absence/presence (0 or 1)
Qubit (Quantum):
• A qubit is the quantum version of a bit
• It is the physical carrier of quantum information
• Can exist as |0⟩, |1⟩, or both at the same time (superposition)
© Dr. Akshay Arjun
5/4/2026
Department of Physics, RNS Institute of Technology © Dr. Akshay 19
Arjun
Dirac Representation
Concept of Qubit and its Properties
Dirac Notation and Qubit States
Dirac Notation:
• Ket → | ⟩ (e.g., |0⟩, |1⟩): represents a column vector
• Brac → ⟨ |: represents a row vector
• Combined: Brac–Ket notation
1 0
| 0 = , |1 =
0 1
Superposition and Qubit Properties
Qubit Superposition:
• A qubit can exist in a linear combination of both |0⟩ and |1⟩
| = | 0 + |1, where | |2 + | |2 = 1
• α and β are complex numbers
• Probability of outcome is determined by the magnitude squared: |α|² and |β|²
© Dr. Akshay Arjun
5/4/2026
Department of Physics, RNS Institute of Technology © Dr. Akshay 21
Arjun
Matrix Representation of Qubit States
0 |= 1 0 , 1|= 0 1
| = or | = | 0 + |1
© Dr. Akshay Arjun
5/4/2026
Department of Physics, RNS Institute of Technology © Dr. Akshay 22
Arjun
Concept of Qubit and its Properties
Excited level
|0⟩ |1⟩
Ground level
Qubit represented by two electronic levels in an atom
Normalization Condition
• The qubit must satisfy the normalization condition:
α2+ β2=1
• Here:
• α 2 is the probability of measuring the qubit in state ∣0⟩
• β 2 is the probability of measuring the qubit in state ∣1⟩
• Measurement always gives either ‘0’ or ‘1’, probabilistically based on the above values.
© Dr. Akshay Arjun
5/4/2026
Department of Physics, RNS Institute of Technology © Dr. Akshay 24
Arjun
Superposition of Two States
Example of Superposition
• Consider the state:
1 1
ψ = 0 + 1
2 2
Then:
1 1
α= , β=
2 2
2 2
1
α = β =
2
• The qubit has a 50% probability of being measured in either state ∣0⟩ or ∣1⟩.
superposed state.
• Qubit’s power lies in being able to hold such superposed states until measured.
Definition: Register
A register is a group of flip-flops used to hold information in a digital system for processing by logic
units.
© Dr. Akshay Arjun
5/4/2026
Department of Physics, RNS Institute of Technology © Dr. Akshay 28
Arjun
Properties of Qubits
4. Measurement Collapse
• On measurement, a qubit collapses to one of the basis states:
∣0⟩ or ∣1⟩
• The outcome is probabilistic, depending on the values of α 2 and β 2
know the other box has the blue one—even if it's far away. That’s kind of how entangled particles
behave.
Quantum Tunneling
Quantum tunneling is when a particle passes through a barrier that it shouldn't be able to cross if
we followed classical physics.
Analogy:
Imagine you're a small ball trapped in a valley between two hills. In classical physics, you need
enough energy to roll over the hill. But in quantum mechanics, there's a small chance the ball can
magically appear on the other side of the hill—without ever going over it! This is quantum
tunneling.
• This shows the position of the qubit on the Bloch sphere for any angle θ and ϕ.
Case 1:
𝛉 = 𝟎, 𝛟= 𝟎
ψ = cos 0 0 + 𝑒 𝑖0 sin 0 1 = 0
Case 2:
𝛉 = 𝛑, 𝛟= 𝟎
π 𝑖0
π
ψ = cos 0 + 𝑒 sin 1 = 1
2 2
© Dr. Akshay Arjun
5/4/2026
Department of Physics, RNS Institute of Technology © Dr. Akshay 34
Arjun
Bloch Sphere – Superposition Examples
𝛑
Case 3: 𝛉= , 𝛟=𝟎
𝟐
π 𝑖0
π
ψ = cos 0 + 𝑒 sin 1
4 4
1 1 |0⟩ + |1⟩
ψ = 0 + 1 =
2 2 2
𝛑
Case 4: 𝛉= , 𝛟=𝛑
𝟐
π 𝑖π
π
ψ = cos 0 + 𝑒 sin 1 𝑒 𝑖π = −1
4 4
1 1 |0⟩ − |1⟩
ψ = 0 − 1 =
2 2 2
Multiple Qubits
• Single qubits are fundamental units but do not provide computational advantage
by themselves.
• Power of quantum computing arises when multiple qubits are used together.
• Qubits can interact, and their joint states are represented using a tensor product.
1 0
|0 = , |1 =
0 1
© Dr. Akshay Arjun
5/4/2026
Department of Physics, RNS Institute of Technology © Dr. Akshay 37
Arjun
Multiple Qubits
Tensor Product of Two Column Vectors
Let:
x1 x2
U = , V =
y1 y2
Then the tensor product 𝑈 ⊗ 𝑉 is:
x1 x2
x y
U V = 1 2
y1 x2
y1 y2
This creates a 4×1 column vector from two 2×1 vectors.
0 0 0
1 0 1 0 1 0 0 0 0
|01 = = |10 = = |11 = =
0 1 0 1 0 1 1 1 0
0
0 1
Two-Qubit Superposition
Normalization condition:
• Matrix Representation
• The identity operator is represented as a 2×2 identity matrix:
ˆI =
1 0
0 1
ˆI |1 =
1 0 0 0
0 1 1 = 1 = |1
• Acts like multiplying by 1 in regular arithmetic.
• It is always a square matrix.
• It plays a neutral role in quantum operations: does not change the quantum state.
© Dr. Akshay Arjun
5/4/2026
Department of Physics, RNS Institute of Technology © Dr. Akshay 44
Arjun
Numerical Problem
What is an identity operator? Explain the matrix representation of |0⟩ and |1⟩ states and apply
identity operator 𝐼መ to |0⟩ and |1⟩ states.
Basis States:
1 0
| 0 = , |1 =
0 1
Identity Operator:
ˆI =
1 0
0 1
Applying Identity on |0⟩:
1 0 1 1 1 + 0 0 1
Iˆ | 0 = = = =| 0
0 1 0 0 1 + 1 0 0
1 0 0 1 0 + 0 1 0
ˆI |1 =
0 1 1 = 0 0 + 1 1 = 1 =|1
© Dr. Akshay Arjun
5/4/2026
Department of Physics, RNS Institute of Technology © Dr. Akshay 45
Arjun
Conjugate Matrices
Definition
• If the elements of a matrix 𝐴 are complex numbers, then the matrix formed by
taking the complex conjugate of each element is called the conjugate matrix of 𝐴.
• It is denoted by:
𝐴∗ = Conjugate of 𝐴
Examples:
0 i 0 −i i 2 −i 2
A= , A =
*
A= , A =
*
−i 0 i 0 i + 1 −i −i + 1 i
1 2i 1 −2i 1 i 1 −i
A= , A =
*
A= , A =
*
4 i + 1 4 −i + 1 −i 1 i 1
1 0 1 −2
A= , A =
T
−2 1 0 1
1 2i T 1 4i + 1
A= , A =
4i + 1 0 2i 0
© Dr. Akshay Arjun
5/4/2026
Department of Physics, RNS Institute of Technology © Dr. Akshay 47
Arjun
Hermitian Matrix
A Hermitian matrix is a square matrix that is equal to its own conjugate transpose.
𝐴† = 𝐴∗ 𝑇 =𝐴
Let:
4 2 + i
A=
2 − i 3
Transpose
4 2 − i
A =
T
2 + i 3
Conjugate of Transpose
4 2 + i
A =
†
2 − i 3
Since, 𝐴† = 𝐴, the above matrix is a Hermitian matrix
© Dr. Akshay Arjun
5/4/2026
Department of Physics, RNS Institute of Technology © Dr. Akshay 48
Arjun
Unitary Matrix
• A matrix 𝐴 is called unitary if it satisfies:
𝐴𝐴† = 𝐴† 𝐴 = 𝐼
• That is, the conjugate transpose is the inverse of the matrix:
𝐴† = 𝐴−1
Example
Let:
1 1 + i 1 − i
A=
2 1 − i 1 + i
Then, it can be verified that:
U V = UT V
© Dr. Akshay Arjun
5/4/2026
Department of Physics, RNS Institute of Technology © Dr. Akshay 52
Arjun
Inner Product in Complex Vector Space
Definition
• The inner product of two vectors ∣U⟩ and ∣V⟩ is a function that:
3i
U | V = 3 − i 4 + i
4
Problem
Find the norm of
1 − i
|U =
2
1 0
| 0 = , |1 =
0 1
0
0 |1 = 1 0 = 0
1
Physical Meaning
Ensures the quantum system exists somewhere in the state space — important
for measurement and probabilities in quantum mechanics.
0 1
1|1 = 0 1 = (0 0) + (11) = 1 1| 0 = 0 1 = (0 1) + (1 0) = 0
1 0
© Dr. Akshay Arjun
5/4/2026
Department of Physics, RNS Institute of Technology © Dr. Akshay 63
Arjun
Orthonormality of Qubit Basis
• ⟨0|0⟩ – Normalized
• ⟨0|1⟩ – Orthogonal
• ⟨1|1⟩ – Normalized
• ⟨1|0⟩ – Orthogonal
0 1 0 1 1 0
=
2
1 = =I
1 0 1 0 0 1
Similarly,
22 = 32 = I
Hence, 𝝈𝟐𝒊 = 𝑰
2. Hermitian Nature:
A matrix σ is Hermitian if:
† =
2† = 2
0 −i
2 =
i 0
0 i
=*
2
−i 0
0 −i
= ( ) =
†
2
* T
2
i 0
2† = 2 So, 2 is Hermitian
© Dr. Akshay Arjun
5/4/2026
Department of Physics, RNS Institute of Technology © Dr. Akshay 69
Arjun
Pauli Matrices Acting on Basis States ∣0⟩ and ∣1⟩
X Gate (Bit-Flip Gate)
0 1 0 1 1 0×1 + 1×0 0
X = X | 0 = = = = |1
1 0 1 0 0 1×1 + 0×0 1
0 1 0 1
X |1 = = = | 0
1 0 1 0
Reverses coefficients ⇒ 𝑿 𝝍 = 𝛂 𝟏 + 𝛃 𝟎
© Dr. Akshay Arjun
5/4/2026
Department of Physics, RNS Institute of Technology © Dr. Akshay 70
Arjun
Pauli Matrices Acting on Basis States ∣0⟩ and ∣1⟩
Y Gate Operation (Bit- and phase-flip gate)
0 −i 0 −i 1 0×1 + (−i)×0 0
Y = Y | 0 = = = = i |1
i 0 0 i×1 + 0×0 i
i 0
0 −i 0 −i
Y |1 = = = −i | 0
i 0 1 0
𝒀𝟎 =𝒊𝟏 𝒀 𝟏 = −𝒊 𝟎
Y Gate on Superposition State
Let | = 0 −i −i
Y | = = = −i | 0 + i |1
i 0 i
So, 𝒀 𝝍 = 𝒊𝛂 𝟏 − 𝒊𝛃 𝟎
1 0 1 1
Z | 0 = = =| 0
0 −1 0 0
Leaves |𝟎⟩ unchanged and flips phase of |𝟏⟩
Z Gate on Superposition State
Let 1 0
| = Z | = = = | 0 − |1
0 −1 −
𝟎 𝟏 𝟎 𝒊𝟏 𝟎 𝟎
𝟏 𝟎 𝟏 −𝒊 𝟎 𝟏 −𝟏
𝛂 𝟎 +𝛃 𝟏 𝛂 𝟏 +𝛃 𝟎 𝛂 𝟎 +𝛃 𝟏 𝒊𝛂 𝟏 − 𝒊𝛃 𝟎 𝛂 𝟎 +𝛃 𝟏 𝛂 𝟎 −𝛃 𝟏
𝛂 𝟎 +𝛃 𝟏 𝛂 𝟏 +𝛃 𝟎
X
𝛂 𝟎 +𝛃 𝟏 𝒊𝛂 𝟏 − 𝒊𝛃 𝟎
Y
𝛂 𝟎 +𝛃 𝟏 𝛂 𝟎 −𝛃 𝟏
Z
[Link]
[Link]
tumGatesOnABlochSphere/
© Dr. Akshay Arjun
5/4/2026
Department of Physics, RNS Institute of Technology © Dr. Akshay 74
Arjun
Numerical Problem Exercise
A linear operator 𝑋 is defined by its action on the standard basis states as: 𝑋|0⟩ = |1⟩, 𝑋|1⟩ = |0⟩ Find the
matrix representation of 𝑋.
The standard basis vectors in quantum computing are:
1 0
| 0 = , |1 =
0 1
Represent X as an unknown 2×2 matrix
x x12
X = 11
x21 x22
We want to determine 𝑥11 , 𝑥12 , 𝑥21 , 𝑥22
x11 x12 1 x11 0 x11 0
Use the condition 𝑿|𝟎⟩ = |𝟏⟩ X | 0 = = We knowthat X | 0 =|1 = = x11 = 0, x21 = 1
x21 x22 0 x21 1 x21 1
x x12 0 1
Now we substitute all values: X = 11 =
x21 x22 1 0
© Dr. Akshay Arjun
5/4/2026
Department of Physics, RNS Institute of Technology © Dr. Akshay 75
Arjun
Numerical Problem Exercise
A linear operator 𝑍 is defined by its action on the standard basis states as: 𝑍|0⟩ = |0⟩, 𝑍|1⟩ = −|1⟩ Find
the matrix representation of 𝑍.
The standard basis vectors in quantum computing are:
1 0
| 0 = , |1 =
0 1
Represent Z as an unknown 2×2 matrix
z z12
Z = 11
z21 z22
We want to determine 𝑧11 , 𝑧12 , 𝑧21 , 𝑧22
z z12 1 z11 1
Use the condition 𝒁|𝟎⟩ = |𝟎⟩ Z | 0 = 11 = Z | 0 =| 0 = 𝑧11 = 1, 𝑧21 = 0
z21 z22 0 z21 0
Use the condition 𝒁|𝟏⟩ = −|𝟏⟩ Z |1 = z11 z12 0 z12 0
z = Z |1 = − |1 = 𝑧12 = 0, 𝑧22 = −1
21 z22 1 z22 −1
z z12 1 0
Now we substitute all values: Z = 11 =
z21 z22 0 −1
© Dr. Akshay Arjun
5/4/2026
Department of Physics, RNS Institute of Technology © Dr. Akshay 76
Arjun
Numerical Problem Exercise
Using two X gates in series form a quantum wire.
In quantum computing, a quantum wire refers to an operation or sequence of operations that passes a qubit
through unchanged (identity operation)
Matrix of the Pauli-X Gate
0 1
X =
1 0
Apply two X gates in series: 𝑿 ⋅ 𝑿
𝑋 𝑋ψሻ = 𝐼ψ = ψ
So the input state passes through unchanged, just as it would through a quantum wire.
The Hadamard Gate (H) is a single-qubit gate that creates a superposition state from
the basis states
1 1 1
H=
2 1 −1
Action of Hadamard Gate on |0⟩ State
Let the qubit be in the state:
1
| 0 =
0
Now apply the Hadamard gate to the qubit state:
1 1 1 1 1 1
H | 0 = 1 −1 0 =
2 2 1
In terms of quantum states: 1
H | 0 = (| 0+ |1 )
2
© Dr. Akshay Arjun
5/4/2026
Department of Physics, RNS Institute of Technology © Dr. Akshay 78
Arjun
Hadamard Gate (H)
1 1 1 0 1 1 0 + 1 1 1 1 1 1
H |1 = 1 0 + (−1) 1 = H |1 =
2 1 −1 1 2 2 −1
2 −1
1
H |1 = (| 0− |1 )
2
Action of H Gate:
Now apply the Hadamard gate to the superposition state:
1 1 1 1 1 + 1 1 +
H | = 1 −1 1 + (−1) = −
2 2 2
In terms of quantum states:
+ 1 − 0 + −
H | = + H | = | 0 + |1
2 0 2 1 2 2
© Dr. Akshay Arjun
5/4/2026
Department of Physics, RNS Institute of Technology © Dr. Akshay 80
Arjun
Hadamard Gate (H)
2
1 1
P(| 0 ) = =
2 2
2
1 1
P(|1 ) = =
2 2
Input Output
|𝟎⟩ + |𝟏⟩
𝟎
𝟐
𝟎 − |𝟏⟩
𝟏
𝟐
|𝟎⟩ + |𝟏⟩ 𝟎 − |𝟏⟩
𝛂 𝟎 +𝛃 𝟏 𝜶 +𝜷
𝟐 𝟐
1 1 2 1 2 1
H ( H | 0 ) = = = =| 0
2 2 0 2 0 0
Hence, applying the Hadamard gate twice to |0⟩ returns the original state |0⟩, as required
© Dr. Akshay Arjun
5/4/2026
Department of Physics, RNS Institute of Technology © Dr. Akshay 84
Arjun
Hadamard Gate – The Gate to Superposition
Prove that applying the Hadamard gate twice on the state |1⟩ returns the state |1⟩, i.e., show that
𝐻(𝐻|1⟩ሻ = |1⟩, using matrix multiplication steps.
The matrix form of the Hadamard gate is:
1 1 1 0
H= |1 =
2 1 −1 1
Apply Hadamard once: 𝑯|𝟏⟩
1 1 1 0 1 1(0) + 1(1) 1 1
H |1 = = =
2 1 −1 1 2 1(0) + (−1)(1) 2 −1
Apply Hadamard again: 𝑯(𝑯|𝟏⟩ሻ
1 1 1 1 1 1 1 1 1 1 1(1) + 1( −1) 1 0
H −1 = 2 H −1 H = = =
2 −1 2 1 −1 −1 2 1(1) + (−1)(−1) 2 2
1 1 0 1 0 0
H ( H |1 ) = = = =|1
2 2 2 2 2 1
Hence, applying the Hadamard gate twice to |1⟩ returns the original state |1⟩, as required
© Dr. Akshay Arjun
5/4/2026
Department of Physics, RNS Institute of Technology © Dr. Akshay 85
Arjun
Hadamard Gate – The Gate to Superposition
Show that the Hadamard gate is unitary.
Compute 𝐻𝐻
1 1 1 1 1 1 1 1 1 1 1 1 1(1) + 1(1) 1(1) + 1(−1) 1 2 0 1 0
HH = = = = = =I
2 1 −1 2 1 −1 2 1 −1 1 −1 2 1(1) + (−1)(1) 1(1) + (−1)(−1) 2 0 2 0 1
Hence, 𝑯† 𝑯 = 𝑰 ⇒ 𝑯 is unitary
© Dr. Akshay Arjun
5/4/2026
Department of Physics, RNS Institute of Technology © Dr. Akshay 86
Arjun
Phase Gate (S Gate)
• Definition: The Phase Gate (also known as the S Gate) is a single-qubit gate.
• Function:
• Matrix Representation:
1 0
S=
0 i
1 0 1 1 1 + 0 0 1
S | 0 = = =
0 i 0 0 1 + i 0 0
Result:
𝑺 ∣ 𝟎⟩ =∣ 𝟎⟩
1 0 0 1 0 + 0 1 0
S |1 = = =
0 i 1 0 0 + i 1 i
Result:
𝑺 𝟏 =𝒊⋅ 𝟏
1 0 1 + 0
S | = = =
0 i 0 + i i
Resulting State:
𝑆 ψ = α 0 + 𝑖β 1
Input Output
𝟎 𝟎
𝟏 𝒊𝟏
𝜶 𝟎 +𝜷 𝟏 𝜶 𝟎 + 𝒊𝜷 𝟏
𝛂 𝟎 +𝛃 𝟏 S 𝜶 𝟎 + 𝒊𝜷 𝟏
• T-Gate is a single-qubit gate that introduces a π/4 phase shift to the |1⟩ state.
• Matrix Representation:
1 0
T = i /4
0 e
1 0 1 1 1 + 0 0 1
T | 0 = i /4
= i /4 =
0 e 0 0 1 + e 0 0
Result:
𝑇0 = 0
1 0 0 1 0 + 0 1 0 i /4 0
T |1 = i /4
= i /4 = i /4 = e
0 e 1 0 0 + e 1 e 1
Result:
𝑇 1 = 𝑒 𝑖π/4 1
Resulting State:
𝑇 ψ = α 0 + β𝑒 𝑖π/4 1
T-Gate
Input Output
𝟎 𝟎
𝟏 𝒆𝒊𝝅/𝟒 𝟏
𝜶 𝟎 +𝜷 𝟏 𝜶 𝟎 + 𝜷𝒆𝒊𝝅/𝟒 𝟏
𝛂 𝟎 +𝛃 𝟏 T 𝜶 𝟎 + 𝜷𝒆𝒊𝝅/𝟒 𝟏
State Superposition
00
| = 00 | 00 + 01 | 01 + 10 |10 + 11 |11 = 01
10
11
Thus,
1 0 0 0
0 1 0 0
CNOT =
0 0 0 1
0 0 1 0
© Dr. Akshay Arjun
5/4/2026
Department of Physics, RNS Institute of Technology © Dr. Akshay101
Arjun
CNOT Gate Matrix Construction (4×4)
1 0 0 0
0 1 0 0
| 00 → | 00 → | 01 →| 01 → |10 → |11 → |11 → |10 →
0 0 0 1
0 0 1 0
|0⟩ |0⟩ |0⟩ |0⟩ |1⟩ |1⟩ |1⟩ |1⟩
CNOT on ∣00⟩
CNOT on ∣01⟩
CNOT on ∣10⟩
CNOT on ∣11⟩
CNOT
Input Output
∣00⟩ ∣00⟩
∣01⟩ ∣01⟩
∣10⟩ ∣11⟩
∣11⟩ ∣10⟩
1 0 0 0
0 1 0 0
UZ =
0 0 1 0 1 0
0 Z =
0 0 −1
0 −1
© Dr. Akshay Arjun
5/4/2026
Department of Physics, RNS Institute of Technology © Dr. Akshay106
Arjun
Controlled-Z Gate (𝑼𝒁 )
State 1:
1 1 0 0 0 1 1
0 0 1 0 0 0 0
| 00 = U Z | 00 = = =| 00
0 0 0 1 0 0 0
0 0 0 0 −1 0 0
State 2:
0 1 0 0 0 0 0
1 0 1 0 0 1 1
| 01 = U Z | 01 = = =| 01
0 0 0 1 0 0 0
0 0 0 0 −1 0 0
0 1 0 0 0 0 0
0 0 1 0 0 0 0
|11 = U Z |11 = = = − |11
0 0 0 1 0 0 0
1 0
0 0 −1 1 −1
Input Output
∣00⟩ ∣00⟩
∣01⟩ ∣01⟩
∣10⟩ ∣10⟩
∣11⟩ −∣11⟩
Z
|0⟩ |0⟩ |0⟩ |0⟩ |1⟩ |1⟩ |1⟩ |1⟩
|0⟩
Z |0⟩ |1⟩
Z |1⟩ |0⟩
Z |0⟩ |1⟩
Z -|1⟩
No change because No change because Control bit acts on target Control bit acts on target
control bid is |0⟩ control bid is |0⟩ but there is no flip of |1⟩ and flips |1⟩ to -|1⟩
© Dr. Akshay Arjun
5/4/2026
Department of Physics, RNS Institute of Technology © Dr. Akshay110
Arjun
Toffoli Gate (Controlled-Controlled-NOT or CCNOT)
Definition
• The first two qubits are control qubits — they remain unchanged.
Matrix Representation
The Toffoli gate is represented as an 8×8 matrix:
1 0 0 0 0 0 0 0
0 1 0 0 0 0 0 0
0 0 1 0 0 0 0 0
0 0 0 1 0 0 0 0
UT =
0 0 0 0 1 0 0 0
0 0 0 0 0 1 0 0
0 0 0 0 0 0 0 1
0 0 0 0 0 0 1 0
Input Output
A A′
A B C A′ B′ C′
0 0 0 0 0 0
0 0 1 0 0 1
B B′ 0 1 0 0 1 0
0 1 1 0 1 1
1 0 0 1 0 0
1 0 1 1 0 1
C C′ 1 1 0 1 1 1
1 1 1 1 1 0
Disclaimer:
Some parts of the content used in this presentation have been sourced from
various references, including books, academic resources, and online materials.
These materials have been incorporated without prior permissions and are
intended solely for educational and non-commercial purposes.
This presentation is not for commercial distribution.
All rights to the original content belong to their respective owners.
The purpose of this presentation is knowledge sharing and learning.