Linear Algebra of Quantum Mechanics and The Simulation of A Quantum Computer
Linear Algebra of Quantum Mechanics and The Simulation of A Quantum Computer
Linear Algebra of Quantum Mechanics and The Simulation of A Quantum Computer
1 Abstract
This Summer project is an introductory reading to the Mathematical Structures
that underlie Quantum Mechanics and then take it forward to a theoretical
introduction to Quantum Information and Quantum Computing. Quantum
Computers will bring about a paradigm shift in Cryptography and Scientific
Computing[1]. Keeping this in mind, learning Quantum Computing is of paramount
importance to help contribute to the field.
Once the basics of Quantum Computing are understood, we also attempt to
simulate a Quantum Computer on a Classical computer and making a Julia[2]
module for the same.
This paper serves as a Very Brief Introduction to Quantum Computing and
documentation of the code in the form while publishing.
2. Crystal Diffraction
1
3 Mathematical Quantum Mechanics: The Linear
Algebra of QM[3]
With the Schrödinger’s Equation,
h̄2 2
" #
∂Ψ(~r, t)
ιh̄ = − ∇ + V (x) Ψ(~r, t) (1)
∂t 2m
taken ad-hoc, we now begin to define Quantum Mechanics as the study of the solutions
∂
of the Schrodinger Wave Equation , which we’ll call states. Since the ∂t and the ∇2
operators are linear, the states of a system form a Vector Space F over the complex
numbers, with the trivial solution as the identity. Physically however, the trivial
solution is disregarded as it tells us that the particle doesn’t exist, and we can ignore
it. But we leave it in the set of solutions for a more generalised approach. To simplify
calculations, we can look at only the variable separable solutions. Hence,
h̄2 ∂ 2
" #
∂φ(t)
⇒ ιh̄ψ(x) = − + V (x) ψ(x)φ(t) (3)
∂t 2m ∂x2
ιh̄ ∂φ(t) h̄2 ∂ 2 ψ(x)
⇒ =− + V (x) (4)
φ(t) ∂t 2mψ(x) ∂x2
In (4), we see that the left side is dependant only on the time, and the right only on
space, hence both must be a constant. Focusing only on space dependency,
h̄2 ∂ 2 ψ(x)
− + V (x)ψ(x) = Eψ(x) (5)
2m ∂x2
which can be more compactly written as
Ĥψ = Eψ (6)
The above equation is an eigenvalue equation which can be solved analytically for
some contrived potentials, and computationally for more complex potentials.[5]
Since the integral form of the equation runs over all space, we need to look at
solutions that go to zero at infinity. Of course, “a good mathematician can supply
one with pathological counterexamples, but they do not arise in Physics; for us, the
wave function always goes to zero at infinity.”[4] The advantage of studying this
equation becomes clear when we show that the solutions of this equation form a basis
of F . This analysis is, however, not necessary for any further insight. Some bases
may not themselves exist in F , but are useful as a tool to visualise the states.
With the mathematical basis set for further analysis, we explore certain bases
such as
1. Plane Waves
2
3.1 Bras and Kets
We can now redefine the Dirac Notation with the kets (|ψi) being the state vectors
and the bras (hφ|) denoting the dual of the kets over an inner product. The inner
product is defined as (|ψ1 i, |ψ2 i) = hψ1 |ψ2 i = d r ψ1∗ (r) ψ2 (r) which is a complex
R 3
number.
3.2 Operators
We also define an operator as a transformation over kets and give the Dirac
notation as |ψ1 ihψ2 |. Clearly, from the Dirac notation, an operator left multiplied,
takes one ket to another ket. It can also be shown that a right multiplication of an
operator to a bra gives rise to another bra. Hence we can define a new linear
functional hφ|(A|ψi) = (hφ|A|)ψi = hφ|A|ψi Hence we can also define A† as the
hermition conjugate of A as (A|ψi)† = |Aψi† = hAψ| = hψ|A†
We also study certain operators such as
1. Projectors
1. | ~r i
2. | p~ i
3
4 Quantum Computing[1]
After a brief introduction to the concept of computing, we begin the study of
Quantum Computing.
1. NOT Gate (0 → 1; 1 → 0)
2. Hadamard Gate (0 → +; 1 → −)
4
3. Z Gate (0 → 0; 1 → −1)
These states are exciting, as measuring one Qubit will give the state of the other
immediately with certainty. This property gives rise to the paradox of whether
separating the bits leads to an infinitely fast transfer of information. However, this
is not the case, and Special Relativity is NOT violated as the measurement gives
Classical information which can travel only at (or slower than) the speed of light.
We can exploit this to “Teleport” quantum information from A to B. We invite
over Alice and Bob to demonstrate this. Suppose Alice and Bob had an EPR couple
and are now physically separated from each other. Suppose Alice needs to send a
Qubit in |ψi state to Bob. She can perform a series of manipulations to the data bit
and her EPR, such that Bob’s EPR becomes a slight variation of the data bit. Once
Alice measures her bits, she can share this information with Bob, and he can perform
another set of operation on his EPR to get back the data bit. This procedure seems
to offer the same paradox as above, but once Alice measures her bits, the information
must travel to Bob over a Classical channel only, and it is bound by the speed limit
of the universe.
5
CAN simulate a Qubit by “measuring” it with the probability of its coefficients. We
make use of pseudo-random generators for this.
First, as all good programs should be, we modularise our program into two
modules.
3. A Module can be added which will add GUI representations of Gates and the
user will be able to make a Quantum Circuit without knowing the language.
Julia[2] was used due to its efficiency in Scientific Computing and Matrix
Manipulation and ease of writing code.
5.1 QuantumAlgebra.jl
As we saw, Quantum Mechanics can be very elegantly studied as a Vector Space
with defined Bases, Inner Products, Tensor Products and Transformations
(Operators). To simulate a Quantum Computer, we must first define our Linear
Algebra in the Hilbert space. Though not necessary, we make a Julia Module called
Quantum Algebra, which handles a generalised Quantum Mechanic algebra of Bras,
Kets, Operators and Bases. Then, QuantumComputing.jl a specific case of
QuantumAlgebra.jl
6
5.1.3 Ket struct
We define a Ket struct which is composed of coefficients::Array{Number, 1} and
basis::Basis. There are two constructors, Ket(coefficients::Array{Number, 2},
basis::Basis) and Ket(coefficients::Array{Number, 2}) which defaults to the Identity
Basis. coefficients is a Column vector which is the Matrix representation of the Ket
in the given (or assumed) basis. Note - Ket is created in normalised state.
5.2 QuantumComputing.jl
The final wrapper module which is the most used module by the User.
7
5.2.1 Qubit struct
A Qubit is simply a wrapper around Ket which allows only 2 dimensional Kets
and 2 × 2 Bases. Constructor is of the form Qubit(ψ::Array{Number,1}, basis::Basis
) and falls back to Identity Basis if basis not provided. It throws IncorrectSizeError
if length of ψ is not 2.
8
5.2.5 Predefined Bases
• Computational Basis (comp basis)
References
[1] Michael A. Nielsen and Isaac L. Chuang. Quantum Computation and Quantum
Information. 10th Anniversary. Cambridge University Press, 2010.
[2] J. Bezanson et al. “Julia: A Fresh Approach to Numerical Computing”. In: SIAM
Review 59.1 (2017), pp. 65–98. doi: 10.1137/141000671. eprint: https://doi.
org/10.1137/141000671. url: https://doi.org/10.1137/141000671.
[3] Claude Cohen-Tannoudji, Bernard Diu, and Frank Laloë. Quantum Mechanics.
2nd ed. Vol. 1. Wiley-Interscience, 1977.
[4] D.J. Griffiths. Footnote 12, Introduction to Quantum Mechanics. Pearson
international edition. Pearson Prentice Hall, 2005. isbn: 9780131118928. url:
https://books.google.co.in/books?id=z4fwAAAAMAAJ.
[5] H. Korsch and M Glück. “Computing quantum eigenvalues made easy”. In:
European Journal of Physics 23 (July 2002), p. 413. doi:
10.1088/0143-0807/23/4/305.
[6] Richard P. Feynman, Robert B. Leighton, and Matthew Sands. The Feynman
Lectures On Physics. New Millenium. Vol. 3. Basic Books, 2011.