Skip to content

Commit aa46300

Browse files
committed
Revise Some Text
1 parent 5fd3b72 commit aa46300

File tree

3 files changed

+38
-57
lines changed

3 files changed

+38
-57
lines changed

Report/main.tex

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ \subsection{Creating Controlled Unitary Gates}
7979
\subsection{Source Code}
8080

8181
\emph{QuSim.py | Main Simulator}
82-
%\lstinputlisting[language=Python]{../Code/Simulator/QuSim.py}
82+
\lstinputlisting[language=Python]{../Code/Simulator/QuSim.py}
8383

8484
\newpage
8585
\printbibliography

Report/sections/introduction.tex

+29-48
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,22 @@
33
\begin{document}
44

55

6-
Here I will give a brief overview of the mathematics necessary to follow
7-
the workings / implementation of the Simulator, and also to refresh
8-
slightly on the notation and concepts of what will be used throughout
9-
this paper.\\
10-
A working knowledge of linear algebra, matrix operations (\emph{i.e.
11-
multiplication, transpose, trace and tensor products}) among others,
12-
along with a basic idea of some Quantum Mechanics / Quantum
13-
Informational Theory and the workings of Classical Computers, is helpful
14-
but not 100\% necessary. I will try and keep away from the extreme
15-
specifics, and the reasons behind everything, to the best of my
16-
abilities, although some detail is needed in order to portray the ideas
17-
behind this. If you are interested in learning more, the book
6+
Here I will give a brief overview of the whats necessary to follow
7+
the workings / implementation of the Simulator and then the programming language, and also to look over the notation and concepts that will be used throughout this paper.\\
8+
A familiarity with some linear algebra
9+
along with a basic idea of some Quantum Mechanics and the workings of Classical Computers, is helpful
10+
but not 100\% necessary. \\
11+
If you are interested in learning more about Quantum Computing, the book
1812
``\emph{Quantum Computing for Computer Scientists}'' \cite{quantumcomputerscience} is very good.
1913

2014
\subsection{The Qubit}
2115

2216
In classical computing, the bit (short for binary unit) is the smallest
2317
data unit. It has a \emph{Single binary value, that can be either
2418
\texttt{0} or \texttt{1}}.\\
25-
The \emph{qubit} would be the Quantum version of the classical bit.
19+
The \emph{qubit} is the Quantum analog of the classical bit.
2620
However, unlike a classical bit, it can take a superposition, meaning
27-
that it is possible for a qubit to be in a linear combination of
21+
that it is possible for a qubit to be in a combination of
2822
states.\\
2923
In this paper, the choice of basis states (\(Z\)) are as follows:
3024
\begin{equation}
@@ -43,36 +37,29 @@ \subsection{The Qubit}
4337
superposition. A single qubit superposition would look like this:\\
4438
\[
4539
\left\lvert \Psi \rangle =\alpha\lvert0\rangle +\beta\right\lvert 1\rangle\]\\
46-
The coefficients - \(\alpha\) and \(\beta\) are complex numbers.
40+
The coefficients, \(\alpha\) and \(\beta\) can be complex numbers.
4741

4842
Because this state is a superposition, fundamentally you cannot get
49-
access to the amplitudes of the base vectors \(\alpha\) and \(\beta\).
43+
access to the amplitudes of \(\alpha\) and \(\beta\).
5044
Instead, you will either get \(\lvert0\rangle\) or \(\lvert1\rangle\), with the
5145
probability of getting \(\lvert0\rangle\) being \(\lvert\alpha\lvert^2\), and the
5246
probability of getting \(\lvert1\rangle\) being \(\lvert\beta\lvert^2\).\\
5347
Also, if you add the probabilities, you will always get \(1\), which is
54-
the normalization.\\
48+
the normalization principle.\\
5549
\begin{equation}
5650
\lvert\alpha\lvert^2 + \lvert\beta\lvert^2 = 1
5751
\end{equation}
5852

