0% found this document useful (0 votes)
13 views11 pages

On The Resource Consumption of Software Quantum Computing Simulators

This document discusses the resource consumption of software quantum computing simulators, highlighting their importance in designing and testing quantum algorithms due to the limitations of current quantum devices. It describes how quantum components are modeled on classical computers and the significant resources required for such simulations. The authors explore various approaches to mitigate these challenges and improve the efficiency of quantum simulators.

Uploaded by

Gilberto Diaz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views11 pages

On The Resource Consumption of Software Quantum Computing Simulators

This document discusses the resource consumption of software quantum computing simulators, highlighting their importance in designing and testing quantum algorithms due to the limitations of current quantum devices. It describes how quantum components are modeled on classical computers and the significant resources required for such simulations. The authors explore various approaches to mitigate these challenges and improve the efficiency of quantum simulators.

Uploaded by

Gilberto Diaz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

DYNA

http://dyna.medellin.unal.edu.co/

On the Resource Consumption of Software Quantum Computing


Simulators
Sobre el Consumo de Recursos de los Simuladores Cuánticos en
Software
Gilberto Javier Díaz-Toro a & Luiz Angelo Steffenel b Carlos J. Barrios-Hernández c
a
SC3UIS - CAGE, Universidad Industrial de Santander, Bucaramanga, Colombia. [email protected]
b
Laboratoire CReSTIC - Équipe CASH Université de Reims Champagne-Ardenne, Reims, France. [email protected]
c
SC3UIS - CAGE, Universidad Industrial de Santander, Bucaramanga, Colombia. [email protected]

Received: September 6th, 2012. Received in revised form: November 1th, 2013. Accepted: November 25th, 2013.

Abstract
Recently, several real quantum devices have become available through the cloud. Nevertheless, they are expected to be very limited, in the near
term, in the number and quality of the fundamental storage element, the qubit. Therefore, software quantum simulators are the only widely
available tools to design and test quantum algorithms. However, the representation of quantum computing components in classical computers
consumes a big amount of resources. This work describes how to model the main elements of quantum computing in a classical computer and
depicts resource consumption using two popular quantum simulators. In the end, we discuss different approaches to overcome this problem.

Keywords: Quantum Computing, Quantum Computing Simulators, High Performance Computing

Resumen
Recientemente, varios dispositivos cuánticos reales están disponibles a través de la nube. No obstante, se espera que sean muy limitados, a corto
plazo, en el número y la calidad del elemento fundamental de almacenamiento, el qubit. Por lo tanto, los simuladores cuánticos de software son
las únicas herramientas ampliamente disponibles para diseñar y probar algoritmos cuánticos. Sin embargo, la representación de componentes de
computación cuántica en computadoras clásicas consume una gran cantidad de recursos. Este trabajo describe cómo modelar los elementos
principales de la computación cuántica en una computadora clásica y describe el consumo de recursos utilizando dos simuladores cuánticos
populares. Al final, discutimos diferentes enfoques para superar este problema.

Palabras clave: Computación Cuántica, Simuladores de Computación Cuántica, Computación de Alto Rendimiento

1 Introduction For all this, quantum computing simulators are the only widely
Recently, several quantum devices, with up to tens of qubits on available tools to design and test quantum algorithms. However, the
universal quantum computers (UQC) and thousand qubits on annealer simulation of quantum computing models in classical computers
(QA) devices, have become available through the cloud. This enable requires exponential time and involves extremely complex memory
the possibility to use real quantum hardware to solve very simple management. The problem is that using conventional techniques to
problems for first time. However, in the near term, those devices are simulate an arbitrary quantum process that is significantly larger than
expected to be very limited in number and quality of qubits. These any of the existing quantum prototypes would soon require a huge
quantum computers represent prototypes that are not scalable and amount of memory on a classical computer. For instance, to simulate
sufficient to test complex quantum algorithms. The construction of a a 60 qubits quantum state the process would take about 18.000
full-scale quantum computer comprising millions of qubits is a longer- petabytes (18 Exabytes) of classical computer memory. Therefore,
term prospect. Quantum computer prototypes are currently very small researchers try to reduce such challenges by proposing efficient
and specific and are not yet able to overcome the processing capacity simulators. Some popular quantum software simulators can be found
of classical computers. For example, the recent IBM Q System One [4] in [6] [7].
only operates with 53 qubits. Programming this prototype still lacks The simulation of quantum systems in classical computers is a
the compiler support that modern programming languages enjoy today. relatively old problem. However, with the emergence of real quantum
Programmers of this machine must design low-level circuits, in computers, the limit of what classical simulations can handle is being
particular, they must map logical qubits into physical qubits that need pushed to better understand its operation and verify that t is behaving
to obey connectivity constraints. This task resembles the early days of as predicted. The simulations of NISQ (Noisy Intermediate-Scale
programming, in which software was built in machine languages [5]. Quantum) devices on classical computers represent an invaluable

© The authors; licensee Universidad Nacional de Colombia.


DYNA 81 (184), pp. 1-2. April, 2014. Medellín. ISSN 0012-7353 Printed, ISSN 2346-2183 Online
DYNA
http://dyna.medellin.unal.edu.co/

experimental testbed for noise characterizations, for the development


