Quantum Computing Numericals - Module 3
Quantum Computing Numericals - Module 3
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