5953
If an operation is being performed on a qubit with multiple states, the
6054
operation is performed on all of the states at the same time. However,
6155
when observed, the qubit will collapse into either \(0\) or \(1\),
62-
stochastically, based on the probability of each of the basic states.\\
63-
This property can be realised by using partical spin, among others, but
64-
I will not get into that as this project is on a practical
56+
based on the probability of each of the basic states.\\
57+
A Qubit can be created by using partical spin, among other methods, but
58+
I will not get into that as this project is not about the practical
6559
implementation of a quantum computer.\\
66-
Richard Feynman (a theoretical physicist known for his contribution to
67-
quantum mechanics) suggested that a qubit,
68-
\(\alpha\lvert0\rangle + \beta\lvert1\rangle\), occupies all possible states
69-
between \(0\) and \(1\), thereby making it possible to encode an
70-
infinite amount of data. Although, when observed, collapses into a state
71-
of 0 or 1, thus making the data held in the superpositions useless. This
72-
is why \emph{Quantum Algorithms} are used to exploit this trait.
7360

7461
Just like a classical computer, while it is possible to have a single
75-
qubit quantum computer, it's not going to be much use. To use the power
62+
qubit quantum computer, it's not going to be of much use. To use the power
7663
of quantum computing you need to have more then 1 qubit.\\
7764
To define more then 1 qubit, you use a \emph{register}. For example, if
7865
you wanted to put the value \texttt{11010} Onto 5 qubits, you set the
@@ -82,10 +69,8 @@ \subsection{The Qubit}
8269
which is equal to:\\
8370
\[
8471
\lvert11010\rangle = \lvert1\rangle \otimes \lvert1\rangle \otimes \lvert0\rangle \otimes \lvert1\rangle \otimes \lvert0\rangle\]\\
85-
where \(\otimes\) is the tensor product.\\
86-
A Quantum Register is just a number of qubits, tensored together.\\
87-
An \emph{n-bit} Quantum Register can hold any number of \emph{n-qubit}
88-
states / superpositions.
72+
where \(\otimes\) is the kronecker product.\\
73+
An n-Qubit Quantum Register can be described as just the kronecker product of n-Qubits\\
8974

9075
\subsection{Quantum Logic Gates}
9176

@@ -102,7 +87,7 @@ \subsection{Quantum Logic Gates}
10287
A unitary matrix is defined so that:
10388

10489
\begin{quote}
105-
A Complex, Square Matrix, \textbf{U} is unitary if its complex conjugate
90+
A Complex, Square Matrix, \textbf{U}, is unitary if its complex conjugate
10691
(U*) is also its inverse
10792
\end{quote}
10893

@@ -136,7 +121,7 @@ \subsubsection{The NOT Gate / Pauli-X Gate}
136121

137122
\subsubsection{Pauli-Y Gate}
138123