of quantum error correction, and for the verification of quantum
systems. With this momentum, a variety of techniques have been (3)
invented to keep up with the newer quantum processors [8].
This work attends to address the fundamental details of quantum
simulation on classical computers and the problems related to it. We
The general equation of a n-qubit state is
use a useful quantum algorithm and its implementation on two popular
quantum simulators to illustrate these aspects.
(4)
2 Key Concepts of Quantum Computing
To better understand the quantum computing model, it is necessary
to know the key aspects of the inheritance of quantum mechanics. This
section describes the fundamental concepts on which quantum 2.3 Superposition
computing is based. The special characteristic of quantum states is that they allow the
system to be in a few states simultaneously, this is called superposition.
2.1 Qubit Quantum bits are not constrained to be wholly 0 or wholly 1 at a given
The basic unit used in classical information is the bit, which can instant. In quantum physics, if a quantum system can be found to be in
have two values: 0 or 1. The corresponding unit in quantum one of a discrete set of states, which we’ll write as |0〉 or |1〉, then,
information is the qubit, this is a two-state (or two-level) quantum whenever it is not being observed it may also exist in a superposition,
system1 in which the Boolean states 0 and 1 are represented by a or blend of those states simultaneously [12].
prescribed pair of normalized and mutually orthogonal quantum states
denoted using Dirac’s notation |0〉 and |1〉 [9]. The two states form a 2.4 Measurement of Single Qubit Quantum State
“computational basis” and any other (pure) state of the qubit can be According to the postulate 3 of quantum mechanics
written as a superposition α|0〉 + β|1〉 [10]. The bra/ket notation has (Measurement), the action of measure a quantum state produces a
the advantage of being independent of basis and the order of the change in it. If a state |𝑣〉 = α|0〉 + β|1〉 is measured and the outcome
elements of the basis. Mathematically, the Dirac’s notation (ket) is a is |0〉, then the state |𝑣〉 changes to |0〉. A second measurement with
shorthand notation for column vectors: respect to the same basis will return |0〉 with probability 1. To
understand this, it is necessary to think of a superposition |𝑣〉 as a state
that could be in both state |0〉 and state |1〉 at the same time, that is to
(1) say, the quantum state |𝑣〉 is a combination of |0〉 and |1〉 in similar
proportions but with different amplitudes. A fundamental fact about
2.2 Quantum State this measurement process (measurement in the computational basis) is
A quantum state is simply something that encodes the state of a that the quantum state |𝑣〉 v is disturbed by the measurement.
quantum system. Formally, a quantum state is a vector |v〉 representing Therefore, it is impossible to determine the original state from any
a superposition of basis {|β1 〉, |β2 〉} if it is a nontrivial linear sequence of measurements [3].
combination of |β1 〉 and |β2 〉, if |v〉 = a1|β1 〉 + a2|β2 〉 where a1 and
a2 are non-zero. For the term superposition to be meaningful, a basis 2.5 Entanglement.
must be specified [3]. The “entanglement” describes a correlation between different parts
The state of a bit is a particular case of two-dimensional vector, of a quantum system that surpasses anything that is classically
that is to say, there are only two vectors in the whole two-dimensional possible. It happens when the subsystems interact in such a way that
vector space with real meaning, these are the two orthogonal vectors the resulting state of the whole system cannot be expressed as the direct
|0〉 and |1〉. Conversely, qubits do not suffer from this limitation. The product of the states of its individual parts. When a quantum system is
state |ψ〉 associated with a qubit can be any unit vector in the two- in such a tangled state, the actions performed in one subsystem will
dimensional vector space spanned by |0〉 and |1〉 over the complex have a side effect in another subsystem, even if it does not act directly
numbers [11]. The general state of a qubit is: on that subsystem [12]. It takes 2n – 1 complex numbers to describe
states of an n-qubit system. Because 2n is much bigger than n, most of
|ψ〉 = α0|0〉 + 𝛼1|1〉 (2) the n-qubit states cannot be described in terms of the state of n separate
single-qubit systems. States that cannot be written as the tensor product
Where α0 and α1, are called the amplitude of component |0〉 and of n single-qubit states are called entangled states. Thus, the vast
component |1〉 respectively, are two complex numbers constrained majority of quantum states are entangled [3]. If we can write the tensor
only by the requirement that |ψ〉, like |0〉 and |1〉, should be a unit product of those states, they are said to be separate states.
vector in the complex vector space, in other words, only by the
normalization condition: |α0|2+|α1|2 = 1. The state of n qubits is 2.6 Reversibility
spanned by the tensor product basis. The reversibility is a property of some operations that consist of
obtaining unique inputs for all outputs of said operations. Reversibility

1 https://en.wikipedia.org/wiki/Quantum system

© The authors; licensee Universidad Nacional de Colombia.


DYNA 81 (184), pp. 1-2. April, 2014. Medellín. ISSN 0012-7353 Printed, ISSN 2346-2183 Online
DYNA
http://dyna.medellin.unal.edu.co/

