Module 3
Module 3
Qubit: In quantum computing, a qubit or quantum bit is a basic unit of quantum information.
A bit of data is represented by a single atom that is in any one of the two states denoted by |0>
and |1>. A single bit of this form is known as qubit. |0> and |1> are called as the basis or basis
vectors.
A qubit |q> can be represented as a linear combination of |0> and |1> as shown below. This is
the superposition of |0> and |1>.
|q> = α|0> + β|1>
Here α and β are complex numbers and are amplitudes of |0> and |1>.
α2 + β2 = 1
Properties of qubits: qubits can present superposition entanglement properties .
Superposition : It is the ability of a quantum system to exist in more than one state at the
same time. It is associated with quantum systems, i.e., small objects such as nuclei, electrons,
elementary particles, and photons, for which wave-particle duality and other non-classical
effects are observed.
2
Page
and bra vector is denoted by the symbol < | . Bra vector is the conjugate of ket vector.
Page
Eg : If ‘q’ is the state of a system then in ket vector it is represented as |q> and in bra vector
it is represented as < q|.
let |a> and |b> are two kets , then their linear combination |q> = C1|a> + C2|b> is also a ket
vector.
The Conjugate of ket vector |q> = C1|a> + C2|b> is a bra vector and is represented as
<q|= C1*<a|+C2*<b|
where the C1* and C2* are the conjugates of C1 and C2 .
if |Ψ1> and |Ψ2> are the two state vectors then their scalar product can be written as
+∞
< Ψ1|Ψ2> = ∫−∞ 1*(x)2(x)𝒅𝒙 . here 1*(x) is the conjugate transpose of 1.
Identity operator: It is an operator which leaves the function unchanged after operation.
i.e I |a> = |a>
1 0
In matrix representation it is written as I = ( )
0 1
It satisfies the condition UU* = U*U = I,
Here U* is the conjugate transpose of U.
Determination of I|0> and I|1> :
1 0 1 0
We know that in matrix form I = ( ) , |0> = ( ) and |1> = ( ) then
0 1 0 1
1 0 1
I|0> = ( )( )
0 1 0
1 0
=( )=I
0 1
1 0 0
lly I|1> = ( )( )
0 1 1
1 0
=( )=I
0 1
⸫ I|0> = I|1> = I
Pauli Matrices : These are set of 3, 2x2 matrices, which are unitary and Hermitian.
Hermitian means the conjugate transpose of a matrix itself is that matrix.
These represented as mentioned below.
4
0 1 0 −𝑖 1 0
σx = ( ) σy = ( ) σz = ( ).
Page
1 0 𝑖 0 0 −1
is identity matrix.
Dr. Krishna Reddy B V SVCE, Bangalore – 57.
Applied Physics for CSE Stream Principles of Quantum Information and Quantum Computing
UU* = U*U = I
1 𝟐 −𝟐 + 𝒊
Eg : let U = ( )
3 𝟐+𝒊 𝟐
1 𝟐 𝟐−𝒊
Its conjugate transpose U* = ( )
3 −𝟐 − 𝒊 𝟐
1 𝟐 −𝟐 + 𝒊 1 𝟐 𝟐−𝒊
⸫ UU* = ( ) ( )
3 𝟐+𝒊 𝟐 3 −𝟐 − 𝒊 𝟐
1 𝟗 𝟎 𝟏 𝟎
= ( )=( )
9 𝟎 𝟗 𝟎 𝟏
=I
lly U*U = I
So U is a Unitary matrix.
Representation of Row and Column Matrices: A row matrix is a type of matrix that has
a single row. But the number of columns could be more than one. Therefore, if the matrix is
in the order of 1 x n, then it is a row matrix. The elements are arranged in an order such that
they represent a single row in the matrix.
Eg : (𝒖𝟏 𝒖𝟐 𝒖𝟑 … … . 𝒖𝒏)
A column matrix is a type of matrix that has only one column. The order of the column
matrix is represented by m x 1, thus the rows will have single elements, arranged in a way that
they represent a column of elements.
𝑣1
𝑣2
𝑣3
Eg:V =
.
.
(𝑣𝑛 )
𝑢1
𝑢2
𝑢3
Let U = , UT = (𝒖𝟏 𝒖𝟐 𝒖𝟑 … … . 𝒖𝒏)
.
.
(𝑢𝑛 )
The inner product of these two matrices is given as
6
Page
If the scalar product of the two vectors is zero then the two vectors are orthogonal and the
property is called orthogonality.
+∞
< 1 | 2> = ∫−∞ 1*(x)2(x)𝒅𝒙 = 0
If the scalar product of a vector with itself is unity then then it is said to be normalized and
the property is called Normalization.
+∞
< 1 | 1> = ∫−∞ 1*(x)1(x)𝒅𝒙 = 1
A set of vectors is called orthonormal when every vector is normalized to 1 and for every 2
different vectors their inner product is 0.
Quantum Gates: Quantum Gates are similar to classical gates, but do not have a degenerate
output. i.e. their original input state can be derived from their output state, uniquely. They
must be reversible.
There are quantum gates like single qubit, multi qubit quantum gates.
Single Qubit Quantum gates : Quantum Not Gate, Pauli – X, Y and Z Gates, Hadamard Gate,
Phase Gate (or S Gate), T Gate.
Quantum NOT gate : It transforms the |0> to |1> and |1> to |0>.
Incase of superposition state α|0>+β|1> to α|1>+β|0>, the roles of ∣0⟩ and ∣1⟩ are
interchanged.
0 1
In the Matrix form the NOT gate represented as X = ( )
1 0
α
In the vector notation if α|0>+β|1> is written as (β) , output from the quantum NOT gate is
α 0 1 α β
X(β) = ( ) (β) = ( )
7
1 0 α
Page
= α|1>+β|0>
α|0>+β|1>
X α|1>+β|0>
Truth Table:
Input Output
|0> |1>
|1> |0>
α|0>+β|1> α|1>+β|0>
Pauli’s X – Gate : This is similar to NOT gate.
0 1
The gate is defined as X =( )
1 0
It changes the |0> to |1> and |1> to |0> which acts as a NOT gate.
X|0> = |1> and X |1> = |0> or
0 1 1 0 0 1 0 1
( ) ( ) =( ) , ( ) ( ) =( )
1 0 0 1 1 0 1 0
The state α|0>+β|1> is transformed to α|1>+β|0>
Input Output
|0> |1>
|1> |0>
α|0>+β|1> α|1>+β|0>
Pauli’s Y – Gate :
0 −𝑖
The gate is defined as Y =( )
𝑖 0
1 0 0 −𝑖
It changes the ( ) to ( ) and ( ) to ( )
0 𝑖 1 0
0 −𝑖
Y|0> = ( ) and Y |1> = ( ) or
𝑖 0
8
0 1 1 0 0 1 0 −𝑖
Page
( ) ( ) =( ), ( ) ( ) =( )
1 0 0 𝑖 1 0 1 0
Dr. Krishna Reddy B V SVCE, Bangalore – 57.
Applied Physics for CSE Stream Principles of Quantum Information and Quantum Computing
Pauli’s – Z gate :
1 0
The gate is defined as Z =( )
0 −1
1 0 0
It unchanges the ( ) and ( ) changes to ( )
0 1 −1
Z|0> = |0> and Z|1> = -|1>
1 0
Z|0> = ( ) and Z|1> = ( ) or
0 −1
1 0 1 1 1 0 0 0
( ) ( ) =( ) , ( ) ( ) =( )
0 −1 0 0 0 −1 1 −1
The state α|0>+β|1> is transformed to α|0> - β|1>.
Truth Table:
Input Output
|0> |0>|1>
|1> -|1>
α|0>+β|1> α|0> - β|1>
Hadamard Gate :
Simplest gate involves one qubit and also known as a square-root of NOT gate. Used
to put qubits into superposition.
9
Page
1 1 1
𝐻= ( )
√2 1 −1
(|0>+|1>) (|0>-|1>)
It transforms |0> to = and |1> to
√2 √2
α+β
H
1
α|0>+β|1> ( )
√2 α-β
Truth Table:
Input Output
|0> (|0>+|1>)
√2
1>
|1> (|0>-|1>)
√2
α|0>+β|1> 1 α+β
( )
√2 α-β
H H
State State State
|0> |0> + |1> |1>
H = (X+Z)/√2 is the relation between Hadamard gate and Pauli Gates.
Phase Gate(S-gate):
1 0
It is represented as ( ).
0 𝑖
When it is operated on |0> the output is |0> only.
1 0 1 0 1 1
10
( ) |0> = ( ) ( ) = ( ) = |0>
0 𝑖 0 𝑖 0 0
Page
Truth Table:
α|0>+β|1>
S α|0> +iβ|1>
Input Output
|0> |0>|1>
|1> i|1>
α|0>+β|1> α|0>+iβ|1>
T – Gate:
1 0
It is represented as T = ( (𝑖𝜋/4) ).
0 𝑒
𝜋
Also called as 𝑔𝑎𝑡𝑒 𝑎𝑠 𝑖𝑡 𝑐𝑎𝑛 𝑏𝑒 𝑒𝑥𝑝𝑟𝑒𝑠𝑠𝑠𝑒𝑑 𝑎𝑠
8
exp(-𝑖𝜋/8) 0
T = exp(𝑖𝜋/8) ( )
0 exp(𝑖𝜋/8)
When it is operated on |0> the output is |0> only.
1 0 1 0 1 1
( (𝑖𝜋/4) )|0> =( (𝑖𝜋/4) ) ( ) = ( ) = |0>
0 𝑒 0 𝑒 0 0
When it is operated on |1> the output is exp(𝑖𝜋/4)|1>.
1 0 1 0 0 0
( (𝑖𝜋/4) )|1> =( (𝑖𝜋/4) ) ( ) = ( (𝑖𝜋/4) ) = 𝑒 (𝑖𝜋/4)|1>
0 𝑒 0 𝑒 1 𝑒
When it is operated on α|0>+β|1> the output is
1 0 1 0 α α (𝑖𝜋/4)
(
0 𝑒 (𝑖𝜋/4) )α|0>+β|1> = (
0 𝑒 (𝑖𝜋/4) ) ( β ) = ( 𝑒 (𝑖𝜋/4)
β) = α|0>+𝑒 β|1>
α|0>+β|1>
T α|0>+𝑒 (𝑖𝜋/4)β|1>
11
Page
Truth Table:
Input Output
|0> |0>|1>
|1> exp(𝑖𝜋/4)|1>
α|0>+β|1> α|0>+𝑒 (𝑖𝜋/4)β|1>
Controlled Gate: The gate which has two input qubits namely control and target.
If the control qubit is 0, then the target qubit is not altered.
If the control qubit is 1, then the target qubit is transformed.
The control qubit remains unaltered in both the cases.
Control |0> |0>
Truth Table:
Input Output
|00> |00>
|01> |01>
|10> |11>
|11> |10>
1 0 0 0
0 1 0 0
Matrix form : ( )
0 0 0 1
0 0 1 0
Controlled Not gate : This is similar to Controlled gate . A gate which operates on two
qubits.
12
Page
The CN gate has a similar behavior to the XOR gate with some extra information to make it
reversible.
Control |0> |0>
Truth Table:
Input Output
|00> |00>
|01> |01>
|10> |11>
|11> |10>
The action of C NOT gate can be written as
1 0 0 0 |00> |00>
0 1 0 0 |01> |01>
( ) =
0 0 0 1 |10> |11>
0 0 1 0 ( |11> ) ( |10> )
Swap Gate : simple quantum circuit containing three quantum gates. It is read from left to
right. It swaps the inputs and gives as output.
0 0 0 1
Page
Controlled Z gate : another example of controlled gate. If ‘A’ is true then do ‘B’.
In matrix form
1 0 0 0
UZ=(
0 1 0 0
) Z
0 0 1 0
0 0 0 −1
Truth Table:
Input Output
|00> |00>
|01> |01>
|10> |10>
|11> -|11>
Toffoli Gate : it is a reversible gate, having three inputs (a,b,c) and three outputs (a’,b’,c’). In
the inputs first two bits(a,b) are control bits. Third bit (c) is target bit. ‘C’ is inverted when
both ‘a’ and ‘b’ are 1 otherwise unaffected.
a a
b b
Truth Table :
c c
a b c a’ b’ c’
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
14
Page
15
Page