139-
This gate acts on a single qubit, and works out to a rotation around a
124+
This gate acts on a single qubit, and works as a rotation around a
140125
Bloch Sphere on the \(y\) axis by \(\pi\) radians.\\
141126
It maps the basic states as follows:\\
142127
\[
@@ -224,7 +209,7 @@ \subsubsection{Multi Qubit Gates}
224209
quantum computer.\\
225210
In short, the complex vector space for a 5 qubit system has a dimension
226211
equal to \(2^5\) or \(32\). Now if you look at, for example, a 64 qubit
227-
system, you get \(2^64 = 18446744073709551616\), or just under eighteen
212+
system, you get \(2^{64} = 18446744073709551616\), or just under eighteen
228213
and a half quintillion. As you can probably see, in an \(n\)th qubit
229214
system, you need \(2^n\) numbers to represent its state. This growth is
230215
exponential, and if you had a \(300\) qubit system, you would need more
@@ -236,12 +221,11 @@ \subsubsection{Multi Qubit Gates}
236221
or for 3 qubits:\\
237222
\[
238223
\{\lvert000\rangle, \lvert001\rangle, \lvert010\rangle, \lvert011\rangle, \lvert100\rangle, \lvert101\rangle, \lvert110\rangle, \lvert111\rangle,\}\]\\
239-
A Classical computer also needs \(2^n\) Numbers to define what position
240-
the bits are in, but this is much simpler then in Quantum Computing,
224+
A Classical computer needs \(2\) Numbers to define what position
225+
the bits are in, which is much simpler then in Quantum Computing,
241226
where you don't just have a single set state, but rather, due to
242-
Superpositions and Entanglement, the set at any point is very different.
243-
To describe the quantum state, you need \(2^n\) Complex Numbers. Now,
244-
onto some gates.
227+
Superpositions and Entanglement, the state at any point is very different.
228+
To describe the quantum state, you need \(2^n\) Complex Numbers.
245229

246230
\subsubsection{CNOT / Controlled Not Gate}
247231

@@ -258,24 +242,21 @@ \subsubsection{CNOT / Controlled Not Gate}
258242
\begin{equation}
259243
CNOT = \left[ \begin{matrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 \\ 0 & 0 & 1 & 0\end{matrix} \right]
260244
\end{equation}
245+
(Note: The equation above (12), shows a CNOT gate, acting on 2 qubits, with the 1st Qubit being the control, and the target being the 2nd Qubit.)
261246

262247
\subsubsection{T or Pi/8 Gate}
263248

264249
The reason that I have this gate included is because of a few things. So
265250
far, all of the gates we have gone through
266251
\(\{ X,Y,Z,H,S,S^\dagger, CNOT \}\), are all part of whats called a
267-
Clifford Group. Every gate in the Clifford group can be simulated pretty
268-
well on a classical computer (See the Gottesman-Knill Theorem \cite{gottesmanknill}),
269-
and therefore the Clifford group is not \emph{universal} (Basically that
252+
Clifford Group. The Clifford group is not \emph{universal} (Basically the the set of gate to which
270253
any possible operation on a quantum computer can be reduced to and
271-
preformed on, see
272-
\href{https://en.wikipedia.org/wiki/Quantum_gate\#Universal_quantum_gates}{Here}).
273-
To use the `Quantum Computer' (The simulator) properly, we will need to
274-
include another gate, thats not part of the Clifford Group. For this, we
254+
preformed on)
255+
To use the `Quantum Computer' (The simulator) properly, another gate will need to be implemented, thats not part of the Clifford Group. For this, I
275256
will use \(T\) and \(T^\dagger\).\\
276257
They can be represented with the matrices:\\
277258
\begin{equation}
278-
T = \left[ \begin{matrix} 1 & 0\\0 & e^\frac{i\pi}{4}\end{matrix} \right], T^\dagger = \left[ \begin{matrix} 1 & 0\\0 & e^-\frac{i\pi}{4}\end{matrix} \right]
259+
T = \left[ \begin{matrix} 1 & 0\\0 & e^\frac{i\pi}{4}\end{matrix} \right], T^\dagger = \left[ \begin{matrix} 1 & 0\\0 & e^{\frac{-i\pi}{4}}\end{matrix} \right]
279260
\end{equation}
280261

281262
The \(T\) Gate makes it possible to access all points on a Bloch

Report/sections/simulation.tex

+8-8
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22

33
\begin{document}
44
When thinking of simulating a Quantum Computer, there are a number of possible ways to implement it, depending on what you want from your simulator.
5-
Regardless of what method, it will always get exponentially slower as you add more qubits to simulate, as the number of amplitudes you need to store is \(2^n\).
6-
To get the most accurate simulation, you need to also simulate 'Decoherence', which is where the system will loose information by the outside environment, although the simulator detailed here is called an 'Ideal' Simulator, as it doesn't also simulate Decoherence.
5+
Regardless of what method, it will always get exponentially slower as you add more Qubits to simulate, as the number of amplitudes you need to store is \(2^n\).
6+
To get the most accurate simulation, you need to also simulate 'Decoherence', which is where the system will loose information due to measurements by the outside environment, although the simulator detailed here is called an 'Ideal' Simulator, as it doesn't also simulate Decoherence.
77
In this project, the simulator will be built upon vector-matrix opperations.
88

99
\subsection{Quantum Register}
10-
To first start the simulator, you have to have a new quantum register object. When a new Quantum Register is created, it creates a new \(2^n\) dimensional vector of zero, and then it sets the first 0 to 1. This is the same as representing an n qubit state, and setting all n qubits to the state \(\lvert0\rangle\). Remember:
10+
When you start the simulator, you have to have a new Quantum Register. When a new Quantum Register is created, it creates a new \(2^n\) dimensional vector of zero, and then it sets the first 0 to 1. This is the same as representing an n Qubit state, and setting all n Qubits to the state \(\lvert0\rangle\). Remember:
1111

1212
$$
1313
\lvert q_1 q_2...q_n \rangle = \lvert q1 \rangle \otimes \lvert q2 \rangle \otimes ... \otimes \lvert q_n \rangle
1414
$$
1515

16-
So therefore, the vector that must be stored for 4 qubits in the state of 0000 is:
16+
So therefore, the vector that must be stored for 4 Qubits in the state of 0000 is:
1717

1818
$$
1919
\lvert0000\rangle = \lvert0\rangle \otimes \lvert0\rangle \otimes \lvert0\rangle \otimes \lvert0\rangle = \left( \begin{matrix} 1 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \end{matrix} \right)
@@ -27,8 +27,8 @@ \subsection{Matrix Generation}
2727
If you look at the gates defined in the Previous Section, 'Quantum Logic Gates' (For Example, Equation (3)), they are all either \(2\times2\) or \(4\times4\) Matrices, which means that they can only be applied to either a 2 or 4 dimensional vector. This is a problem for our computational model, as we create a large \(2^n\) Dimensional Vector.
2828

2929
\subsubsection{Expanding Single Qubit Gates}
30-
Essentially, what we are trying to do it take a 2x2 matrix, and scale it up, so that it a \(2^n\) x \(2^n\) matrix. Whats important, is that the new matrix must only affect the qubit its targeting. For example, if I had a 4 Qubit Register, and I wanted to apply an \(X\) Gate to the 3rd Qubit, The equation for that new matrix is \(X_{3,4} = Id \otimes Id \otimes X \otimes Id \), with \(Id\) Being a 2x2 Identity Matrix. \\
31-
To generalise this further, to create the gate \(G_{m,n}\) (With \(n\) being the number of qubits in the register, \(m\) being the number of the qubit the gate will act on, and \(G\) Being the 2x2 gate that will be applied to that qubit),
30+
Essentially, what we are trying to do it take a 2x2 matrix, and scale it up, so that it a \(2^n\) x \(2^n\) matrix. Whats important, is that the new matrix must only affect the Qubit its targeting. For example, if I had a 4 Qubit Register, and I wanted to apply an \(X\) Gate to the 3rd Qubit, The equation for that new matrix is \(X_{3,4} = Id \otimes Id \otimes X \otimes Id \), with \(Id\) Being a 2x2 Identity Matrix. \\
31+
To generalise this further, to create the gate \(G_{m,n}\) (With \(n\) being the number of Qubits in the register, \(m\) being the number of the Qubit the gate will act on, and \(G\) Being the 2x2 gate that will be applied to that Qubit),
3232
you can use the equation:
3333

3434
\begin{equation}
@@ -42,7 +42,7 @@ \subsubsection{Expanding Single Qubit Gates}
4242
(Note: \(\underset{i=1}{\overset{n}{\otimes}}\) is like \(\underset{i=1}{\overset{n}{\sum}}\), but using the kronecker product, instead of the sum.)
4343

4444
\subsubsection{Expanding Multi-Qubit Gates}
45-
Focusing on Controlled Gates, there are a number of ways to expand / scale up multi-qubit gates, but most of them are quite long winded (See the appendix for a general expansion method),
45+
Focusing on Controlled Gates, there are a number of ways to expand / scale up multi-Qubit gates, but most of them are quite long winded (See the appendix for a general expansion method),
4646
but the way that the CNOT / Controlled X Gate is implemented in the simulator, is using a Input-Output like structure to generate a new matrix. \\
4747
There is no equation for this gate (Again, see the appendices for a full, generalised mathematical solution), but the generation method for this simulator can be shown using the source code. \\ \\
4848
See the \emph{Gate} class, and the \emph{generateGate} method.
@@ -54,7 +54,7 @@ \subsection{Applying Gates}
5454
\lvert\psi\rangle \cdot G
5555
\end{equation}
5656

57-
For example, to apply a Pauli-X Gate (Not Gate) to the second qubit of a 2-Qubit Register, it would look as shown (Keep in mind the previous Gate Matrix Generation Equations):
57+
For example, to apply a Pauli-X Gate (Not Gate) to the second Qubit of a 2-Qubit Register, it would look as shown (Keep in mind the previous Gate Matrix Generation Equations):
5858

5959
$$
6060
Id = \left [\begin{matrix}

0 commit comments

Comments
 (0)