is one of the most useful mechanisms in quantum computing.  Quantum Turing Machine: A quantum Turing machine,
Reversible operations change the initial state of the qubits into its final also known as universal quantum computer, is an abstract
form using only processes whose action can be inverted. There is only machine used to model a quantum computer proposed by
a single irreversible component to the operation of a quantum David Deutsch [15].
computer, the measurement, which is the only way to extract useful
information from the qubits after their state has acquired its final form 3 Basis of Quantum Computing Simulation
[11]. In a reversible operation, every final state arises from a unique In classical computing, the amount of information contained by a
initial state. Before study quantum gates let’s describe briefly this specific state using n bits is n, there will be only one combination of n
property on the classical logic gates. The AND gate is logically 0s and 1s. In quantum computing, a state composed of n qubits will be
irreversible because if the output is 0, you cannot tell whether the input a union of all possible combinations of n 0s and 1s. That is to say, the
values were 00, 01, or 10. It “erases” some information when it acts size of the information is 2n. For example, if we are using 3 bits, we
whenever the output from the AND gate is 0. Similarly, the OR gate is will have just one of the 23 possibilities whose length is 3, for instance,
irreversible because when its output is 1 it is impossible to say whether 010. If we use 3 qubits we will have, not only one but all combinations:
the inputs were 01, 10, or 11. The simplest example of a reversible logic 001, 010, 011... 111, each one multiplied by the corresponding
gate is the NOT gate, when the output is 1 the only possible input is 0 amplitude. If we increase in 1 the number of bits the size will be n + 1,
and vice-versa. but if we increase the number of qubits, we get the double of the size,
that is to say, 2n+1 [16].
2.7 Decoherence
Quantum states are very fragile and susceptible to noise. 3.1 Single Qubit Representation
Eventually, errors inevitably appear over time, this process is known A qubit is a two-level quantum system. The state |ψ〉 of this
as decoherence. Some situations that cause errors are, for example,
quantum system can be represented by two complex numbers α0 and
atoms couple to the electromagnetic field and spins couple to other
α1 such as
spins via dipole interactions. These unwanted couplings cause errors,
therefore, quantum states must be well isolated from the environment (6)
in order to protect quantum information against these errors.
In the context of quantum computing, qubits are susceptible to The computational basis |0〉 and |1〉 are orthonormal. When we
more kinds of errors than are classical bits. There are phase errors that measure the qubit, we obtain |0〉 with probability 𝑝 = |𝑎0 |2 or |1〉
send |0〉 → |0〉 and |1〉 → −|1〉, which has the effect of changing α|0〉 with probability 1 − 𝑝 = |𝑎1 |2. Thus, after being measured, the qubit
+ β|1〉 to α|0〉 − β|1〉. In addition, there are generally small errors that becomes a classical bit.
have the effect α|0〉 + β|1〉 → (α + 𝑂(𝜖) ) |0〉 + (β + 𝑂(𝜖) ) |1〉 where To store |𝜓〉 on a classical computer, it is more suitable to use two
𝜖 ≪ 1 is a parameter that characterizes the size of the error. It is orthonormal vectors to represent |0〉 and |1〉.
necessary to take special care in detecting an error because measuring
a state can change it, and of course, we cannot just copy the qubit state,
because of the no-cloning theorem [9]. (7)

2.7 Quantum Computing Models.


A quantum computing model is the description of the different 3.2 Operations on Single Qubits
scientific approaches to formalizing the transformations over inputs to Any operation on the qubit of Equation 7 is represented by a
compute outputs using quantum resources. A model is determined by complex unitary matrix. For example, if we apply a NOT gate (X gate),
the basic elements in which the computation is decomposed [13] [14]. it is equivalent to execute a matrix-vector multiplication.
The four main models of practical importance are:
 Quantum Gate Array or Quantum Circuit: The (8)
computation is decomposed into a sequence of few qubit
quantum gates. This is the best well-known model of
3.3 Two Qubits Representation
quantum computation. The state of two qubits system |𝜙〉 is represented by four complex
 One-way quantum computer: The computation is coefficients which provide the contribution of all possible classical
decomposed into a sequence of one-qubit measurements states of two bits.
applied to a highly entangled initial state or cluster state.
 Adiabatic quantum computer: This model of quantum
computation is motivated by ideas in quantum many-body
theory. The computation is decomposed into a slow (9)
continuous transformation of an initial Hamiltonian into a
final Hamiltonian, whose ground states contain the solution.
 Topological quantum computer: The computation is
decomposed into the braiding of anyons in a 2D lattice.

© The authors; licensee Universidad Nacional de Colombia.


DYNA 81 (184), pp. 1-2. April, 2014. Medellín. ISSN 0012-7353 Printed, ISSN 2346-2183 Online
DYNA
http://dyna.medellin.unal.edu.co/

3.4 Operations on Two Qubits To exemplify briefly this procedure, let’s see how to prepare a
The operations that act on the entire state of two qubits are single qubit state |𝜓〉 It is represented as a superposition of 0 and
represented by complex unitary matrices of dimension 4 × 4, for 1 states |𝜓〉 = 𝛼|0〉 + 𝛽|1〉 where |𝛼|2 + |𝛽|2 = 1. The
example, the controlled Z gate or CZ. magnitudes |𝛼|2 and |𝛽|2 represent the relative probability of |𝜓〉
being 0 or 1. Until a non-observable global phase, we can assume
that 𝛼 is real, so that |𝜓〉 = 𝑐𝑜𝑠𝜃|0〉 + 𝑒 𝑖𝜙 𝑠𝑖𝑛𝜃|1〉 for some
angles θ, φ. Therefore, we represent the state as a point on the
(10) unit sphere with θ the latitude and φ the longitude. Thus, one
qubit state preparation consists simply of finding the unitary
transformation that takes the north pole to (α, β).
To build the 4 × 4 matrix acting on the whole system applying a A 2 × 2 unitary matrix can be obtained from the product of three
single-qubit operation to just one qubit, one performs a Kronecker rotation matrices, up to t he global phase.
product with a 2 × 2 identity matrix. Applying an X gate to the first
qubit (with bit-index 0) can be achieved as follows [16]. (14)

Where
(11)
(15)
And Ry(γ) is related to Rz (γ) by
3.4 n-Qubits Representation
(16)
In a general form, the n-qubits state of a quantum computer can be
represented by a complex vector of size 2n. The rotation matrices Ry(γ) and Rz (β) correspond to the
associated rotations of the unit sphere under the Bloch
representation. Therefore, Equations 14, 15, and 16 are a
reiteration of the standard Euler angle decomposition of elements
of SO(3). Thus, the problem of approximating an arbitrary
quantum state is reduced to the problem of finding good
(12) approximations of Rz (γ) for various values of γ.
To set the initial state of more than one qubit we can use the so-
called Schmidt decomposition. It allows one to initialize a 2n-qubit
state by initializing a single n-qubit state, along with two specific n-
3.5 Operations on n-Qubits qubit gates, combined together with n CNOT gates.
The operations on the state of Equation 12 are 2𝑛 × 2𝑛 unitary
matrices. Finally, applying a single-qubit gate U to the i-th qubit of an
4 Quantum Algorithms
n-qubit quantum computer amounts to multiplying the state vector of A quantum algorithm is an algorithm made in one of the models of
coefficients 𝛼𝑖 by the matrix quantum computing, with quantum circuits as the most used model. A
classical (or non-quantum) algorithm is a finite sequence of
instructions, or a step-by-step procedure for solving a problem, where
(13) each step or instruction can be performed on a classical computer.
Similarly, a quantum algorithm is a step-by-step procedure, where each
This is a complex sparse matrix-vector multiplication of dimension of the steps can be performed on a quantum computer. Although all
2n. Therefore, for double-precision values, just storing the state vector classical algorithms can also be performed on a quantum computer, the
for 50 qubits would already require 16 petabytes of memory. term quantum algorithm is generally used for those algorithms that
incorporate some essential features of quantum computing, such as
3.6 Quantum State Preparation superposition or entanglement [13]. Contrary to the popular belief that
Patrick Coles et. al. in his work [17] presents some methods to quantum computers have few applications, the field of quantum
prepare qubits states. The preparation procedure of an n- qubit state algorithms has become a sufficiently large area of study. We can see
consists of two steps: how web sites like “Quantum Algorithms Zoo” [18] cite almost 400
 Finding a unitary transformation that takes the N- articles in this area.
