Bphys102 Mod3@Azdocuments - in
Bphys102 Mod3@Azdocuments - in
QUANTUM COMPUTING
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. Numerical Problems.
Quantum Gates:
Single Qubit Gates: Quantum Not Gate, Pauli – X, Y and Z Gates, Hadamard Gate, Phase
Gate (or S Gate), T Gate.
Multiple Qubit Gates: Controlled gate, CNOT Gate, (Discussion for 4 different input states).
Representation of Swap gate, Controlled -Z gate, Toffoli gate.
Introduction
Today’s computers—both in theory and practice (PCs, HPCs, laptops, tablets, smartphone )
are based on classical physics. They are limited by locality (operations have only local
effects) and by the classical fact that systems can be in only one state at the time. However,
modern quantum physics tells us that the world behaves quite differently. A quantum system
can be in a superposition of many different states at the same time, and can exhibit
interference effects during the course of its evolution. Moreover, spatially separated quantum
systems may be entangled with each other and operations may have “non-local” effects
because of this.
Quantum computation is the field that investigates the computational power and other
properties of computers based on quantum-mechanical principles. It combines two of the
most important strands of 20th-century science: quantum mechanics (developed by Planck,
Einstein, Bohr, Heisenberg, Schrödinger and others in the period 1900–1925) and computer
science . An important objective is to find quantum algorithms that are significantly faster
than any classical algorithm solving the same problem.
Quantum computing is a type of computation whose operations can harness the phenomena
of quantum mechanics, such as superposition, interference, and entanglement.
To store and manipulate the information, they use their own quantum bits also called ‘Qubits’
unlike other classical computers which are based on classical computing that uses binary bits
0 and 1 individually
The computers using such type of computing are known as ‘Quantum Computers’.
In such small computers, circuits with transistors, logic gates, and Integrated Circuits are not
possible. Hence, it uses the subatomic particles like atoms, electrons, photons, and ions as
their bits along with their information of spins and states. Instead of 0 and 1, Quantum
computers can choose two electronics states of an atom or two different polarization
orientations of light for the two states They can be superposed and can give more
combinations.
.
MODULE III
In the year 1965, Gordon Moore, co-founder of Intel discovered that “the number of
transistors in a dense integrated circuit (IC) doubles about every two years”. Moore's
law is an observation and projection of a historical trend. Rather than a law of physics, it is
an empirical relationship linked to gains from experience in production.
Moore’s Law is considerable because it means that computers and their computing power get
smaller and faster over time. Though this law is putting the brakes on now and consequently,
the improvement in classical computers is not like before it used to be. This shows that the
size of the circuits of the classical computer after 3-2 nanometres has reached their limit. At
these scales, controlling the flow of electrons becomes increasingly more difficult as all kinds
of quantum effects play themselves within the transistor itself. Since, the transistor is
approaching the point where it is simply as small as we can ever make it and have it still
function.
The way we’ve been building and improving silicon chips is coming to its final iteration.
Thus Quantum Computation is the option for the further generation.
Classical Bits :
It’s a single unit of information that has a value of either 0 or 1 (off or on, false or true, low
or high).
Quantum Bits :
In quantum computing, a qubit or quantum bit is the basic unit of quantum information. A
quantum system like atom or electrons can exist in states as 0 and 1 or simultaneously both
as 0 and 1.
Classical Computing
Quantum Computing
Concept of Qubit
Properties of Qubits
❖ Superposition
A Qubit can be in a superposed state of the two states /0> and /1> (Ket notation) . If
measurements are carried out with a qubit in superposed state then the results that we
get will be probabilistic
❖ No Cloning Theorem
The Qubit changes its state once it is subjected to the measurement. It means, one
cannot copy the information from the qubit the way we do it in classical computers, as
there will be no similarity between the copy and the original.This is known as “no
cloning principle”
MODULE III
❖ Entanglement
Two Qubits can strongly correlated with each other. Changing state of one of the
qubits will instantaneously change the the state of the other one in predictable way.
This happens even if they are separated by very long distances.
❖ The pure state space qubits (Two Level Quantum Mechanical Systems) can be
visualized using an imaginary sphere called Bloch Sphere. It has a unit radius
❖ This Bloch sphere picture is elegant and powerful for the single qubit.
❖ The Arrow on the sphere represents the state of the Qubit. The north and south poles
are used to represent the basis states |0⟩ and |1⟩ respectively. The other locations on
the bloch sphere represents the superpositions state i.e |0⟩ and |1⟩ states and
represented by 𝛼 |0⟩ + 𝛽 |1⟩ with |α|2 + |𝛽|2 = 1. Thus a Qubit can be any point on the
Bloch Sphere.
❖ The Bloch sphere allows the state of the qubit to be represented in unit spherical co-
ordinates. They are the polar angle 𝜃 and the azimuth angle 𝜙. The block sphere is
represented by the equation
θ θ
|𝜓⟩ = 𝑐𝑜𝑠 2 |0⟩ + 𝑒 𝑖 𝜙 𝑠𝑖𝑛 2 |1⟩
θ θ
|𝑐os 2 |2 + | sin 2 |2 = 1
❖ For any Gate operation, taking an initial state to the final state of the single-qubit, is
equivalent to a composition of one or more simple rotations on the Bloch sphere.
Single qubit
A Single Qubit has two computational basis states |0⟩ and |1⟩. In single qubit the state of
1 0
qubit will be either in 0 and 1 where 0 = [ ] and 1 = [ ]
0 1
Above basis vectors are written as column matrix in the form of identity matrix
1 0
[ ] Which represents the single qubit state. The pictorial representation of the single
0 1
qubit is as follows. 𝛼 |0⟩ + 𝛽 |1⟩
Two qubit
A two-qubit system has 4 computational basis states denoted as |00⟩, |01⟩, |10⟩, |11⟩.The
1 0 0 0
matrix representation of two qubit state is [0 1 0 0]
0 0 1 0
0 0 0 1
The pictorial representation of two qubit is as follows. 𝛼 |00⟩ + 𝛽 |01⟩ + 𝛾 |10⟩ + 𝛿 |11⟩
Extension to N qubits
A multi-qubit system of N qubits has 2𝑁 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
MODULE III
Linear Algebra
Linear Algebra is the study of vector spaces and operations on vector spaces. The Standard
quantum mechanical notation for a quantum state 𝜓 in a vector space is |𝜓⟩. The notation |⟩
indicates that the object is a vector rand is called a ket vector. The examples of ket vectors are
|𝜓⟩, |𝜙⟩ and |𝑢⟩ etc.
The wave function could be expressed in ket notation as |𝜓⟩ (ket Vector), 𝜓 is the wave
α1 1 0
function. The |𝜓⟩ = [ ] . The matrix for of the states |0⟩ and |1⟩. |0⟩ = [ ] & |1⟩ = [ ]
α2 0 1
a. Identity Operator
1 0
The operator of type 𝐼 = ( ) is called identity operator. When an identity operator acts
0 1
on a state vector its keeps the state intact. By analogy we study identity operator as an
identity matrix.
Let us consider the operation of Identity operator on |0⟩ and |1⟩ states. As per the principle of
identity operation 𝐼 |0⟩ = |0⟩ and 𝐼 |1⟩ = |1⟩
1 0 1 1
𝐼 |0⟩ = ( )( ) = ( )
0 1 0 0
1 0 0 0
𝐼 |1⟩ = ( )( ) = ( )
0 1 1 1
Thus the operation of identity matrix(operator) on |0⟩ and |1⟩ leaves the states unchanged.
There are four extreamly useful matrices called Pauli Matrices that are often used in quantum
computers. The Pauli matrices of the following form
1 0
𝜎0 = 𝐼 = ( )
0 1
0 1
𝜎1 = 𝜎𝑋 = X = ( )
1 0
0 −𝑖
𝜎2 = 𝜎𝑌 = Y = ( )
1 0
1 0
𝜎3 = 𝜎𝑍 = Z = ( )
0 −1
1 0 1 1
1. 𝜎0 |0⟩ = ( ) ( ) = ( ) = |0⟩
0 1 0 0
1 0 0 0
𝜎0 |1⟩ = ( ) ( ) = ( ) = |1⟩
0 1 1 1
0 1 1 0
2. 𝜎𝑥 |0⟩ = ( ) ( ) = ( ) = |1⟩
1 0 0 1
0 1 0 1
𝜎𝑥 |1⟩ = ( ) ( ) = ( ) = |0⟩
1 0 1 0
0 −𝑖 1 0
3. 𝜎𝑦 |0⟩ = ( ) ( ) = ( ) = 𝑖|1⟩
𝑖 0 0 1
0 −𝑖 0 1
𝜎𝑦 |1⟩ = ( ) ( ) = ( ) = −𝑖|0⟩
𝑖 0 1 0
1 0 1 1
4. 𝜎𝑧 |0⟩ = ( ) ( ) = ( ) = |0⟩
0 −1 0 0
1 0 0 0
𝜎𝑧 |1⟩ = ( ) ( ) = ( ) = −|1⟩
0 −1 1 −1
c. 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 for example consider a matrix 𝐴 as given below.
𝑖 1
A=( )
0 2 − 3𝑖
−𝑖 1
𝐴∗ = ( )
0 2 + 3𝑖
d. Transpose of a Matrix
The transpose of a matrix is found by interchanging its rows into columns or columns into
rows. The Transpose of a matrix 𝐴 is denoted by using the superscript as𝐴𝑇 . Consider a
matrix 𝐴 as given below.
𝑖 1
A=( )
0 2 − 3𝑖
𝑖 0
𝐴𝑇 = ( )
1 2 − 3𝑖
The complex conjugate transpose of a matrix interchanges the row and column index for each
element, reflecting the elements across the main diagonal. The operation also negates the
imaginary part of any complex numbers. It is denoted by a † symbol as a super script.
𝑖 1
A=( )
0 2 − 3𝑖
−𝑖 0
𝐴† = (𝐴∗ )𝑇 = ( )
1 2 + 3𝑖
d. Hermitian
The matrix that is equal to its conjugate-transpose is called Hermitian. Thus If 𝐴† = 𝐴 then it
is called Hermitian or Self-Adjoint matrix
3 3+𝑖
A=( )
3−𝑖 2
3 3−𝑖
𝐴∗ = ( )
3+𝑖 2
3 3+𝑖
𝐴† = (𝐴∗ )𝑇 = ( )
3−𝑖 2
Hence 𝐴† = A
MODULE III
e. Unitary Matrix
1 1
√2 √2
𝑈=(𝑖 −𝑖 )
√2 √2
1 1
2 √2
𝑈 ∗ = (√−𝑖 𝑖 )
√2 √2
1 −𝑖
2 √2
𝑈 † = (𝑈 ∗ )𝑇 = (√1 𝑖 )
√2 √2
1 1 1 −𝑖 1 1 −𝑖 𝑖
2 √2 √2 √2
+ + 1 0
𝑈 † 𝑈 = (√𝑖 −𝑖 ) ( 1 𝑖 )
= (2𝑖 2
𝑖
2
1
2
1 )
=( )=I
− + 0 1
√2 √2 √2 √2 2 2 2 2
Hence 𝑈 is unitary
The Column Vectors are called ket Vectors denoted by |𝜓⟩ and are represented by Column
Matrices. The Row Vectors are called Bra Vectors denoted by ⟨𝜙| and are represented by
Row Matrices. Let us consider a ket vector represented in the form of a column matrix
α1
|𝜓⟩ = [β ]
1
α1 †
[β ] = [α1∗ β1∗ ]
1
Thus the Bra is the complex conjugate of ket and viceversa. For example
1†
[ ] = [1 −𝑖 ]
i
1
|0⟩ = [ ]
0
⟨0| = [1 0]
0
|1⟩ = [ ]
1
⟨1| = [0 1]
α1
|𝜓⟩ = [β ]
1
α2
|𝜙⟩ = [β ]
2
The multiplication of the |𝜓⟩ and |𝜙⟩ is possible only by taking the inner product and is given
by ⟨𝜓|𝜙⟩
α2
⟨𝜓|𝜙⟩ = [α1∗ β1∗ ] [β ]
2
Probability
The above equation represents the Quantum Superposition of states |0⟩ and |1⟩
1 0 α
|𝜓⟩ = 𝛼 [ ] + 𝛽[ ] = [β]
0 1
α
⟨𝜓|𝜓⟩ = [α∗ β∗ ] [β] = αα∗ + ββ∗
MODULE III
Thus,
αα∗ + ββ∗ = | α |2 + | β |2
|ψ |2 = 𝜓𝜓∗
Thus the above equation represents Probability Density. As per the principle of
Normalization
|ψ |2 = 𝜓𝜓∗ = ⟨𝜓|𝜓⟩ = 1 = | α |2 + | β |2
Orthogonality
Two states |𝜓⟩ and |𝜙⟩ are said to be orthogonal if their inner product is Zero.
Mathematically
⟨𝜙|𝜓⟩ = 0
The two states are orthogonal means they are mutually exclusive. Like Spin Up and Spin
Down of an electron.
Consider ⟨0|1⟩
0
⟨0|1⟩ = [1 0] [ ] = (0 + 0) = (0)
1
Consider ⟨1|0⟩
1
⟨1|0⟩ = [0 1] [ ] = (0 + 0) = (0)
0
Orthonormality
i.e ⟨𝜙|𝜓⟩ = 0
MODULE III
Quantum Gates
In quantum computing a quantum logic gate is a basic quantum circuit operating on a small
number of qubits. A qubit is useless unless it is used to carry out a quantum calculation. The
quantum calculations are achieved by performing a series of fundamental operations, known
as quantum logic gates. They are the building blocks of quantum circuits similar to the
classical logic gates in conventional digital circuits.
In Quantum Computing the quantum NOT gate for qubits takes the state |0⟩ to |1⟩ and vice
versa. It is analogous to the classical not gate.
0 1
𝑋=( )
1 0
0 1 1 0
X|0⟩ = ( ) ( ) = ( ) = |1⟩
1 0 0 1
0 1 0 1
X|1⟩ = ( ) ( ) = ( ) = |0⟩
1 0 1 0
α
A Quantum State is given by 𝛼 |0⟩ + 𝛽 |1⟩ and its matrix representation is given by (β) .
Hence the operation of Quantum Not Gate on quantum state is given by
α 0 1 α β
X(β) = ( )( ) = ( )
1 0 β α
Thus the quantum state becomes 𝛼 |1⟩ + 𝛽 |0⟩. Similarly, The input 𝛼 |1⟩ + 𝛽 |0⟩ to the
quantum not gates changes the state to 𝛼 |0⟩ + 𝛽 |1⟩. The quantum not gate circuit and the
truth table are as shown below.
Input Output
|0> |1>
|1> |0>
α|0> + β|1> β|0> + α|1>
Symbol:
• X Gate
• Y Gate
Y Gate is represented by Pauli matrix 𝜎𝑦 or 𝑌. This gate Maps |0⟩ state to 𝑖 |1⟩ state and |1⟩
state to −𝑖 |0⟩ state. The Y Gate and its operation is as given below
0 −𝑖
Y=( )
𝑖 0
0 −𝑖 1 0
𝑌 |0⟩ = ( ) ( ) = ( ) = 0|0⟩ + 𝑖 |1⟩ = 𝑖 |1⟩
𝑖 0 0 𝑖
0 −𝑖 0 −𝑖
𝑌 |1⟩ = ( ) ( ) = ( ) = - 𝑖 |0⟩ + 0|1⟩ = - 𝑖 |0⟩
𝑖 0 1 0
α
𝑌 (𝛼 |0⟩ + 𝛽 |1⟩) = 𝑌 (β) = −𝑖𝛽 |0⟩ +𝑖𝛼 |1⟩
Input Output
|0> i|1>
|1> -i|0>
α|0> + β|1> -iβ|0> +iα |1>
• Z-Gate
The Z-gate is represented by Pauli Matrix 𝜎𝑍 or 𝑍. Z-Gate maps input state |𝑘⟩ to (−1) k |𝑘⟩.
The Matrix representation and the operation of Z-Gate on |0⟩ and |1⟩ are as follows
1 0 1 1
Z |0⟩ = ( ) ( ) = ( ) = |0⟩
0 −1 0 0
MODULE III
1 0 0 0
Z |1⟩ = ( ) ( ) = ( ) = -|1⟩
0 −1 1 −1
α
𝑍(𝛼 |0⟩ + 𝛽 |1⟩) = Z (β) = 𝛼 |0⟩ − 𝛽 |1⟩
The circuit symbol and the truth table of Z-Gate are as follows
|0> |0>
|1> -|1>
α|0> + β|1> α|0> - β|1>
c. Hadamard Gate
The Hadamard Gate is a truly quantum gate and is one of the most important in Quantum
Computing. It is a self-inverse gate. It is used to create the superpositions of |0⟩ and |1⟩ states.
The Matrix representation of Hadamard Gate is as follows
1 1 1
H= [ ]
√2 1 −1
The Hadamard Gate and the output states for the |0⟩ and |1⟩ input states are represented as
follows. The Hadamard Gate satisfies Unitary Condition.
𝐻†𝐻 = 1
α|0⟩ + β|1⟩ 1 1 1 𝛼 1 𝛼+ 𝛽 𝛂
|0⟩+ |1⟩)
+β
|0⟩− |1⟩)
[ ] [𝛽 ] = [ ] √𝟐 √𝟐
√2 1 −1 √2 𝛼 − 𝛽
The S-gate is an Rϕ gate with ϕ = π/2 or in other terms, it rotates the vector π/2 radians around
the z-axis. Unlike other gates, the S-gate is not its own inverse. Although it is still unitary.The
phase gate turns a |0⟩ into |0⟩ and a |1⟩ into 𝑖 |1⟩
1 0 1 0
S=[ ]=[ 𝑖𝜋 ]
0 𝑖 0 𝑒2
1 0 1 1
S|0⟩ = [ ] [ ] = [ ] = |0⟩
0 𝑖 0 0
1 0 0 0
S|1⟩ = [ ] [ ] = [ ] = 𝑖|1⟩
0 𝑖 1 𝑖
𝛼
𝑆 (𝛼 |0⟩ + 𝛽 |1⟩) = S [𝛽 ] = 𝛼 |0⟩ + 𝑖𝛽 |1⟩
The S Gate and the Truth table are given by For S gate
Input Output
|0⟩ |0⟩
|1⟩ 𝑖|1⟩
𝛼 |0⟩ + 𝛽 |1⟩ 𝛼 |0⟩ + 𝑖𝛽 |1⟩
𝛑
e. T Gate or Gate
𝟖
The T-gate is again a specific case of Rϕ gate with ϕ = π/4. It follows the same behaviour as
that of the S-gate.
1 0 1 0
T=[ 𝑖𝜋 ] = [0 1+𝑖]
0 𝑒 4 √2
𝛑
It is also called 𝟖 gate as it could be represented in the following form
−𝐢𝛑
𝐢𝛑
exp 0
𝟖
𝑇 = exp [ 𝐢𝛑 ]
𝟖
0 exp 𝟖
𝑇2 = 𝑆
1 0 1 1
T|0⟩ = [ ] [ ] = [ ] = |0⟩
𝑖𝜋
0 𝑒 4 0 0
1 0 0 0 𝑖𝜋
T|1⟩ = [ ] [ ] = [ 𝑖𝜋 ] = 𝑒 4 |1⟩
𝑖𝜋
0 𝑒 4 1 𝑒4
𝛼 𝑖𝜋
T (𝛼 |0⟩ + 𝛽 |1⟩) = T [𝛽 ] = 𝛼 |0⟩ + 𝑒 4 𝛽 |1⟩
Input Output
|0⟩ |0⟩
𝑖𝜋
|1⟩ 𝑒 4 |1⟩
𝑖𝜋
𝛼 |0⟩ + 𝛽 |1⟩ 𝛼 |0⟩ + 𝑒 4 𝛽 |1⟩
Multiple Qubit Gates operate on Two or More input Qubits. Usually on of them is a control
qubit.
Controlled Gates
A Gate with operation of kind "If ’𝐴’ is True then do ’𝐵’" is called Controlled Gate. The
’|𝐴⟩’ Qubit is called Control qubit and ’|𝐵⟩’ is the Target qubit. The target qubit is altered
only when the control qubit is |1⟩. The control qubit remains unaltered during the
transformations.
The CNOT gate is a typical multi-qubit logic gate. The CNOT gate operates on a quantum
register that consists of 2 qubits. The CNOT gate flips the second qubit (the target qubit) if
and only if the first qubit (the control qubit) is |1> and the circuit is as follows.
Control Qubit
Target qubit
1 0 0 0
𝑈𝐶𝑁 = [0 1 0 0]
0 0 0 1
0 0 1 0
|𝐴, 𝐵⟩ → |𝐴, 𝐵 ⊕ 𝐴⟩
Consider the operations of CNOT gate on the four inputs |00⟩,|01⟩,|10⟩ and |11⟩.
MODULE III
1 0 0 0 1 1
[0 1 0 0] [0] = [0]
0 0 0 1 0 0
0 0 1 0 0 0
Here in the inputs to the CNOT Gate the control qubit is |0⟩. Hence no change in the state of
Target qubit |0⟩
|00⟩ → |00⟩
1 0 0 0 0 0
[0 1 0 0] [1] = [1]
0 0 0 1 0 0
0 0 1 0 0 0
Here in the inputs to the CNOT Gate the control qubit is |0⟩. Hence no change in the state of
Target qubit |1⟩
|01⟩ → |01⟩
1 0 0 0 0 0
[0 1 0 0] [0] = [0]
0 0 0 1 1 0
0 0 1 0 0 1
Here in the inputs to the CNOT Gate the control qubit is |1⟩. Hence the state of Target qubit
flips from |0⟩ to |1⟩.
|10⟩ → |11⟩
1 0 0 0 0 0
[0 1 0 0] [0] = [0]
0 0 0 1 0 1
0 0 1 0 1 0
Here in the inputs to the CNOT Gate the control qubit is |1⟩. Hence the state of Target qubit
flips from |1⟩ to |0⟩.
|11⟩ → |10⟩
Input Output
|00> |00>
|01> |01>
|10> |11>
|11> |10>
b. Swap Gate
The SWAP gate is two-qubit operation. Expressed in basis states, the SWAP gate swaps the
state of the two qubits involved in the operation. The Matrix representation of the Swap Gate
is as follows
1 0 0 0
𝑈𝑆𝑊𝐴𝑃 = [0 0 1 0]
0 1 0 0
0 0 0 1
1 0 0 0 1 1
[0 0 1 0] [0] = [0]
0 1 0 0 0 0
0 0 0 1 0 0
|00⟩ → |00⟩
1 0 0 0 0 0
[0 0 1 0] [1] = [0]
0 1 0 0 0 1
0 0 0 1 0 0
MODULE III
|01⟩ → |10⟩
1 0 0 0 0 0
[0 0 1 0] [0] = [1]
0 1 0 0 1 0
0 0 0 1 0 0
|10⟩ → |01⟩
1 0 0 0 0 0
[0 0 1 0] [0] = [0]
0 1 0 0 0 0
0 0 0 1 1 1
|11⟩ → |11⟩
The swap gate is a combined circuit of 3 CNOT gates and the over all effect is that two input
qubits are swapped at the output. The Action and truth table of the swap gate is as follows.
MODULE III
Input Output
|00⟩ |00⟩
|01⟩ |01⟩
|10⟩ |01⟩
|11⟩ |11⟩
c. Controlled Z Gate
In Controlled Z Gate, The operation of Z Gate is controlled by a Control Qubit. If the control
Qubit is |𝐴⟩ = |1⟩ then only the Z gate transforms the Target Qubit |𝐵⟩ as per the Pauli-Z
operation. The action of Controlled Z-Gate could is specified by a matrix as follows.
1 0 0 0
𝑈𝑍 = [0 1 0 0]
0 0 1 0
0 0 0 −1
𝑈𝑍 |00⟩ = |00⟩
1 0 0 0 1 1
[0 1 0 0 ] [0] = [0]
0 0 1 0 0 0
0 0 0 −1 0 0
|00⟩ → |00⟩
𝑈𝑍 |01⟩ = |01⟩
1 0 0 0 0 0
[0 1 0 0 ] [1] = [1]
0 0 1 0 0 0
0 0 0 −1 0 0
|01⟩ → |01⟩
MODULE III
𝑈𝑍 |10⟩ = |10⟩
1 0 0 0 0 0
[0 1 0 0 ] [0] = [0]
0 0 1 0 1 1
0 0 0 −1 0 0
|10⟩ → |10⟩
1 0 0 0 0 0
[0 0 1 0] [0] = [ 0 ]
0 1 0 0 0 0
0 0 0 1 1 −1
|11⟩ → -|11⟩
Input Output
|00> |00>
|01> |01>
|10> |10>
|11> -|11>
MODULE III
d. Toffoli Gate
The Toffoli Gate is also known as CCNOT Gate (Controlled-Controlled-Not). It has three
inputs out of which two are Control Qubits and one is the Target Qubit. The Target Qubit
flips only when both the Control Qubits are |1⟩. The two Control Qubits are not altered during
the operation. The matrix representation, Gate Circuit and the Truth Table of Toffoli Gate are
as follows.
1 0 0 0 0 0 0 0
0 1 0 0 0 0 0 0
UT = 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 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
0 0 0 0 0 0
0 0 1 0 0 1
0 1 0 0 1 0
0 1 1 0 1 1
1 0 0 1 0 0
1 0 1 1 0 1
1 1 0 1 1 1
1 1 1 1 1 0
The Toffolli matrix is unitary. The Toffolli Gate is its own inverse. It could be used for
NAND Gate Simulation.
Chapter 1
Module-3:Quantum Computing
1. A Linar Operator ’𝑋’ operates such that 𝑋 |0⟩ = |1⟩ and 𝑋 |1⟩ = |0⟩. Find the matrix
representation of" ’𝑋’. # ! !
𝑥 11 𝑥12 1 0
Solution : 𝑋 = , |0⟩ = , |1⟩ =
𝑥 21 𝑥22 0 1
Given" 𝑋 |0⟩ = #|1⟩ ! !
𝑥 11 𝑥 12 1 0
𝑋= =
𝑥 21 𝑥 22 0 1
Multiplying the Matrices on LHS and equating with the Matrix on the RHS we get
𝑥 11 = 0 & 𝑥 21 = 1
Given" 𝑋 |1⟩ = #|0⟩ ! !
𝑥 11 𝑥 12 1 0
𝑋= =
𝑥 21 𝑥 22 0 1
Multiplying the Matrices on LHS and equating with the Matrix on the RHS we get
𝑥 12 = 1 & 𝑥 22 =" 0 #
0 1
Therefore 𝑋 =
1 0
" #
0 −𝑖
2. Given 𝐴 = , Prove that 𝐴† = 𝐴.
𝑖 0
" #
0 −𝑖
Soution : Given 𝐴 =
𝑖 0
We Know That 𝐴 = ( 𝐴∗ )𝑇
†
" #
0 𝑖
The Conjugate of Matrix A is Given by 𝐴∗ =
−𝑖 0
" #
0 −𝑖
Thus ( 𝐴∗ )𝑇 = =𝐴
𝑖 0
3
APPLIED PPHYSICS CSE STREAM
√1 1
(2) √ (2)
3. Show that the Matrix 𝑈 = 𝑖 −𝑖
is Unitary.
√
(2) √
(2)
Solution : A Matrix is Unitary if 𝑈 †𝑈 = 𝐼
√1 √−𝑖
(2) (2)
Therefore 𝑈 † = 1
√ (2) √ (2)
𝑖
=⇒
√1 √−𝑖 √1 √1
" #
(2) (2) (2) (2) 1 0
𝑈 †𝑈 = 1 −𝑖
= =𝐼
√
(2) √ 𝑖 √𝑖 √ 0 1
(2) (2) (2)
Here I is identity Matrix.
4. Find the inner product of states |1⟩ 𝑎𝑛𝑑 |0⟩ and draw conclusions on the result.
Solution : The inner product is given by ⟨𝜓|𝜙⟩ here ⟨𝜓| is conjugate-transpose of |𝜓⟩ .
We know! that !
1 0
|0⟩ = , |1⟩ =
0 1
⟨1| = 0 1
!
1
Therefore ⟨1|0⟩ = 0 1 =0
0
Thus the states |1⟩ and |0⟩ are Orthogonal.
! !
𝛼1 𝛽1
5. Given |𝜓⟩ = and |𝜙⟩ = Prove that ⟨𝜓|𝜙⟩ = ⟨𝜙|𝜓⟩ ∗
𝛼2 𝛽2
!
𝛼
1
Solution : ⟨𝜙|𝜓⟩ = 𝛽1∗ 𝛽2∗ = 𝛽1∗ 𝛼1 + 𝛽2∗ 𝛼2 ..........(1)
𝛼2
!
𝛽
1
⟨𝜓|𝜙⟩ = 𝛼1∗ 𝛼2∗ = 𝛽1 𝛼1∗ + 𝛽2 𝛼2∗
𝛽2
⟨𝜓|𝜙⟩ ∗ = (𝛽1 𝛼1∗ + 𝛽2 𝛼2∗ ) ∗ = 𝛽1∗ 𝛼1 + 𝛽2∗ 𝛼2 ..........(2)
Thus from (1) and (2)
⟨𝜓|𝜙⟩ = ⟨𝜙|𝜓⟩ ∗
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⟩
" # " # " #
1 1 1 1 2 0
𝐻𝐻 = √1 √1 = 1
2 2 2
1 −1 1 −1 0 2
" #
1 0
=⇒ =𝐼
0 1
2. Using two X-gates in series show that two not gates in serries are equivalent to a quantum
wire.
Solution : To show that 𝑋 𝑋 |0⟩ = |0⟩
" #" # " #
0 1 0 1 1 0
= =𝐼
1 0 1 0 0 1
4. Two Qbits are passed through CNOT gate.If the first qubit is the control qubit then what is
the output for the following initial states 1. |00⟩, 2. |01⟩, and 3.|11⟩.
Solution : The Operation of the CNOT gate could be represented as
|𝑥, 𝑦⟩ → |𝑥, 𝑥 ⊕ 𝑦⟩
⊕ is analogous to Classical XOR gate. XOR gate out put is high when both the inputs are
dissimilar.
|00⟩ → |0, 0 ⊕ 0⟩ = |00⟩
|01⟩ → |0, 0 ⊕ 1⟩ = |01⟩
|11⟩ → |1, 1 ⊕ 1⟩ = |10⟩
𝜋
Solution : The T gate is is also called 8 gate and is given by
" #
1 0
1 0
𝑇= = √(1+𝑖)
0
𝑖𝜋
0 𝑒4 (2)
To Prove that 𝑇 2 = 𝑆
" #
1 0 1 0
1 0
𝑇 2 = 𝑇𝑇 = √ (1+𝑖) (1+𝑖) = =𝑆
0 0 √ 0 𝑖
(2) (2)
2
1+𝑖 1+𝑖 (1+𝑖)
∵ √ √ = 2 =𝑖
2 2