Unit IV Quantum Computing
Unit IV Quantum Computing
Stern-Gerlach Experiment:
Principle:
An electron revolving around a nucleus results in orbital magnetic moment (ml) and the spin
of an electron results in spin magnetic moment (ms). An atom with an unpaired electron, behaves like
a bar magnet. When a bar magnet is placed in an inhomogeneous magnet field, it experiences a
resultant force. The magnitude and direction of the resultant force depend on the orientation of the axis
of the bar magnet relative to the magnetic field. This force causes deflection of the bar magnet.
A silver atom is a monovalent element and it has an unpaired electron in 5s orbital. This
unpaired electron results in spin magnetic moment of the atom. Therefore, a silver atom behaves like
a bar magnet. The spin magnetic moment of an electron can have only two possible orientations in an
external magnetic field – one with spin up and the other one with spin down, with respect to the
magnetic field. When the silver atoms are passed through an inhomogeneous magnetic field, if the
atoms with spin up electrons are deflected upwards, the atoms with spin down electrons are deflected
downwards by the inhomogeneous magnetic field.
Construction:
In Stern-Gerlach experiment, silver atoms are produced by heating silver in a small electric
oven. An inhomogeneous magnetic field is produced by having a knife edged and a cylindrically
grooved magnetic poles as shown in the figure. The intensity of magnetic field is greatest at the knife
edge and decreases towards the cylindrical pole. The silver atoms are passed through a series of slits
to make a thin beam of atoms. Then, they are passed through the inhomogeneous magnetic field. Trace
of the silver atoms is recorded on a photographic film. The entire set up is enclosed in a vacuum
chamber to avoid collision of silver atoms with air molecules.
S
In the absence of magnetic field, the trace of the silver atoms on the photographic film is a
horizontal straight line. In the presence of the inhomogeneous magnetic field the silver atom beam
splits into two components and the trace is as shown in the figure.
The angular momentum J of silver atoms is entirely due to spin of its valence electron. The
spin angular momentum is given by
ℎ
𝑆 = √𝑠(𝑠 + 1)
2𝜋
Where, s = ½.
The number of orientations of the angular momentum with respect to an external magnetic field
is given by (2s+1) = [2(1/2) +1] = 2. Therefore, the spin magnetic moment can have only two
orientations with respect to the magnetic field.
𝑑𝐵
Suppose, the magnetic field is inhomogeneous along Y-direction. The field gradient is . Let the
𝑑𝑦
atomic magnet with magnetic moment M, pole strength p and length l inclined at an angle θ with the
field direction is placed in such a field as shown in the figure. If the field strength at one pole is B then
𝑑𝐵
the field strength at the other pole is 𝐵 + 𝑑𝑦 𝑙𝑐𝑜𝑠𝜃. Force on one pole of the atomic magnet is pB and
𝑑𝐵 𝑑𝐵
on the other pole is 𝑝 (𝐵 + 𝑑𝑦 𝑙𝑐𝑜𝑠𝜃). The extra force 𝑝 (𝑑𝑦 𝑙𝑐𝑜𝑠𝜃) on one pole displaces the atom
𝑑𝐵 𝑑𝐵
𝐹𝑦 = 𝑝. 𝑙 𝑐𝑜𝑠𝜃 ( ) = 𝑀 𝑐𝑜𝑠𝜃 ( ).
𝑑𝑦 𝑑𝑦
Due to this force, the atomic magnet will be displaced from its straight path in the field
direction. The splitting of silver atom beam into two components in an inhomogeneous magnetic field
verifies the existence of some silver atoms with spin up electrons and some silver atoms with spin
down electrons.
Polarization of Light:
Light wave: Light wave is a transverse electromagnetic wave. A light wave consists of electric and
magnetic fields vibrating perpendicular to each other and to the direction of propagation. It is the
electric vector which is more effective in a light wave. Therefore, the plane in which the electric vector
oscillates is important.
Unpolarised light: A light wave which has its electric vector oscillating in all possible directions
perpendicular to the direction of propagation of light is called an unpolarised light.
Polarised light: A light wave which has its electric vector oscillating geometrically restricted is called
an unpolarised light.
Linearly polarised light: A light wave whose electric vector is restricted to a plane perpendicular to
the direction of propagation of light is called a linearly polarised light or plane polarised light.
Circularly polarised light: A light wave whose tip of electric vector traces a circle perpendicular to
the direction of propagation is called a circularly polarised light.
Elliptically polarised light: A light wave whose tip of electric vector traces an ellipse perpendicular
to the direction of propagation is called an elliptically polarised light.
A plane polarised light can be converted into either a circularly or an elliptically polarised light by
suitable methods.
Production of plane polarised light: Plane polarised light can be produced by,
(i) Reflection
(ii) Refraction
(iii) Scattering
(iv) Selective absorption
(v) Double refraction
Polariser: A polariser is an optical device that transforms unpolarised light into polarised light.
Analyser: An analyser is an optical device which is used to identify the plane of vibration of a polarised
light.
Half wave plate: A half wave plate is a thin birefringent crystal of right thickness that introduces a
𝜆
path difference of between two orthogonal electric vibrations one making 0° and the other one
2
making 90° with the optic axis of the half wave plate.
Quarter wave plate: A quarter wave plate is a thin birefringent crystal of right thickness that
𝜆
introduces a path difference of between two orthogonal electric vibrations one making 0° and the
4
Direction of
Unpolarised light Polarised light propagation
Polariser
Clockwise rotation
of analyser
Detector
Plane polarised
light
Analyser
An analyser is introduced in the path of light as shown in Fig.2. The analyser is rotated through
one full circle either clockwise or anticlockwise. If the intensity of transmitted light is zero twice, then
the light is plane polarised.
θ = 45°
θ
Clockwise rotation
of analyser
Detector
Circularly
polarised light
Analyser
QWP
An analyser is introduced in the path of light as shown in Fig.4. The quarter wave plate (QWP)
converts light into plane polarised light if it is circularly polarised. The analyser is rotated through one
full circle either clockwise or anticlockwise. If the intensity of transmitted light is zero twice, then the
light is circularly polarised.
θ θ ≠ 45°
Clockwise rotation
of analyser
Ellipticallyly Detector
polarised light
Analyser
QWP
A quarter wave plate and an analyser are introduced in the path of light as shown in Fig.6. The
quarter wave plate (QWP) converts light into a plane polarised light if it is elliptically polarised. The
analyser is rotated through one full circle either clockwise or anticlockwise. If the intensity of
transmitted light is zero twice, then the light is elliptically polarised.
Classical Computing:
The principles of classical physics and mathematical reasoning form the foundation of classical
computing.
Traditional computer software is designed for serial computation. It indicates that one task must be
finished before starting another.
Parallel computing is possible on a computer with multiple processors. It means it can work on multiple
tasks at the same time, and the results should be integrated.
Moore’s Law:
Moore’s law is not a natural law. It is an observation did by Gordon G. Moore.
It states that the number of transistors on a computer chip and, thus its power doubles every 2
years.
Computer hardware is getting smaller, cheaper and faster. This has been possible because of the
miniaturization in ICs (integrated circuits). It means the spacing between the transistors and other
components keeps on decreasing.
Is Moore’s law still holding?
Although Moore’s law trend continued for more than 50 years, the transistor counts doubled after 3
years, not 24 months.
Quantum computing:
A quantum computer is a machine that performs calculations based on the laws of quantum
mechanics, which is the behaviour of particles at the sub-atomic level.
The fundamental concept of classical computation and information is a “bit”. The data is stored in a
bit. The bit can take the value 0 or 1.
The corresponding parameter in a quantum computer is a quantum bit or qubit.
V
Single Photon
H Detector B
Beam splitter
Fig. (a)
Now experimental set up is changed as shown in Fig. (b). A single photon may travel
horizontally, gets deflected by a mirror, and reaches the detector. Another possibility is that it passes
vertically, gets deflected by a mirror, and reaches the detector. Hence if the photon really takes a single
path through the apparatus, both detectors would detect it with equal probabilities. However, this does
not happen. The photon always strikes detector A and never detector B. If we change the path length
by introducing a glass plate in one of the paths (say vertical one), the photon is detected by detector B
and never by detector A. It means that the photon was in a superposition state, and it travelled through
both paths simultaneously. At the second beam splitter, both the components interfered, constructively
or destructively, and get detected by one of the detectors.
Detector
Mirror B
Beam
splitter
Fig. (b)
Difference between classical computing and quantum computing:
Information storage and manipulation are Information storage and manipulation are
based on “bit”, which is based on voltage based on Quantum Bit or “qubit”, which is
or charge; low is 0 and high is 1. based on the spin of an electron or
polarization of a single photon.
Conventional computing uses binary codes Quantum computing uses Qubits i.e. |0>,
i.e. bits 0 or 1 to represent information. |1> and the superposition state of both |0>
and |1> to represent information.
Quantum Superposition
A qubit, like a bit, also makes use of two states |0⟩ and |1⟩ to hold information.
1 0
|0> = [ ]; |1> = [ ]
0 1
However, unlike classical bits, a qubit, |Ψ> can also be in a superposition state of |0> and |1> states.
where α and β are generally complex numbers which represent the probability amplitudes of the states.
Summation of probabilities
The probability of measuring the qubit in state |0> is |α|2, and the probability of measuring the qubit in
state |1> is |β|2.
Since the total probability of observing all the states of the quantum system must add up to 100%, the
amplitudes must follow this rule:
|α|2 +|β|2 =1
In a classical computer, the 0- and 1-bit mathematically represent the two allowed voltages
across a wire in a classical circuit. Semiconductor devices called transistors are used to control what
happens to these voltages.
➢ Energy levels of an atom: Consider the electron in a hydrogen atom. It can be in its ground
state (i.e. an s orbital) or in an excited state. So we can also store a qubit of information in the
quantum state of the electron, i.e., in the superposition.
Ground state |0>
Excited state |1>
➢ Spin: Elementary particles like electrons and protons carry an intrinsic angular momentum
called spin. Their spins can be used as qubits with |0 >= | ↑>, |1 >= | ↓>
➢ Polarization of Photon: A linearly polarized photon can be either horizontally or vertically
polarized with respect to some direction in which the photon is moving. Quantum researchers
can create photons one at a time and encode qubits of information into their polarization.
Bloch sphere is a physical representation of all possible qubit states. It is a sphere of unit radius
and the state of a qubit can be represented by a vector in this sphere. |0> is at the north pole, |1> is at
the south pole, as shown in Figure.
Using the spherical coordinate system, an arbitrary position of the state vector of a qubit can be written
in terms of the angles θ (elevation, the state vector makes from the z-axis) and ϕ (azimuth, the angle
of projection of the state vector in the x-y plane from the x-axis) it makes in the Bloch sphere as:
𝜃
𝜃 𝜃 cos ( )
|𝜓 > = cos ( ) |0 > + 𝑒 𝑖𝜙 sin ( ) |1 > = [ 2 ]
2 2 𝜃
𝑒 𝑖𝜙 sin ( )
2
Note:
For a classical computer, the two logical states 0 and 1 are represented by the poles of a sphere.
In contrast, the state of a qubit can be represented by any point on the sphere. Since there are infinite
points on the sphere, a qubit in principle has more capacity to store information compared to a classical
bit.
Note: Bloch sphere represents the state of only one qubit. There is no generalization of the Bloch
sphere for multiple qubits.
A fundamental difference between classical bits and qubits is the way they operate.
Reading a classical bit does not destroy its state. A bit retains its state as long as it is powered.
The qubits are probabilistic.
They are in a superposition state of |0> and |1> with different probabilities.
They possess characteristics of both states simultaneously, at all times, until measured.
The qubits lose their internal state when they are measured.
According to Paul Dirac, the state of a system is described by a vector, called a state vector, in Hilbert
space ℋ. Depending on the degree of freedom (i.e. the type of state) of the system being considered,
ℋ may have infinite-dimensional.
[Hilbert space 𝓗: It is a complex vector space. It has all the properties of linear vector space like
vector addition and scalar multiplication. In addition, it satisfies inner product operation.
An inner product is a generalization of the dot product It is a method of multiplying vectors together
in a vector space, with the result being a scalar.]
If 𝜓 is a wavefunction, then in Dirac notation 𝜓 is represented as | 𝜓 >, which is called a ket vector.
Example: Suppose 𝜓 = 𝐴 𝑒 −𝑖 𝑘 𝑥
Note: Only the notation of 𝜓 is changed. The form of the wave function remains unchanged.
If 𝜓* is the complex conjugate of 𝜓, then 𝜓* is represented as < 𝜓|, which is called a bra vector
Hence,
< 𝜓| = 𝐴∗ 𝑒 𝑖 𝑘 𝑥
Basis: In quantum mechanics, the “basis vectors” can be thought of as a set of mutually perpendicular
vectors, one for each “dimension” of the space in which the state vector is expressed. The magnitude
of a basis vector is one. There is a one-to-one correspondence between basis vectors and dimensions
of the space.
The state vector |𝜓 > can be written as a linear combination of kets | 𝜙1 > , |𝜙2 >, | 𝜙3 > ⋯ etc
as follows:
Where the coefficients a1, a2, a3…. an, represent the projection of |𝜓 > onto | 𝜙𝑛 > . 𝑎𝑛 is the
component of |𝜓 > along the vector | 𝜙𝑛 > .
𝑎1
𝑎2
𝑎
|𝜓 > → .3
.
[𝑎 𝑛 ]
[A column matrix is a matrix having all its elements in a single column. The elements are arranged
in a vertical manner. The order of a column matrix having n elements is n x 1]
The bra vector < 𝜓| can be represented by a row vector (row matrix) :
[A row matrix is a matrix having all its elements in a single row. The elements are arranged in a
horizontal manner. The order of a row matrix having n elements is 1 x n]
Remark:
Inner product:
If 𝜓 = 𝜓(𝑥) and 𝜙 = 𝜙(𝑥) are two wavefunctions, then their inner product can be defined as
(𝜓, 𝜙) = ∫ 𝜓 ∗ (𝑥) 𝜙(𝑥)𝑑𝑥
Since the inner product (scalar product) is a complex number in quantum mechanics,
For any state vector |𝜓 >, < 𝜓|𝜓 > is real and positive.
𝑎1
𝑎2
𝑎
= .3
.
[𝑎𝑛 ]
𝑏1
𝑏2
= 𝑏.3
.
[𝑏𝑛 ]
𝑏1
𝑏2
< 𝜓|𝜙 > = [ 𝑎1∗ 𝑎2∗ 𝑎3∗ … … . . 𝑎𝑛∗ ] 𝑏.3
.
[𝑏𝑛 ]
Two ket vectors | 𝜓 > and | 𝜙 >, are said to be orthogonal if their inner product is zero.
Two ket vectors | 𝜓 > and | 𝜙 >, are said to be orthonormal if they are orthogonal and if each of them
is normalized.
i.e. < 𝜓|𝜙 > = 0, < 𝜓|𝜓 > = 1, < 𝜙|𝜙 > = 1
Operator:
An operator 𝐴̂ is a mathematical rule that when applied to a ket vector | 𝜓 > transforms it to another
ket vector |𝜙 > of the same space and when it acts on a bra vector < 𝜓| transforms it to another bra
vector < 𝜙|.
Identity matrix(I):
An identity matrix is a square matrix in which all the elements of principal diagonals are one, and all
other elements are zeros. If any matrix is multiplied by the identity matrix, the result will be given a
matrix.
1 0
𝐼≡ [ ]
0 1
Example: The matrix form of ket vectors |0> and |1> can be written as:
1 0
|0> = [ ] and |1> = [ ] , then
0 1
1 0 1 1𝑥1 + 0𝑥0 1
I |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
Hermitian matrix:
A Hermitian matrix is a square matrix composed of complex numbers, and it is equal to its conjugate
transpose.
1 𝑖
Example: M = [ ]
−𝑖 1
1 𝑖
The conjugate transpose of the matrix is 𝑀𝐻 𝑜𝑟 𝑀† = [ ]
−𝑖 1
Here, M = 𝑀†
Unitary matrix:
Unitary Matrix is a square matrix of complex numbers. The product of the conjugate transpose of a
unitary matrix, with the unitary matrix itself, gives an identity matrix.
Example:
1 2 −2 + 𝑖
U=3 [ ]
2+𝑖 2
̅=1 [ 2
Taking conjugate 𝑈
−2 − 𝑖
]
3 2−𝑖 2
1 2 2−𝑖
𝑈† = [ ]
3 −2 − 𝑖 2
1 2 2−𝑖 1 2 −2 + 𝑖 1 0
∴ 𝑈†. 𝑈 = [ ] [ ]=[ ]=I
3 −2 − 𝑖 2 3 2+𝑖 2 0 1
1 0
Similarly, 𝑈. 𝑈 † = [ ]=I
0 1
Pauli matrices:
The Pauli matrices are a set of four 2x2 complex matrices. They are used to represent spin angular
momentum. These matrices are Hermitian and Unitary.
These matrices are very powerful in quantum computing as they can be used to represent quantum
logic gates. They can set the rotational parameters for qubits. These matrices go by a variety of
notations.
0 1 0 −𝑖
𝜎1 ≡ 𝜎𝑥 ≡ 𝑋 ≡ [ ] 𝜎2 ≡ 𝜎𝑦 ≡ 𝑌 ≡ [ ]
1 0 𝑖 0
1 0
𝜎3 ≡ 𝜎𝑧 ≡ 𝑍 ≡ [ ]
0 −1
Quantum Gates:
Classical computer circuits consist of wires and logic gates. The wires carry information around
the circuit, while the logic gates manipulate information, converting it from one to another. Classical
computers manipulate bits using classical logic gates, such as OR, AND, NOT, NAND, etc.
Similarly, quantum computers manipulate qubits using quantum gates which are usually represented
as unitary matrices. A gate which acts on k qubits is represented by a 2k X 2k unitary matrix. The
number of qubits in the input and output of the gate has to be equal. The action of the quantum gate is
found by multiplying the matrix representing the gate with the vector which represents the quantum
state.
Pauli-X gate
In classical computers, the NOT gate takes one input and reverses its value. For example, it changes
the 0 bit to a 1 bit or changes a 1 bit to a 0 bit. It is like a light switch flipping a light from ON to OFF,
or from OFF to ON.
Pauli-X gate is a quantum analogue of the classical NOT gate.
• The application of this gate rotates the qubit by 180o along the x-axis. It transforms |0⟩ to |1⟩
and vice versa.
• The matrix form of X-gate is obtained as follows
X = |0 > < 1| + |1 > < 0|
1
=[ ] [0 1] + [0] [1 0]
0 1
0 1 0 0
=[ ]+ [ ]
0 0 1 0
0 1
= [ ]
1 0
• Circuit representation
• Dirac notation
X |0⟩ = |1⟩
X |1⟩ = |0⟩
• When the qubit is in a superposition state |𝜓⟩ = 𝛼 |0⟩ + 𝛽 |1⟩ , then
X |𝜓⟩ = 𝛼 |1⟩ + 𝛽 |0⟩
𝛼
• In matrix form |𝜓⟩ = [𝛽 ]
𝛼 𝛽
X [𝛽]= [ ]
𝛼
Pauli -Y gate
• The application of this gate rotates the qubit by 180o along the y-axis.
• It transforms |0⟩ to 𝑖|1⟩ and |1⟩ to −𝑖 |0⟩.
• Matrix for of Y-gate
0 −𝑖
Y= [ ]
𝑖 0
• Circuit representation
• Dirac notation
Y |0⟩ = 𝑖 |1⟩
Y |1⟩ = −𝑖 |0⟩
Pauli - Z gate
• The application of this gate rotates the qubit by 180o along the z-axis.
• It leaves |0⟩ unchanged and flips the sign of |1⟩ to - |1⟩.
• Matrix for of Z-gate
1 0
Z =[ ]
0 −1
• Circuit representation
• Dirac notation
Z |0⟩ = |0⟩
Z |1⟩ = −|1⟩
Hadamard gate
• It is one of the most important gates for quantum computing. If the qubit starts in a definite |0⟩
or |1⟩ state, the Hadamard gate puts each into a superposition of |0⟩ and |1⟩ states.
1 1 1
• Matrix representation H ≡ [ ]
√2 1 −1
• Circuit representation
• Dirac notation
1
H |0⟩ = ( |0⟩ + |1⟩ )
√2
1
H |1⟩ = ( |0⟩ − |1⟩ )
√2
CNOT gate:
• Dirac notation
CNOT |00⟩ = |00⟩ ; CNOT |01⟩ = |01⟩
CNOT |10⟩ = |11⟩ ; CNOT |11⟩ = |10⟩
Quantum circuits:
A quantum circuit is required to carry out computations on a quantum computer. It consists of a series
of operations referred to as quantum gates. These quantum gates, which are assigned to certain qubits,
change the quantum states of some of the qubits, causing those qubits to perform the calculations
required to solve a problem.
(1)
|0>
|0> X
(2)
The states change from the start to the end after every gate:
1
The Hadamard gate changes |0> to ( |0⟩ + |1⟩ ).
√2
Therefore,
1 1
|00>→ (|0>+|1>) |0> → (|00>+|10>).
√2 √2
Case 1: |00>
The control qubit is |0>, so the target qubit remains unchanged.
Case 2: |10>
The control qubit is |1>, so the target qubit flips from |0> to |1>.
1
Hence the output is (|00>+|11>).
√2
The main advantage that a quantum computer has over a classical computer is parallelism. A
quantum computer can perform operations on all of the states simultaneously because qubits can be in
a superposition of states.
Hence, an n-bit classical system can be in one of the 2n possible states at a time, and all it needs is the
value of these n-bits to be fully recognized.
An n-qubit system can be in a superposition of all of those states 2n states at a given time and needs the
value of coefficients of all of the 2n-1 states (considering that summation is 1) basis to be fully
recognized.
Consequently, a quantum computer can compute with 2n values in a single step. This enormous
parallelism is one reason why quantum computers are so powerful