dimensional vector (1, 0, . . . 0) to the desired state (α1, ..., αN), When referring to an algorithm, the computational complexity,
where N = 2n. or just complexity, is a measure of the resources used by the algorithm,
 Rendering the unitary transformation into a sequence of usually measured as a function of the input size of the algorithm. The
gates. complexity for the input size n is taken as the cost of the algorithm in
a more unfavorable case entry for the size n problem. When referring

© The authors; licensee Universidad Nacional de Colombia.


DYNA 81 (184), pp. 1-2. April, 2014. Medellín. ISSN 0012-7353 Printed, ISSN 2346-2183 Online
DYNA
http://dyna.medellin.unal.edu.co/

to a problem, the complexity is the minimum amount of resources


required by any algorithm to solve the problem [19].
In the theory of computational complexity, asymptotic scales
(17)
of complexity measures such as execution time or problem size
are generally considered. In both classical and quantum
computing, the execution time is measured by the number of
elementary operations used by an algorithm. In the case of If we evaluate f (−1) and f (+1) we obtain two bits of classical
quantum computing, this can be measured using the quantum information and know which of the four functions, we have.
circuit model, where a quantum circuit is a sequence of quantum Obviously, this requires two evaluations of the function. All those
operations called quantum gates, each applied to a small number functions can be categorized as follow:
of qubits. To compare the performance of the algorithms, the
notation O(f(n)) of the computing style is used, which is  Balanced: for example: f (−1) + f (+1) = 0
interpreted as “asymptotically delimited by f (n)” [20]. In these  Unbalanced: or constant
cases, it is convenient to use the basic ideas of the theory of
computational complexity [21], especially the notion of Classically, to find out what class the function is in, it is necessary
complexity classes, which are groupings of problems by difficulty. to acquire a classic bit of information, which requires two function
Table 1 contains the informal descriptions of some important evaluations. Quantum mechanically we can determine the class with
complexity classes. If a problem is said to be complete for a only a single evaluation or “measurement”. The trick is to put x into a
complexity class, this means that it is one of the “most difficult” superposition of both +1 and -1, then, a single evaluation of the
problems within that class. function can be used to determine the class. However, it is not possible
to determine what function in the class is, because the measurement
Table 1. returns only one bit of classical information. This idea is the start point
Computational Complexity Classes of Algorithms to investigate other quantum algorithms.
Class Informal Definition
P A deterministic classical computer can solve it in
4.2 Quantum Algorithms Workflow
polynomial time
BPP A probabilistic classical computer can solve it in A typical quantum algorithm workflow on a gate-model quantum
polynomial time computer is depicted in Figure 1. It begins with a high level definition
BQP A quantum computer can solve it in polynomial time of the problem, for example, Shor’s algorithm. The problem to solve
NP A deterministic classical computer can check the solution is, given an odd composite number N, we need to find an integer i,
in polynomial time strictly between 1 and N, that divides N.
Quantum A quantum computer can check the solution in polynomial
Merlin–Arthur time
Source: Ashley Montanaro, Quantum algorithms: an overview, 2016.

There are three classes of quantum algorithms with clear


advantages over known classical algorithms.
 Algorithms based upon quantum versions of the Fourier
transform, which is very used in classical algorithms. Some
algorithms in this category are Deutsch–Jozsa algorithm and
Shor’s algorithms for factoring.
 Quantum search algorithms. Figure 1. Quantum Algorithm Workflow.
 Quantum simulation. A quantum computer is used to
simulate a quantum system.
5 Quantum Computing Simulators
A quantum simulator is an object able to execute quantum
4.1 Quantum Parallelism
computations. They can be classified in two categories [24]:
One of the main features of quantum computing is to take
advantages of quantum mechanics effects like superposition and  A Quantum System that can perform very specific quantum
entanglement, to speed up the calculations. In 1985 Deutsch [15] found computations
a computational problem that could be solved on a quantum computer  Software Packages that can reproduce most of the fundamen-
in a manner that is impossible classically. In 1992 Deutsch and Jozsa tal aspects of a general universal quantum computer on a
[22] simplified and extended the earlier result. general purpose classical computer.
The modern formulation of the problem is the following. Suppose
a classical algorithm that computes some function f : ±1 → f : ±1 [23]. Real quantum computers are available to use over the cloud,
There are exactly four such functions: however, they are still very small to be considered as a complete
universal quantum computer. On the other hand, although quantum
computing simulators, running on a classical computer, cannot process

© The authors; licensee Universidad Nacional de Colombia.


DYNA 81 (184), pp. 1-2. April, 2014. Medellín. ISSN 0012-7353 Printed, ISSN 2346-2183 Online
DYNA
http://dyna.medellin.unal.edu.co/

actual quantum states they are very helpful to test the code syntax and
flow. 6 Quantum Simulations Resource Usage
There has been a recent explosion of quantum software platforms To illustrate the resources consumption by a quantum simulator,
which can overwhelm to those looking for a platform to use. Therefore, we run the Fourier Quantum Transform (QFT) using two quantum
this section attempts to mention some of the most popular initiatives. simulators. Before present the results of the simulations we describe in
the next subsection the details of the QFT algorithm.
5.1 Popular Open Source Quantum Computing Simulators
Many institutions are working on quantum software, specifically 6.1 The Quantum Fourier Transform
quantum simulators, from academic research groups to big companies. Quantum Fourier Transform (QFT) is a quantum implementation
A list of the very recent developments is maintained in several websites of the discreet Fourier transform [40]. The quantum Fourier
[6] [7] [25] [26]. They present several quantum computing software transformation is a generalization of the Hadamard transformation.
packages developed by different organizations. The difference is that QFT introduces phase. The specific types of
LaRose et. al. [27] made a review of some important general phases introduced by QFT are the primitive roots of the unit, ω. Let’s
purpose projects, that operate at the level of quantum gates. Guzik [28] remind that in the complex numbers, the equation 𝑧 𝑛 = 1 has n
did a study on the appropriate approach to implement different models solutions, for example: for n = 2 𝑧 could be 1 or -1, for n = 4 𝑧 could
of quantum computing. Fingerhuth et. al. [29] did an evaluation of a be 1, i, -1 or -i. These roots can be written as power of 𝜔 = 22𝜋𝑖 /𝑛.
wide range of open source software for quantum computing, including This number 𝜔 is called a primitive nth root of unity. DFT is a
all stages of the quantum toolchain from quantum hardware interfaces transformation of a set x0, ...xN−1 of N complex numbers into a set of
through quantum compilers to implementations of quantum complex numbers y0, ...yN−1 defined by Equation 18.
algorithms, as well as several quantum computing models: quantum
annealing and discrete and continuous-variable gate- model. The
criteria used by this team to select the projects involve aspects like: (18)
approved license, maturity, number of contributors, repository
availability, etc. Where
Leveraging all those works, we present the following list with a
specific selection of major software quantum simulators
developments: (19)
 Quantum++ (C++) Is a general-purpose multi-threaded
quantum simulator written in C++ with high performance. To build the quantum version of DFT let’s define a linear
[30]. transformation U on n qubits that acts on computational basis states |𝑗〉
 QuEST (C/C++) It is an open-source quantum simulator where 0 ≤ 𝑗 ≤ 2𝑛 − 1. In other words, QFT acts on a quantum state
with multithreading, distributed processes and GPU- like
accelerated capabilities. [31].
 Qrack (C++) Is a quantum simulator written in C++ that (20)
comes with additional support for Graphics Processing Units
(GPUs). [32]. And map it to the following quantum state
 Intel-QS Formely qHiPSTER, is a simulator of quantum
circuits optimized to take maximum advantage of multi- core (21)
and multi-nodes architectures. [33].

Some projects provide a full-stack approach to quantum That transformation is performed using the formula of Equation
computing, including not only a simulator but compilers and the 18. If we consider its action on superpositions we note that it
possibility to run the program on real quantum processors. The corresponds to a vector notation for the Fourier transform (18) for the
following list shows some of these projects: case 𝑁 = 2𝑛 . Considering the action of QFT on an orthonormal basis
 XACC, Simulator: TNQVM (C) This provides an |0〉, … , |𝑁 − 1〉, we can define it as a linear operator with the following
implementation that takes advantage of the tensor network transformation on the basis states.
theory to simulate quantum circuits [34], [35].
 Qiskit, Simulator: Qiskit Aer (Python) Framework for
working with noisy quantum computers at the level of pulses, (22)
circuits, and algorithms supported by IBM [36], [37]
 ProjectQ, Simulator: ProjectQ (C++, Python) An open That action on an arbitrary state can be written as
source software framework for quantum computing [38],
[39] supported by ETH Zurich.
 Forest, Simulator: QVM (Python) Is the quantum simulator (23)
of the full-stack library Forest. It is a purely Python- based
simulator which is meant for rapid prototyping of quantum
circuits [45]. It is supported by Rigetti.

© The authors; licensee Universidad Nacional de Colombia.


DYNA 81 (184), pp. 1-2. April, 2014. Medellín. ISSN 0012-7353 Printed, ISSN 2346-2183 Online
DYNA
http://dyna.medellin.unal.edu.co/

Where the amplitudes 𝑦𝑘 are the discrete Fourier transform of the 5. Apply the CROTn gate on qubit 1 controlled by qubit n
amplitudes 𝑥𝑘 . It can be checked that this transformation is a unitary
transformation, and thus can be implemented as a quantum circuit. 6. Apply the similar sequence of gates on qubit 2 to qubit
n
6.1.1 N-Qubits QFT The final state is
This section describes the QFT for N Qubits. Simple examples for
one and three qubits can be consulted in [37]. The following operations
have to be performed to obtain the quantum Fourier transform for N
qubits.
(29)

(24)

In terms of performance, DFT takes 𝑁 log 𝑁 = 𝑛2𝑛 steps to


𝑥𝑦 transform 𝑁 = 𝑛2𝑛 numbers. On a quantum computer, the transform
𝑗𝑘
Since 𝜔𝑁 = 𝑒 2𝜋𝑖 𝑁 and 𝑁 = 2𝑛 can be accomplished using log2𝑁 = 𝑛2𝑛 . It seems that quantum
computers can be used to very quickly calculate the Fourier transform
of a vector of 2𝑛 complex numbers. However, the Fourier
(25) transformation is performed on the “hidden” information in the
amplitudes of the quantum state.
This information is not directly accessible in the measurement
Rewriting in fractional binary notation, expanding the exponential process. The problem, of course, is that if the output status is measured,
of a sum to a product of exponentials, rearranging the sum and each qubit will collapse in the state |0〉 or |1〉, preventing us from
products, and expanding again learning the result of the transformation 𝑦𝑘 directly.

(26)

6.1.2 QFT Quantum Circuit

The circuit that implements QFT uses two quantum gates: The
Hadamard gate and two qubits controlled rotation gate CROTk. The last
is represented by the following matrix
Figure 3. Quantum Circuit for QFT

(27) 7 Results
Among the big list of software quantum simulators available in [6],
[7], and [26] we have chosen Quantum++ and Intel-QS. Quantum++
Where was selected for its simplicity of operation and open-source code. Also,
it provides a benchmark for QFT and the ability of parallel execution
(28) on a single node. Intel-QS was selected because it uses the parallel
studio to optimize the code and the MKL library to increase the
performance, also this simulator is open source and provides a QFT
The gate UROTk is the phase gate with the following matrix implementation. The experiments were performed using a range of 10
representation. Figure 3 shows the n-qubits quantum circuit for to 24 qubits to obtain a proper scale to observe the results. Simulations
QFT. under 10 qubits take a fraction of a second and do not provide
The circuit of the Figure 3 operates as follow: important contributions to the analysis. The hardware used was a
laptop with an Intel i7-8565U 1.8 GHz processor and 16 GB of RAM.
1. Starts with n-qubit input state, |𝑥1 , 𝑥2 , . . , 𝑥𝑛 〉 The first experiment was performed using Quantum++ simulator using
OpenMP parallelization. We fix the number of threads in 8 to leverage
2. Apply the H gate on qubit 1 the total power of the processor and varied the number of qubits from
10 to 24. A shell script was used to automate the execution procedure.
3. Apply the CROT2 gate on qubit 1 controlled by qubit 2 Build instructions and the QFT source code corresponding to the
4. Apply the CROT3 gate on qubit 1 controlled by qubit 3 quantum circuit illustrated in Figure 3 can be found in [41]. Figure 4
depicts the performance of Quantum++ simulator.

© The authors; licensee Universidad Nacional de Colombia.


DYNA 81 (184), pp. 1-2. April, 2014. Medellín. ISSN 0012-7353 Printed, ISSN 2346-2183 Online
DYNA
http://dyna.medellin.unal.edu.co/

Figure 7. QFT Performance Using Intel-QS

In the same way, we simulate QFT using Intel- QS for a range of


Figure 4. QFT Performance Using Quantum++ with 8 Threads
21 to 24 qubits, this time using a MPI approach when varying the
The next experiment was performed using Intel-QS simulator number of processes from 2 to 8. Figure 8 depicts the memory usage
vs the number of qubits. Here, we compare both simulators.
using MPI with 8 processes. Figure 5 depicts the results.

Figure 8. Memory Consumption Using Quantum++ and Intel-QS

Figure 5. QFT Performance Using Intel-QS with 8 Processes Finally, in Figure 9 we can observe the total number of gates used
in the quantum circuit of QFT for different number of qubits.
To show how performance is improved when we increase the
number of threads, we run an experiment using the Quantum ++
simulator by varying the number of threads from 1 to 8. To correctly
observe the results, we use a range of 21 to 24 qubits since for a lower
number of qubits, the simulation requires a small amount of time and
we cannot see the speedup, and for a higher number of qubits, the
simulation exceeds the hardware capacity. Figure 6 depicts these
results.

Figure 9. Number of Gates of the Quantum Circuit

8 Discussion
Analyzing the results depicted in Figures 4 and 5 we notice that
Intel-QS has a significantly better performance than Quantum++, in
terms of processor usage. In Figure 6 we note that increasing the
Figure 6. QFT Performance Using Quantum++ number of threads the execution time improves substantially. The
execution time for 24 qubits using one thread was 6912.03 seconds and
using 8 threads was 1158.79 seconds. Thus, we obtained a good

© The authors; licensee Universidad Nacional de Colombia.


DYNA 81 (184), pp. 1-2. April, 2014. Medellín. ISSN 0012-7353 Printed, ISSN 2346-2183 Online
DYNA
http://dyna.medellin.unal.edu.co/

speedup. Conversely, Figure 7 shows that Intel-QS shows less Therefore, there is not any standard approach to deal with the resource
acceleration than Quantum++ and in some cases there is no consumption by the software quantum simulators.
acceleration at all. In Figure 8 we observe that for small number of
qubits Quantum++ has a better memory management, however, Intel- Bibliography
QS is better for more than 22 qubits. We can notice that memory usage
is substantially big after 21 qubits and, in general, as we increase one [1] C. E. Shannon, «A Mathematical Theory of Communication,»
qubit the memory usage is approximately double. If we follow that BELL SYST TECH, vol. 27, pp. 379-423, #jul# 1948.
trend, we can infer that for 30 qubits we will need 32 GB of RAM and
for 45 qubits one Petabyte of RAM. In addition, we notice that Intel- [2] M. Born y P. Jordan, «Zur Quantenmechanik,» Zeitschrift für
QS has a better memory management. Observing Figure 9 we can note Physik, vol. 34, pp. 858-888, Dec 1925.
that the total number of gates of the QFT quantum circuit increase [3] R. Eleanor y P. Wolfgang, Quantum Computing, A Gentle
approximately linearly with the number of qubits. Finally, it is clear Introduction, The MIT Press, 2011.
that Intel-QS can scale better than Quantum ++ due to its distributed [4] M. a. L. R. Bozzo-Rey, «Introduction to the IBM Q Experience
nature which allows it to use more resources if we run it in an HPC and Quantum Computing,» Proceedings of the 28th Annual
cluster. International Conference on Computer Science and Software
Engineering, pp. 410--412, 2018.
9 Conclusions
[5] M. Y. Siraichi, V. F. d. Santos, S. Collange y F. M. Q. Pereira,
Quantum computing simulators, running on a classical computer,
«Qubit Allocation,» de Proceedings of the 2018 International
cannot process actual quantum states, however, they are very helpful
to test the code syntax and flow. Although some of them can simulate Symposium on Code Generation and Optimization, New York,
decoherence, an important feature of quantum simulators is that they NY, USA, 2018.
can simulate quantum states without errors, which allows us to [6] M. Fingerhuth, Open-Source Quantum Software Projects, 2019.
concentrate on the details of the algorithms and their operation. Despite [7] Quantiki, «List of QC simulators,» February 2019. [En línea].
these important advantages, quantum simulators consume a huge Available: https://www.quantiki.org/wiki/list-qc-simulators.
amount of classical resources as we can observe in the results section, [8] J. Chen, F. Zhang, C. Huang, M. Newman y Y. Shi, Classical
being the memory the most critical issue, for example, the amount of Simulation of Intermediate-Size Quantum Circuits, 2018.
RAM memory needed to simulate a quantum circuit representing the
quantum Fourier transform algorithm for 45 qubits is approximately [9] J. A. Bergou y M. Hillery, Introduction to the Theory of
one Petabyte. Therefore, it is imperative to design quantum simulators Quantum Information Processing, Springer Publishing
using novel techniques to test quantum algorithms with useful Company, Incorporated, 2013.
dimensions. It has to be pointed out that HPC is a fundamental tool to [10] A. a. H. P. Ekert y H. Inamori, «Basic concepts in quantum
build this type of simulators to handle quantum algorithms with proper computation,» {Coherent atomic matter waves}, pp. 661-701,
dimensions to get useful outcomes. #jan# 2001.
The next steps could include the use of a supercomputer to scale [11] N. D. Mermin, Quantum Computer Science: An Introduction,
the experiments carried out in this work and include other simulators Cambridge University Press, 2007.
to extend the comparison process. On the other hand, several initiatives
are trying to reduce the consumption of classical resources by quantum [12] C. P. Williams, Explorations in Quantum Computing, Second
simulators, for example, Jianxin Chen et. al. [8] works on a new Edition, Springer, 2011.
technique, based off of Google’s model for variable elimination in the [13] Wikipedia, «Quantum Computing,» Jan 2019. [En línea].
line graph, that implement a single-amplitude simulator, Aidan Dang Available: https://en.wikipedia.org/wiki/Quantum_algorithm.
et. al. [42] studies how the entanglement structure of Shor’s [Último acceso: 2020].
algorithm [43] is suitable for a particular matrix product state [14] Imanuel, What is Quantum Computing? Top 18 Quantum
representation, that quantifiably reduces the computational Computing Companies, 2018.
requirements for simulating it in a classical computer and Xin-Chuan
[15] D. Deutsch, «Quantum theory, the Church-Turing principle and
Wu et. al. [44] implements a lossy compression algorithm to reduce
the universal quantum computer,» Proceedings of the Royal
the amount of memory usage. The aim is to re-design quantum
Society of London, vol. 400, pp. 97-117, 1985.
simulators using at least one of these techniques, or a mix of them, to
test quantum algorithms with useful dimensions. [16] T. Häner y D. S. Steiger, «0.5 Petabyte Simulation of a 45-qubit
One of the main problems with software quantum simulators is that Quantum Circuit,» de Proceedings of the International
they demand a huge amount of resources, specifically, RAM memory. Conference for High Performance Computing, Networking,
Different research teams have been working on the implementation of Storage and Analysis, New York, NY, USA, 2017.
advanced techniques to overcome this issue. For example, the use of [17] P. J. Coles, S. Eidenbenz, S. Pakin, A. Adedoyin, J. Ambrosiano,
procedures to make the operations with quantum gates instead of P. Anisimov, W. Casper, G. Chennupati, C. Coffrin, H. Djidjev,
representing them as traditional data structures. It allows saving D. Gunter, S. Karra, N. Lemons, S. Lin, A. Lokhov, A.
memory space but involves an increment in the processing time. The Malyzhenkov, D. Mascarenas, S. Mniszewski, B. Nadiga, D.
vector space compression could also result in a processing overhead. OḾalley, D. Oyen, L. Prasad, R. Roberts, P. Romero, N. Santhi,
N. Sinitsyn, P. Swart, M. Vuffray, J. Wendelberger, B. Yoon, R.

© The authors; licensee Universidad Nacional de Colombia.


DYNA 81 (184), pp. 1-2. April, 2014. Medellín. ISSN 0012-7353 Printed, ISSN 2346-2183 Online
DYNA
http://dyna.medellin.unal.edu.co/

Zamora y W. Zhu, Quantum Algorithm Implementations for [40] M. A. Nielsen y I. L. Chuang, Quantum Computation and
Beginners, 2018. Quantum Information: 10th Anniversary Edition, 10th ed., New
[18] S. Jordan, Quantum Algorithm Zoo, 2018. York, NY, USA: Cambridge University Press, 2011.
[19] M. Mosca, Quantum Algorithms, 2008. [41] V. Gheorghiu, «Quantum++,» 13 May 2020. [En línea].
Available: https://github.com/softwareQinc/qpp.
[20] A. Montanaro, «Quantum algorithms: an overview,» 2015.
[42] A. Dang, C. D. Hill y L. C. L. Hollenberg, «Optimising Matrix
[21] C. H. Papadimitriou, Computational complexity., Addison- Product State Simulations of Shorś Algorithm,» {Quantum}, vol.
Wesley, 1994, pp. I--XV, 1--523. 3, p. 116, #jan# 2019.
[22] D. Deutsch y R. Jozsa, «Rapid Solution of Problems by [43] P. W. Shor, «Polynomial-Time Algorithms for Prime
Quantum Computation,» University of Bristol, Bristol, 1992. Factorization and Discrete Logarithms on a Quantum
[23] S. M. Girvin, Basic Concepts in Quantum Information, 2013. Computer,» SIAM J. Comput., vol. 26, pp. 1484-1509, #oct#
[24] I. Karafyllidis, G. C. Sirakoulis y P. Dimitrakis, «Representation 1997.
of Qubit States Using 3D Memristance Spaces: A First Step [44] X.-C. Wu, S. Di, F. Cappello, H. Finkel, Y. Alexeev y F. T.
Towards a Memristive Quantum Simulator,» de Proceedings of Chong, Memory-Efficient Quantum Circuit Simulation by Using
the 14th IEEE/ACM International Symposium on Nanoscale Lossy Data Compression, 2018.
Architectures, New York, NY, USA, 2018. [45] R. Shaydulin, H. Ushijima-Mwesigwa, I. Safro, S. Mniszewski
[25] Q. C. Report, Qbit Count, 2019. y Y. Alexeev, Community Detection Across Emerging Quantum
[26] Q. O. S. F. Team, «Quantum Open Source Foundation,» April Architectures, 2018.
2019. [En línea]. Available: https://qosf.org/. [Último acceso: [46] R. Shaydulin, H. Ushijima-Mwesigwa, C. Negre, I. Safro, S.
2020]. Mniszewski y Y. Alexeev, «A Hybrid Approach for Solving
[27] R. LaRose, «Overview and Comparison of Gate Level Quantum Optimization Problems on Small Quantum Computers,»
Software Platforms,» {Quantum}, vol. 3, p. 130, #mar# 2019. Computer, vol. 52, pp. 18-26, 06 2019.
[28] V. Guzik, S. Gushanskiy, M. Polenov y V. Potapov, «Models of [47] T. S. Humble y E. P. DeBenedictis, «Quantum Realism,»
a quantum computer, their characteristics and analysis,» de 2015 Computer, vol. 52, pp. 13-17, June 2019.
9th International Conference on Application of Information and
Communication Technologies (AICT), 2015.
[29] M. Fingerhuth, T. s. Babej y P. Wittek, «Open source software
in quantum computing,» PLOS ONE, vol. 13, pp. 1-28, 12 2018. Gilberto Javier Díaz-Toro, is a System Engineer and Master degree in
Computing from Los Andes University in Mérida - Venezuela. Was a teacher
[30] V. Gheorghiu, «Quantum++: A modern C++ quantum in Faculty of Engineering and researcher in the Supercomputing Center at the
computing library,» 2014. same University. Currently is TIC Consultant Universidad Industrial de
[31] T. Jones, A. Brown, I. Bush y S. C. Benjamin, «QuEST and High Santander in Bucaramanga - Colombia. His present research interests include
Quantum Computing and High Performance Computing.
Performance Simulation of Quantum Computers,» Scientific ORCID: https://orcid.org/0000-0001-8188-5784
Reports, vol. 9, p. 10736, 2019.
[32] D. Strano, Qrack, 2019. Luiz Angelo Steffenel is Associate Professor at the University of Reims
Champagne Ardenne, France. He obtained a Ph.D. in Computer Science in
[33] M. Smelyanskiy, N. P. D. Sawaya y A. Aspuru-Guzik, 2005 at Institut National Polytechnique de Grenoble, France. His research cover
«qHiPSTER: The Quantum High Performance Software Testing HPC and distributed computing, including simulation, performance modeling,
Environment,» CoRR, vol. abs/1601.07195, 2016. edge/fog computing and big data. Dr Steffenel pays especial attention to
[34] A. J. McCaskey, E. F. Dumitrescu, D. Liakh, M. Chen, W.-c. performance profiling and modeling, be it with existing acceleration
Feng y T. S. Humble, A Language and Hardware Independent architectures (GPUs, FPGAs) or future ones (quantic computers). His works
also include the development of HPC and distributed computing solutions for
Approach to Quantum-Classical Computing, 2017.
applied problems in other domains such as biochemistry and atmospheric
[35] amccaskey, Tensor Network QPU Simulator for Eclipse XACC, sciences.
2019. ORCID: https://orcid.org/0000-0003-3670-4088
[36] atilag, «Qiskit Aer,» May 2019. [En línea]. Available:
https://github.com/Qiskit/qiskit-aer. [Último acceso: 2020]. Carlos J. BARRIOS HERNANDEZ, received his PhD. In Computer Science
[37] atilag, «Qiskit,» May 2019. [En línea]. Available: from the University of Nice-Sophia Antipolis in France and the master’s degree
https://qiskit.org/textbook/ch-algorithms/quantum-fourier- in applied mathematics and informatics at National Institute of Applied Mathe-
transform.html. [Último acceso: 2020]. matics and Informatics of Grenoble from University of Grenoble-Alpes, same
in France. Prof. Barrios currently is associate professor at Universidad Indus-
[38] projectq, «ProjectQ,» May 2019. [En línea]. Available: trial de Santander in Bucaramanga, Colombia and director of the High Perfor-
https://projectq.ch/. mance and Scientific Computing Center of the same University. He is ACM
[39] fernandodelaiglesia y Takishima, «ProjectQ,» May 2019. [En and IEEE Computer Society Senior Member and he collaborate and leads dif-
ferent worldwide projects related with HPC and Advanced Computing. Pre-
línea]. Available: https://github.com/ProjectQ-
Framework/ProjectQ. [Último acceso: 2020].

© The authors; licensee Universidad Nacional de Colombia.


DYNA 81 (184), pp. 1-2. April, 2014. Medellín. ISSN 0012-7353 Printed, ISSN 2346-2183 Online
DYNA
http://dyna.medellin.unal.edu.co/

cisely, his research interests include advanced and High-Performance Compu-


ting, large scale systems and sustainable computer architecture. Recently, he is
interested in computer science aspects of quantum and non-Von Newman com-
puter architectures.
ORCID: http://orcid.org/0000-0002-3227-8651

© The authors; licensee Universidad Nacional de Colombia.


DYNA 81 (184), pp. 1-2. April, 2014. Medellín. ISSN 0012-7353 Printed, ISSN 2346-2183 Online

You might also like