03 Algorithm and Error Correction New Updates
03 Algorithm and Error Correction New Updates
information
ID
Raghav G. Jha
Abstract
We discuss basic fundamentals of quantum computing and information - quantum gates, circuits,
algorithms, theorems, error correction, methods for unitary time-evolution and provide a collection
of Qiskit1 programs and exercises for the interested reader.
Note: Some of the material is based on lectures given at Rensselaer Polytechnic Institute (RPI)
Summer School in June 2022, Hampton University Graduate Studies (HUGS) program and Quan-
tum Computing Bootcamp at Jefferson Lab in June 2023. I thank the organisers of those programs
for inviting me to teach and learn about this research area. Please send suggestions/corrections to
[email protected]
Contents
1 Introduction 1
8 Future 60
9 Acknowledgements 60
2
C Sample programs using Qiskit 72
C.1 Installing package and quantum hello world . . . . . . . . . . . . . . . . . . . . . . 74
C.2 Some basic operations using qubits and gates . . . . . . . . . . . . . . . . . . . . . 75
C.3 Quantum full-adder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
C.4 Grover’s algorithm with general diffuser routine . . . . . . . . . . . . . . . . . . . . 79
C.5 Implementing QFT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
C.6 Bit-flip code, Phase kickback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
C.7 VQE solution to anharmonic quantum oscillator for three qubits . . . . . . . . . . 84
C.8 Phase estimation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
C.9 Decomposing any unitary in single-qubit and CNOT gates . . . . . . . . . . . . . . 89
C.10 Sample Mathematica code for to compute vN entropy . . . . . . . . . . . . . . . 90
References 92
3
Section 1
Introduction
One of the quotes that profoundly expresses the present state of the development in quantum
computation and information is by Wheeler. In his colorful language, he said - ‘I think of my
lifetime in Physics as divided into three periods. In the first period, I was in the the grip of the
idea that everything is particles. I call my second period, everything is fields, and now I am in the
grip of a new vision that everything is information’. In fact, we can safely add ‘quantum’ to this
since it appears that everything is ‘quantum information’. There are several physicists who have
explored this line of thought, see for example Refs. [1–3] and references therein to start a trail.2
The goal of theoretical physics is to understand the principles that govern the universe at
different length scales. It is a challenging problem since the associated scales vary over a wide
range (about thirty orders of magnitude) from inside the nucleus (10−15 m) to the size of typical
galaxies (1015 m). We have two extremely accurate theories that govern each of them separately.
The incredible progress made in the last 125 years has given us the basic principles of quantum
mechanics and the special theory of relativity which when combined into the framework of ‘quantum
field theory’ (QFT) holds the key to explaining a major portion of all physical phenomena occurring
in nature at sub-nuclear scales and culminating in the Standard Model of particle physics. Some
jewels of this framework are - calculating the magnetic moment of the electron to about ten decimal
places, and the discovery of the Higgs boson at the Large Hadron Collider (LHC) at CERN. On
the other hand, at the other extreme of the spectrum, we have the highly successful theory of
general relativity which describes classical gravity, predicts the existence of black holes and has
been tested to great accuracy culminating with the discovery of gravitational waves.
Another topic close to physicists is that of computing and since computing is a physical process
it is governed by the laws of Physics. Computers3 have changed and affected every facet of life
around us. From handling complex machines like airplanes to the RSA (Rivest–Shamir–Adleman)
2
The quintessential example of how crucial information is can be understood from a well-known paradox due to
Maxwell (1867). This is known as ‘Maxwell’s demon’. This thought experiment is an apparent violation of the second
law of thermodynamics. Szilard wrote an interesting paper in 1929 which took a big step towards the resolution,
but it did not ’totally’ explain the paradox. It was Landauer’s work [4] and Bennett’s follow-up [5] that was resolved
after 115 years and was one of the major problems that raged physicists throughout the century. The solution
lies in the fact that information is physical, just like the entropy or energy in thermodynamics. Additionally, it is
interesting to note that von Neumann in his letter to Teller on April 8, 1947 wrote - “I have some definite ideas
concerning automata, memory, clearing, and irreversibility and entropy, somewhat connected to Szilard’s treatment
of Maxwell’s demon and my old treatment of entropy and observability in quantum mechanics” [p. 245, John von
Neumann Selected Letters, American Mathematical Society (October 1, 2005)] but we believe it was never written
up by either of the Martians. The statement appears to the author to be closely related to the idea of erasure and
non-violation of the second law as established by Landauer et al.
3
Computer is a machine that maps an array of bits (0 and 1) from one configuration to another. If it manipulates
quantum bits, it is called a quantum computer.
1
key protocol, which forms the basis of all Internet transactions. But there are certain classes of
problems where even the fastest supercomputers of today’s era fail. They fail because we have
to wait for thousands of years to solve a problem using classical ideas of bits, on which they
are based. Though classical computation has rapidly progressed to the extent that we can now
have a billion transistors in a single laptop, it is probably not possible that the size of these
transistors can be made smaller than the size of say hydrogen atom which is about 10−10 m or
the frequency of the clock speed can be increased more than 1 PHz (1015 Hz) which is roughly
the frequency of atomic transitions. So, it is clear that supercomputers will soon exhaust their
capability, and problems with exponential complexity won’t be solved using them. This leads to
a paradigm shift in our idea of computing. Along this direction, already in the 1970s, Benioff
started thinking about the theoretical feasibility of quantum computing and his paper [6, 7] which
described a quantum mechanical model of Turing Machines was one of the first papers in the field
of quantum computing. This work was based on a classical description in 1973 of reversible Turing
machines from Ref. [8]. In the same year, there was another work [9] by Russian mathematician
Manin who argued that the superposition and entanglement features of quantum mechanics would
make for a substantial speedup compared to classical methods. Soon after, Feynman [10] argued
that quantum computers will be better suited to these tasks than any classical computer we can
ever build because they can store much more information compared to classical computers. He
pointed out that - ‘Let the computer itself be built of quantum mechanical elements which obey
quantum mechanical laws’. In the early days of quantum computing, Poplavskii argued [11] - “The
quantum-mechanical computation of one molecule of methane requires about 1042 grid points.
Assuming that at each point we have to perform only 10 elementary operations, and assume that
those calculations are performed at temperatures of 0.003 Kelvin, we would still have to use all
the energy produced on Earth during the last century”. This makes it clear that a full-fledged
computation of quantum dynamics is beyond the reach of any classical computer. Nature is
quantum mechanical and hence we have to make use of it. These problems and ideas gave rise to
the field of quantum computation. In summary, quantum computation addresses one of the two
issues that limit any classical computation: space (memory) and time. In quantum computers, we
can store exponentially large information, so it is memory-wise way more efficient than its classical
counterpart. We provide the first twelve years of the timeline of quantum computing in Fig. 1.
The usefulness of classical computers has been a monumental achievement of human mankind
in the past century. The basic fundamental idea of classical computers (or computing) is the
binary two-state signal: 0 and 1. It is practically the only thing a computer understands at its
most fundamental level. A computer practically does two things: 1) it stores information as a string
of 0s and 1s (also known as classical bits), and 2) Transform them based on the instructions given.
It achieves the second task by using gates which perform simple logic operations to transform bits.
Some examples of such gates are AND, NOT, OR gates. However, we know that at the microscopic
level, the laws of Physics and hence nature is purely quantum-mechanical. It marks a paradigm
2
1981: Feynman gives a seminar at MIT in the summer and observes that it is impossible to
simulate an evolution of a quantum system on a classical computer in an efficient way. He
proposes a basic model for a quantum computer that would be capable of such simulations.
Around the same time Toffoli introduces the reversible doubly-controlled quantum NOT gate.
1980: Manin publishes his paper (in Russian) and proposes the idea of
quantum computer for the first time. See text and references for detail.
1976: Polish physicist Ingarden shows that Shannon information theory can-
not be directly generalized to the quantum case because in the usual quan-
tum mechanics of closed systems there is no general concept of joint and con-
ditional probability. He showed, however, that it is possible to construct a
quantum information theory which is a generalization of Shannon’s theory.
1973: Holevo publishes paper showing that n qubits cannot carry more
than n classical bits of information. This was a surprising result. Around
same time, Bennett showed that computation can be done reversibly.
1969/1970: Wiesner discusses with Bennett his idea on conjugate coding which
he argued can be used for printing bank notes (quantum money) that would be
impossible to counterfeit. The exact date of the idea is not known since the pub-
lished version is much later in 1983. Wiesner tried to publish it earlier by sub-
mitting to the IEEE Transactions on Information Theory, but, it was rejected.
shift in our understanding compared to the classical world, which is deterministic. In simple terms,
this means that while a classical bit can at a given time be either 0 or 1, a quantum bit (known as
‘qubit’) 4 can be in a superposition of these two options and hence we can never conclude exactly
which one until we measure it. The existing quantum devices contain O(100) qubits but they are
noisy, so actual efficiency might be a small
1 fraction of it. They are sometimes referred to as ‘Noisy
Intermediate-Scale Quantum (NISQ)’ devices are also sometimes referred to as ‘NISQ era’.
To understand the power of principles of quantum mechanics, consider the amount of digital
data in the world. It is estimated that the total digital data in the world by 2025 will be close
to 175 ZB (1 ZB = 1021 bytes). This data can be contained in total if we have about 78 fully
efficient qubits. This is the power of qubits (growth of ‘power of 2’).5 However, such power often
4
If the vector space dimensions is d > 2, then it is called qudits. If we have qudits with d → ∞, then we refer to
it as ‘qumodes’ or a continuous variable (CV) system. A quantum harmonic oscillator is one example.
5
Once a king offered any reward to a man who had done good for the kingdom. The man asked that a single
3
comes with its own set of troubles and limitations. For a review of quantum algorithms and other
details, see Ref. [12]. As of today, there exists only a handful of useful6 quantum algorithms,
and it is not yet known how many classes of problems will eventually benefit by exploiting the
quantum features. One of the major applications of quantum computing is in the field of quantum
many-body systems. The mightiest of computers today in the world cannot deal fully (without
approximation and problems) with even a quantum system of highly interacting 100 electrons!
Therefore, solving this is one of the major challenges in theoretical and computational Physics.
Even though we only have a relatively small (< 100) number of non-error corrected qubits and
the implementation faces several problems, it is expected that in the coming 2-3 decades the
situation will change drastically. Even 100-200 error-corrected qubits in the future can completely
revolutionize the nuclear computations and the whole of quantum chemistry and several areas of
Physics.
Though we will mostly restrict to the theoretical side of quantum computing in these notes,
it is good to point out some basic ideas about the experimental side of this story. The act of
fabricating a proper logical qubit is a challenging task. In order to actually realize a quantum
computer, we need to have qubits that can retain their properties and those which can be made to
evolve/change as computationally desired. We must also prepare qubits in some initial state and
measure them conveniently. In order to construct a computer as envisaged by Manin and others
with these properties, DiVincenzo in 2000 [13] listed some conditions necessary to achieve this
based on his attempts to construct a quantum computer (a machine that can efficiently simulate
quantum systems such as solving the quantum many-body problems). These conditions are now
known as ‘DiVincenzo criteria’ and are mentioned below:
These conditions are for quantum computation, such as superconducting quantum computing or
trapped ion approaches. There are two more conditions that apply to quantum communication.
grain of rice be placed on the first square of the chessboard. Then two grains on the second square, four grains on
the third, and so on, and doubling each time. The king was taken aback by such a small request and agreed. He
ordered the treasurer to pay the sum agreed upon. After a few days, the treasurer explained that the sum could not
be paid since by the time he got halfway through the board, the amount of grain required was more than the entire
kingdom possessed. This is the exponential growth known to kings several thousand years before. I first heard this
story from my grandfather when I was 8, however, this is now easily found online and also appears in some popular
science books.
6
Polynomial or exponential speedup compared to best-known classical algorithms
4
In order to understand these two conditions, we have to explain stationary and flying qubits.
Stationary qubits are those which are in the computer and on which we apply gates while flying
qubits are ones that move (say, like photons). With these definitions, the last two conditions are:
The experimental challenge is that these conditions can often only be partially met. Single photons
have two polarization states and are almost ideal qubits, but the optical material required to
make them interact is difficult in practice without loss of coherence. One can represent spin-1/2
particles as qubits as is often done theoretically and experimentally for the trapped ion method
to quantum computing, but the phonons that are used to mediate the interactions have short
coherence time. Another approach is to use electric charge as a qubit representation and use
excellent techniques from modern electronics, but even here lies the problem of decoherence. One
advanced approach is to use charge carriers in not a usual metal but in a superconductor. The
superconductor qubit representation is favored due to the robustness of the Cooper pairs involved.
In fact, there are now some advancements achieved over this as well. As of today’s technology,
we have some major categories for these constructions. The first is the ‘superconducting qubits’
(SC). It was first observed that Josephson junction (JJ)8 is the element that provides the condition
to turn a superconducting circuit into a qubit. One example is Google’s Sycamore 53-qubit chip,
which belongs to this category. In fact, these quantum processors use an advanced version of
this which has more than one JJ and is known as ‘transmons’ which is the shortened name for
‘transmission line shunted plasma oscillation qubit’. Both IBM and Google quantum processors
use this modified qubit approach. It is closely related to the charge qubit (cooper pair box) but has
better effectiveness due to improvement in decoherence time. There is another approach known as
‘topological qubits’ (Microsoft, Bell Labs) which underlies the application of Majorana fermions to
create qubit states. There are other technologies based on trapped ions, silicon dots (Intel), and
diamond vacancies. We will not discuss these here, since it would really digress us from the goal
of this article.
In these notes, the emphasis is to introduce the idea of quantum computing inspired by the
connection to classical computing and then use some SDKs to perform some simple computations
on IBM’s backend machines. These are not meant to be exhaustive, and the purpose is not to
solve some model in Physics which cannot be solved in a reasonable time using computers we
have today, but to introduce the elements which might in coming decades be part of advanced
quantum algorithms and computation that can achieve those dreams. However, we want to make
7
Flying qubits have restricted use compared to stationary qubits. They are only used to pass the information
over some distance, whereas stationary qubits have a two-fold task: store information and perform calculations.
8
A Josephson junction is made of a non-superconducting material between two layers of superconducting elec-
trodes. A Cooper pair of electrons can tunnel through the non-superconducting barrier from one superconductor to
another.
5
it clear to the reader that even with quantum computing and reliable error correction some physical
problems might still not be solved in polynomial time. In order to understand this issue, one must
talk in terms of complexity classes i.e., the problem of how the computational resources scale
with increasing system size. This is one of the main problems in computer science. We say
that P is the set of problems where time scales as polynomial in system size on a deterministic
Turing machine. This is also sometimes referred to as a problem that can be solved9 efficiently.
The classical complexity classes introduced for Turing machines of both kinds (deterministic or
probabilistic) have since then been extended to admit quantum complexity classes. For example,
BQP stands for bounded-error quantum polynomial time and is referred to as the class of decision
problems solvable by a quantum computer in polynomial time. It is the quantum analog of the
complexity class BPP10 . But since a quantum circuit can simulate a classical one, both P, and
its probabilistic analog, BPP, are contained in BQP. From a perspective of a physicist, it is
important to know which problems belong to this complexity class since that would potentially
benefit the most from the quantum computers in the future. For instance, the preparation of
ground state of Hubbard model is not in BQP but the time evolution is. It is also known that
the scattering problem in interacting QFT lies in BQP. In fact, not all physical problems lie in
BPP or BQP, some of them belong to NP which stands for non-deterministic polynomial time
requiring more than polynomial resources assuming that P ̸= NP11 but whose solution can be
verified in polynomial time. The quantum analog of NP with polynomial intractable problems is
denoted by QMA12 , and problems that belong to this class are unlikely to be solved efficiently
even with a quantum computer assuming BQP ̸= QMA. QMA-hard (defined similarly to NP-
hard), is a class of problems if every problem in QMA can be reduced to it. A problem is said
to be QMA-complete if it is QMA-hard and in QMA. One of the motivations for quantum
computers is the potential to solve interesting problems which are NP hard like the model with
sign problems. These cannot be efficiently solved on classical computers. However, some of these
might still not belong to BQP and therefore might still be inaccessible with quantum resources.
For example, it was shown in Ref. [14] that scattering in scalar QFT is BQP-complete, indicating
that all problems in BQP can be mapped to scattering in scalar QFT with polynomial scaling time
to solution, and further that the scattering problem itself is in BQP and thus can be efficiently
simulated quantum mechanically. We say a problem is BQP-complete when it is both BQP and
9
It is interesting to note that Gödel’s letter to von Neumann in 1956 (when the latter was in the hospital)
discussed a function ϕ which has some relation to complexity classes. It is probably the first written instance of P
versus NP issue. However, since von Neumann died early 1957, his answer to this letter was never known.
10
BPP is class of decision problems or languages that can be solved in polynomial time by probabilistic Turing
machines with error probability bounded by 1/3
11
P ̸= NP has enormous practical and economic importance because modern cryptography is based on assumption
that they are not equal. This means that there exist problems that are impossible for computers to solve, but for
which the solutions are easily checked (polynomial). A failure of this could create havoc in modern cryptography
resulting in breakdown of secure transactions all over the world.
12
QMA is an acronym for Quantum Merlin Arthur
6
BQP-hard. Similarly, for the classical version, this means that a problem is said to be NP-hard
if everything in NP can be transformed in polynomial time into it even though it may not be in
NP. Conversely, a problem is NP-complete if it is both in NP and NP-hard.
We now give an outline of the notes. In Sec. 2, we explain the notation and basic fundamentals.
In the next section, we introduce the idea of quantum states, quantum logic gates, density matrices,
and the important quantum Fourier transform method. In Sec. 4, we mention several quantum
algorithms such as phase kickback, Deutsch algorithm, Grover’s search algorithm, Kitaev’s phase
estimation, and Shor’s algorithm. In Sec. 5, we discuss the variational quantum eigensolver (VQE)
method to solve some simple problems. In Sec. 6, we mention an important feature of quantum
computing i.e., quantum error correction and explain bit and phase flip and universal code to
correct arbitrary (phase or flip) single-qubit errors. In the Appendix, i.e., Sec. C, we provide
codes and instructions on how the user can run some simple simulations on a web browser (Google
Collaboratory).
Section 2
Before we delve into describing the notations and discussing basic ideas, we emphasize and point
out the differences between digital classical and quantum computing in Table 1. We will restrict
to the well-known Dirac’s13 bra-ket notation[17] which deals with states in Hilbert space based on
von Neumann abstract and mathematical precise formulation of quantum mechanics written down
around 193214 . We will briefly review this for interested readers. Suppose we have a column and
13
Probably inspired by Grassmann’s similar notation used several decades before
14
It might be surprising that just about three years later in 1935, he wrote to Birkhoff from 1935 – ‘I would like to
make a confession which may seem immoral: I do not believe in Hilbert space anymore’. We encourage the interested
reader to explore this direction if interested.
7
Figure 2. Estimate of the equivalent classical computation time assuming 1M CPU cores for quantum
supremacy circuits as a function of the number of qubits and a number of cycles for the Schrödinger-
Feynman algorithm. The star shows the estimated computation time for the largest experimental circuits.
To know more about Schrödinger-Feynman (SF) algorithm, please see Ref. [15] and references therein.
In short, Schrödinger’s method takes about m2n time and about 2n memory, while Feynman’s method
takes about 4m time and about m + n memory. Feynman’s algorithm saves memory because it calculates
an amplitude instead of keeping track of the state vector throughout like in the Schrödinger approach.
However, the fact that more intermediate steps are to be done means more time. There are some methods
that combine features of both, and those belonging to the class of SF algorithms. This figure is taken from
Ref. [16]. This diagram is only meant to provide a basic idea and should not be taken at face value.
We can do two operations using them by computing the inner product, i.e., ⟨A|B⟩ or the outer
product denoted by |A⟩ |B⟩. The first returns a number, while the latter gives a matrix. The row
vector is called ‘bra’ while the column vector is called ‘ket’ and they are both dual to each other
(in the vector space sense). This state denoted as ‘ket’ is postulated to contain all the information
8
about the physical state which we wish to know. We have the following relations: ⟨A|† = |A⟩,
and |A⟩† = ⟨A|. In quantum mechanics, the state of a system is described by a ray |ψ⟩ in Hilbert
space, H where the ray has unit norm. If we have, λ = eiϕ then we see that |ψ⟩ and λ |ψ⟩ both
have the same norm because λ is just a phase, and they represent the same physical state. The
phase of the ray is not an observable. The rays of Hilbert space H are the equivalence class of
unit vector that only differ by a phase. Two states can be added together as: |α⟩ + |β⟩ = |γ⟩. In
fact, if |ψ0 ⟩ and |ψ1 ⟩ are two orthogonal states, then their linear superposition (c1 |ψ0 ⟩ + c2 |ψ1 ⟩)
is also a well-defined state but must satisfy |c1 |2 + |c2 |2 = 1. We refer to c1 and c2 as ‘amplitudes’
corresponding to |ψ0 ⟩ and |ψ1 ⟩ respectively. We can multiply a ket by a complex number c as:
|α⟩ = c |ψ⟩ or |ψ⟩ c, however, physically speaking there is no difference between |α⟩ and |ψ⟩ as
discussed above. When we want to measure an observable, we apply the corresponding operator
from the left on the ket as: A · |ψ⟩ or  |ψ⟩. Two kets denoted by α and β are said to be orthogonal
if: ⟨α| |β⟩ = ⟨α|β⟩ = ⟨β|α⟩∗ = 0. There are also some operations that are not allowed. The
operator must be either on the left of ket or on the right of a bra, i.e., |ψ⟩ A, A ⟨ψ| are both
incorrect for an operator A. Some products like |α⟩ |β⟩ are not allowed if the ket vectors belong
to the same vector space. Note that when we write |01⟩ = |0⟩ |1⟩ later on, we mean vector spaces
of two distinct qubits so it is allowed. The expectation value of any observable corresponding to
the Hermitian operator A is given by: ⟨A⟩ = ⟨α|Â|α⟩. In fact, we can also write this as:
a′ ,a′′ a′
Consider a spin-1/2 particle with spin-up |↑⟩ or down |↓⟩. The Hilbert space in this case is
two-dimensional with two orthonormal basis which we denote as |0⟩ and |1⟩. This is an example
of a quantum bit (‘qubit’). One often refers to the orthonormal basis {|0⟩ , |1⟩} as computational
basis. Any state |α⟩ can be decomposed as a convex combination of projectors onto pure states 15
i.e., |α⟩ = i pi |ψi ⟩ ⟨ψi |α⟩. In quantum computation, we have the following standard definitions:
P
1 0
! !
|0⟩ = , |1⟩ = . (2.2)
0 1
These are one-qubit state. We can have two-qubit states as well, and then we use shorthand like
0 0
0 0
|00⟩ = |0⟩ |0⟩ = |0⟩ ⊗ |0⟩, |10⟩ = |1⟩ |0⟩ and so on. Therefore we have, |10⟩ =
, |11⟩ = and
1
0
0 1
so on. We refer to a state as ‘normalized’ if ⟨ψ|ψ⟩ = 1. This is called the inner product of a ‘bra’
and ‘ket’. For readers comfortable with this notation, nothing remains to be said, but for those
who are new, we give a small example of ‘bra-ket’ gymnastics now. Suppose we have a system
in state |i⟩ and another in |j⟩, then the composite state is written as |ij⟩ = |i⟩ |j⟩. For example,
15
Often mentioned as ‘inserting an identity’
9
⟨j| ⟨i| |k⟩ |l⟩ = |ij⟩† |kl⟩ = ⟨j| ⟨i|k⟩ |l⟩ = ⟨i|k⟩⟨j|l⟩. One can also define an ‘outer product’ as, |ψ⟩ ⟨ϕ|
which is a matrix. Suppose we take |0⟩ , |1⟩ and construct ρ = 1/2(|0⟩ ⟨0| − |0⟩ ⟨1| − |1⟩ ⟨0| + |1⟩ ⟨1|).
The matrix ρ is given by:
1 1 −1
!
ρ= .
2 −1 1
More systematically, we define the outer product as:
! !
α αγ ∗ αδ ∗
|ψ⟩ ⟨ϕ| = γ ∗ δ∗ = . (2.3)
β βγ ∗ βδ ∗
In fact, any square matrix can be written as a linear combination of outer products. The simplest
example is to write any 2 × 2 matrix in this form given by:
A = A00 |0⟩ ⟨0| + A01 |0⟩ ⟨1| + A10 |1⟩ ⟨0| + A11 |1⟩ ⟨1| (2.4)
This representation of a matrix in terms of ‘ket-bra’ also provides a simple interpretation of some
quantum gates. For example, |00⟩ ⟨00| + |01⟩ ⟨01| + |10⟩ ⟨11| + |11⟩ ⟨10| gives a representation of
CNOT gate16 and implies the corresponding transformation.
Example 1: Consider |ψ⟩ = |a⟩ ⊗ |b⟩, A |a⟩ = a |a⟩, and B |b⟩ = b |b⟩. Compute A ⊗ B |ψ⟩.
Proof. We can write A ⊗ B |ψ⟩ as A ⊗ B |ab⟩ = (A ⊗ B) |a⟩ ⊗ |b⟩ and then by distributing the
operators write this as A |a⟩ ⊗ B |b⟩ = ab |ψ⟩.
Section 3
In classical logic gates, the input signal can be a string of either 1 or 0 and there is a single output
signal. The classical gates can be reversible or non-reversible. The NOT gate is an example of a
reversible gate. For example, to see this clearly, consider the truth table representing the action
of a XOR gate for two input classical bits, A and B. The output is given by A ⊕ B. We mention
this along with other two logic gates in the table below.
A B AND (A · B) OR (A + B) XOR(A ⊕ B)
0 0 0 0 0
0 1 0 1 1
1 0 0 1 1
1 1 1 1 0
16
We will soon learn about this gate in the next sections
10
Figure 3. The construction of NAND gate using transistor and diodes. The Z is the output and the T-
shaped sign signals the input +V voltage. We say the input is high (1) if it is +V while it is 0 if grounded.
This can be extended easily to have three input lines, the output is given by A ⊕ B ⊕ C and will be
high (1) if the number of highs in the input is an odd number. The fact that there is a single output
line clearly implies that we can never run this operation backward. Given an output, we can never
know what was the actual input. So XOR seems like a non-reversible gate. However, if we allow
a garbage output (say A), then XOR can be made reversible. The AND gate is not reversible
(even if we allow an extra output bit). NAND and NOR are the universal gate set for classical
computers (which means that any gates can be constructed from them). The representation of a
NAND gate made up of two transistors is shown below.
11
|0⟩
|ψ⟩
θ
|α⟩
φ
X, |+⟩
|1⟩
Figure 4. The representation of the possible states of single qubit on the Bloch sphere. We have |α⟩ =
√1 (|0⟩ + i |1⟩) and |ψ⟩ = cos(θ/2) |0⟩ + eiφ sin(θ/2) |1⟩ which is just P (ϕ)Ry (θ) |0⟩. The Z-basis is the
2
‘computational basis’.
0 1 0 0
(3.2)
0 0 0 1
0 0 1 0
and the truth table in this case can be written as:
|A⟩ |B⟩ |A⟩ |A ⊕ B⟩
|0⟩ |0⟩ |0⟩ |0⟩
|0⟩ |1⟩ |0⟩ |1⟩
|1⟩ |0⟩ |1⟩ |1⟩
|1⟩ |1⟩ |1⟩ |0⟩
17
Note that this is mathematically referred to as ‘Riemann sphere’ and is denoted as CP1 which is ≡ SU (2)/U (1)
12
This can also be written as:
where σx is one of the Pauli matrices. For this gate, we have two outputs (unlike classical XOR
gate) and the first output is sometimes called ‘garbage output’ since it is just the first input. The
second input (|B⟩) is called the ‘target’ while the first is called the ‘control’ (or control line) for
obvious reasons. The CNOT gate is a two-qubit operation, in which the first qubit is usually
referred to as the control qubit and the second qubit as the target qubit. Now suppose an input
α
β
state is given by |ψ⟩ = , it is easy to check that if we pass it through CNOT gate, it will
0
0
remain unchanged. We leave this simple exercise for the reader. There are many other important
quantum gates such as the Pauli-X (simply X) which is a rotation through π radians around the
x-axis and similar for other directions (y and z):
01
!
X = σx = σ1 =
10
0 −i
!
Y = σy = σ2 =
i 0
1 0
!
Z = σz = σ3 = .
0 −1
These three matrices also have corresponding rotation matrices, such as RX (θ) = exp(−iXθ/2).
X basis is also called Hadamard basis, since it can be generated from computational basis (Z) by
acting by H. In Fig. 4, we denoted the state |ψ⟩ = cos(θ/2) |0⟩+eiφ sin(θ/2) |1⟩. The outer product
of this state is closely related to the dot product of the unit vector in spherical coordinates18 with
Pauli matrices as:
18
Recall that (n1 , n2 , n3 ) = (cos ϕ sin θ, sin ϕ sin θ, cos θ)
13
cos 2θ
!
|ψ⟩ ⟨ψ| = cos θ −iϕ
e sin θ
eiϕ sin 2θ 2 2
Example 2: Show that n̂ · ⃗σ = cos θ |0⟩ ⟨0| + e−iϕ sin θ |0⟩ ⟨1| + eiϕ sin θ |1⟩ ⟨0| − cos θ |1⟩ ⟨1|
Then using eiθ = cos θ + i sin θ and matrix representations of |00⟩ ⟨00| , |01⟩ ⟨01| , |10⟩ ⟨10|, and
|11⟩ ⟨11|, we obtain the required.
Example 3: Show that any single qubit unitary can be written as:
Proof. We now give the proof of the above example. We can define general U as:
!
a b
U= .
c d
14
We have constraints: |a|2 + |c|2 = 1, |b|2 + |d|2 = 1, and a∗ b + c∗ d = 0. Then we have,
The last condition (orthogonal columns) gives: ei(α11 −α12 ) + ei(α21 −α22 ) = 0, where α11 is related to
the other three by α11 = α12 + α21 − α22 + π. Now we can set θ = γ/2, α12 = α − β/2 + δ/2 + π,
α21 = α + β/2 − δ/2, and α22 = α + β/2 + δ/2.
Another useful quantum gate which is an extension of CNOT gate is known as controlled-
controlled NOT (CCNOT) gate or Toffoli gate. This is a three-qubit operation defined by:
1 0 0 0 0 0 0 0
0 1 0 0 0 0 0 0
0 0 1 0 0 0 0 0
0 0 0 1 0 0 0 0
(3.6)
0 0 0 0 1 0 0 0
0 0 0 0 0 1 0 0
0 0 0 0 0 0 0 1
0 0 0 0 0 0 1 0
resulting in
|000⟩ → |000⟩
|001⟩ → |001⟩
|010⟩ → |010⟩
|011⟩ → |011⟩
|100⟩ → |100⟩
|101⟩ → |101⟩
|110⟩ → |111⟩
|111⟩ → |110⟩ (3.7)
▶ Question 1: Write the Z and P gate in the outer product notation and compute the action
of P on a general qubit state.
In fact, Toffoli and any single qubit gate which does not preserve the computational basis (such
as Hadamard) form a universal gate set [18] for quantum computation. But, Toffoli by itself is
15
1 1
= √1 , |0⟩
H 2
1 −1 H |+⟩
0 1
X = , |0⟩ X |1⟩
1 0
1 0
Z = , |1⟩ Z − |1⟩
0 −1
0 −i
Y =
i 0
1 0
P =
0 eiϕ
−iθ/2
e 0
Rz (θ) = iθ/2
0 e
10
S =
0 i
−iπ
1 0 iπ e 8 0
T = iπ4 = e 8 iπ
0e 0 e8
Figure 5. Definition of Hadamard (H), Paulis (X, Z, Y ), Phase (P ), Rotation around z-axis (Rz (θ)), π/2
phase (S) and π/8 (T ) single qubit gates and example of how some of them act on a single qubit.
universal for classical computation. Hence, it appears that one only needs to add the Hadamard
gate to make a ’classical’ set of gates quantum universal. And this is true and was proved in
Ref. [19]. Another interesting fact about Toffoli which is often required is how can we efficiently
decompose it into say two-qubit CNOT gates. In Ref. [20], it was shown that one needs at least
2n CNOT to implement any n-qubit Toffoli. For the standard case of n = 3, one needs at least 6
CNOTs. In some of the algorithms we discuss later in the notes, another important operation is
16
the swapping of qubits. This is represented by the matrix as:
1 0 0 0
0 0 1 0
SWAP =
0 1 0 0
0 0 0 1
The gate achieves |a, b⟩ → |b, a⟩ and can be written in terms of CNOT gates as: 19
|a⟩ × • • (3.8)
=
|b⟩ × •
A closely related version of this – which is often used to reorder or swap qubits with a control is the
controlled SWAP (also known as ‘Fredkin gate’ 20 )is an important gate that can be implemented
as: qc.cswap(0,1,2). We can see how this gate can be decomposed in terms of CNOT gate in
Qiskit as:
qc.decompose().draw(output=’mpl’,style=’iqx’). The representation of the gate is given
below:
10000000
0 1 0 0 0 0 0 0
0 0 1 0 0 0 0 0
0 0 0 1 0 1 0 0
CSWAP = |0⟩⟨0| ⊗ 1 ⊗ 1 + |1⟩⟨1| ⊗ SWAP = (3.9)
0 0 0 0 1 0 0 0
0 0 0 0 0 0 1 0
0 0 0 0 0 1 0 0
00000001
and is represented by the following symbol:
•
×
×
which means in our notation, |0, a, b⟩ → |0, a, b⟩, and |1, a, b⟩ → |1, b, a⟩ respectively. The use of
control feature can be extended to any unitary gate. For example, consider the controlled RX gate
where the transformation is defined by the matrix:
cos( 2θ ) −i sin( 2θ )
!
RX = .
−i sin( 2θ ) cos( 2θ )
19
We can see this as follows: |a, b⟩ → |a, a ⊕ b⟩ after application of first CNOT gate. Then the second CNOT (note
with control now down and target on upper qubit) transforms |a, a ⊕ b⟩ → |a ⊕ (a ⊕ b), a ⊕ b⟩ = |b, a ⊕ b⟩. Then the
last CNOT transforms this to the desired |b, a⟩
20
For a photonic based quantum computing implmentation of this gate, see Ref. [21]
17
If we want to build a controlled-RX gate then the matrix is given by a 4 × 4 matrix:
1 0 0 0
0 cos( 2θ ) 0 −i sin( 2θ )
CRX = . (3.10)
0 0 1 0
0 −i sin( 2θ ) 0 cos( 2 )
θ
This gate is included in Qiskit like other gates we have discussed above. It can simply be called
by doing qc.crx(π/2,0,1) but double controlled RX gate is not included in usual gate library in
Qiskit and we leave the design of this gate for the interested reader. In addition to the RX gate
(which corresponds to rotation along x-axis), we can have RY or RZ gates. A general rotation
gate is represented as:
" #
−iθ
R⃗n (θ) = exp n1 X + n2 Y + n3 Z (3.11)
2
cos(θ/2) − in3 sin(θ/2) −n2 sin(θ/2) − in1 sin(θ/2)
!
= .
n2 sin(θ/2) − in1 sin(θ/2) cos(θ/2) + in3 sin(θ/2)
b) Suppose we act with Ry (3π/4) on starting state |0⟩. What is the probability that we measure
the state we started with? Recall that Ry (θ) is defined as:
cos(θ/2) − sin(θ/2)
!
. (3.13)
sin(θ/2) cos(θ/2)
21
Note that the matrices have θ rather than θ/2. This is due to the fact that rotations on Bloch sphere by θ
corresponds to θ/2 for the SU (2) unitary matrices due to double cover relation between SO(3) and SU (2)
18
▶ Question 4: Show that
1
" #
H · S · T · H |0⟩ = 1 + ei3π/4 |0⟩ + 1 − ei3π/4 |1⟩
2
•
•
Though we will use the modern notation for CNOT, the old notation used by Feynman [22] was
instead:
• ×
× •
Furthermore, a slightly more complicated circuit with multiple control lines and an arbitrary gate
U can be drawn as:
• U
•
• •
•
It is easy for the reader to see that if we have two qubits and act with H on the first qubit and
then apply CNOT gate, it results in an entangled state. For three qubits, this is more interesting.
Three qubits can be entangled in two ways that are not related to each other. One of them is called
the GHZ state and the other is known as W-state [23]. The GHZ state is fully separable, while
the W state cannot be separated by any local operations and classical communication (LOCC).
These are defined as follows:
1
GHZ3 = √ |000⟩ + |111⟩ ,
2
1
W3 = √ |001⟩ + |010⟩ + |100⟩ .
3
It is straightforward to extend W state to its n-qubit version as:
1
|W ⟩ = √ |10 · · · 00⟩ + |01 · · · 00⟩ + · · · + |00 · · · 01⟩ . (3.14)
n
We can also define something called the ‘generalized’ GHZ state defined as:
It is easy to implement these states in Qiskit and we leave that for the reader. Going beyond the
discussion of single gates, for several purposes, some collection of quantum gates is often useful.
19
When these gates are collected together, they are referred to as a ‘set’. One of the examples is the
stabilizer set, which is given by a group of three gates: {H, CNOT, P } and the same as Clifford
group. These gates are important for error-correcting codes but do not form a universal set as
discussed later in the notes.
However, it was found that {CNOT, single-qubit unitaries (SU (2)} form a universal set of
gates but it is infinite. We would like this to be close to some finite gate set. A finite gate set can
only produce a countable set of gates and one would think that every unitary cannot be obtained
by this method. However, we do not need to get every unitary and this is where one of the most
important theorems in quantum information/computation comes into play. Solovay-Kitaev (SK)
theorem argues that if a single-qubit quantum gates generate a dense subset of SU (2) then that set
is guaranteed to fill SU (2) quickly (means it is possible to obtain a decent approximation to any
desired gate using gates from the generating set). We say that a subset S of a topological space
X is dense if every point x ∈ X either belongs to S or is a limit point of S. The special unitary
group SU (N ) is defined as the set of all N × N matrices with unit determinant. For example,
the Pauli matrices are the three generators of SU (2). There are two universal (approximately)
gate sets: {H, CNOT, π/8} as shown in Ref. [24] and {H, CCNOT, π/4} as shown in Ref. [25] and
CNOT plus all single-qubit gates [26]. Suppose we consider the gate set {H, CNOT, T(π/8)} and
ask how efficiently a given unitary transformation U can be implemented. This situation might
arise due to the limitation of applying only single-qubit gate most prominently when one required
fault-tolerant quantum computation where the features of fault-tolerance are available for selected
gates in Clifford group and π/8 gate. We would like to have a polynomial (in precision and number
of qubits) number of gates selected from this set. We ask this question because in general most
unitary transformations cannot be approximated precisely. The SK theorem can be useful in this
case. A direct consequence of this theorem is that a quantum circuit of N constant-qubit gates
can be approximated to ϵ error (in operator norm) by a quantum circuit of O(N logc (N/ϵ)) gates
from a desired finite universal gate set. Different proofs of the theorem give different values for c,
in Ref. [27], it was shown to be ∼ 3.97. This theorem computes how many gates are needed to
approximate a given operation for the specified accuracy ϵ and is polylogarithmic in 1/ϵ. We now
write down the formal statement as below:
Solovay-Kitaev theorem: If S is a finite set of 1-qubit gates which is universal and if for any
gate g ∈ S, the inverse g −1 can be achieved by finite sequence of gates in S, then any 1-qubit gate
and hence (any unitary transformation) can be approximated using O(logc (1/ϵ)) gates with c < 4.
The basic algorithm is given below:
20
to obtain n − 1 -approximations to the unitary.
A single-gate set of universal quantum gates can also be formulated using the three-qubit
Deutsch gate given by:
1000 0 0 0 0
0 1 0 0 0 0 0 0
0 0 1 0 0 0 0 0
0 0 0 1 0 0 0 0
D= . (3.16)
0 0 0 0 1 0 0 0
0 0 0 0 0 1 0 0
0 0 0 0 0 0 i cos(θ) sin(θ)
0000 0 0 sin(θ) i cos(θ)
▶ Question 5: What does the following quantum circuit do? By what name do we know the
final state known as?
|0⟩ H •
|0⟩ •
|0⟩
▶ Question 6: Check that CNOT results in the following transformations given below, i.e.,
CNOT(X ⊗ 1) → (X ⊗ X)CNOT or alternatively CNOT(X ⊗ 1)CNOT† → (X ⊗ X) and so on.
• X ⊗1→X ⊗X
• 1⊗X →1⊗X
• Z ⊗1→Z ⊗1
• 1⊗Z →Z ⊗Z
It is also known that this gate can be constructed from a sequence of two-qubit gates [28]. It can
also be constructed from a two-qubit gate known as ‘Barenco gate’ [29] given by:
1 0 0 0
0 1 0 0
B= (3.17)
0 0 e cos(θ) sin(θ)
iα −ie i(α−ϕ)
0 0 −ie i(α+ϕ) sin(θ) e cos(θ)
iα
21
In fact, it was shown in Ref. [30] that the set {T, H} is universal and was shown to be true by a
short proof in Ref. [31]. The fact that T can perform all classical reversible computation makes it
clear that H gate which is in fact a quantum Fourier transform (QFT) over Z2 is the real ‘quantum’
difference!
Show that this transform for n-qubits i.e., H ⊗n can be written as:
1 X
H ⊗n = (−1)x·y |x⟩ ⟨y|
2n/2 x,y
▶ Question 8: Consider a control line in a superstition state and target in |0⟩. Pass this
through the CNOT gate and write the result (a Bell state). Show that the circuit given below
performs a measurement in the basis of Bell states. This exercise is reproduced from Exercise
4.33 of [11]. Find the measurement operators.
• H (3.18)
▶ Question 9: Show that the circuit below is another way of implementing Toffoli gate. Find
another decomposition of Toffoli gate?
|y⟩ • • |y⟩
We now discuss an important ingredient of the quantum circuit and it is related to the decompo-
sition in terms of CNOT and single-qubit gates. It is a well-known result that we can decompose
any 2n × 2n unitary matrix in terms of single-qubit unitaries and CNOT gates. Every single-qubit
unitary gate has 3 real parameters. So, for n qubits, we have 3n parameters. Once we add a CNOT
gate, it appears that we can add twice one-qubit unitaries resulting in 6 real parameters. However,
22
1010
107
104
10
5 10 15 20
Figure 6. The theoretical lower bound on the number of CNOTs needed to approximate arbitrary unitary
matrix. The upper bound is the cost attained using QSD in Ref. [32].
since the Rz gate commutes with the control line qubit and Rx commutes with the target qubit,
we can pass them across and this reduces the number of effective parameters added by CNOT to
4. Suppose we need N CNOTs to approximate a 2n × 2n matrix, then we have 3n + 4N ≥ 4n − 1
which gives:
1 n
N≥ 4 − 3n − 1 . (3.20)
4
Using quantum Shannon decomposition (QSD), it was shown in Ref. [32] that one can get the cost
down to:
23 n 3 n 4
N≥ 4 − 2 + . (3.21)
48 2 3
The difference between the lower bound and the implemented cost (about factor of 2) is shown in
Fig. 6.
mann (vN) measurement of |ψ⟩ with respect to the ϕ basis is described by orthogonal projectors
{|ϕk ⟩ , ⟨ϕk |} and will have the output k with probability:
von Neumann (vN) measurements are a special kind of projective measurement (which is also
known as Lüders measurement) which is complete. This is often used in quantum computing and
communication. We give the circuit which can implement a vN measurement below.
In fact, the idea of projective measurements is related to identifying which state the system
is in from the possible set of mutually exclusive states. Suppose, the atom is either in state
|a⟩ or |b⟩, through projective measurement we can find out the state it is in. These are based
on projection operators P which are Hermitian operators (P = P † , P 2 = P ). We refer to two
projection operators P1 and P2 as being orthogonal if P1 P2 |ψ⟩ = 0. The probability of obtaining
23
•
|ψ⟩ = αk |ϕk ⟩ • U −1 |ϕk ⟩
P
k U
•
|0⟩
|0⟩ M |k⟩
|0⟩
Figure 7. One way of implementing vN measurement through ancillary register. The measurement M
measures |k⟩ with probability, |αk |2 while the map through U −1 gives the state |ϕk ⟩ in the main register.
One can also directly measure instead of introducing ancillary register. Note that U is a unitary transfor-
mation which implements basis change to the computational basis. The use of CNOT gate to copy to the
ancillary register might seem illegal but note that we are just doing reversible transformation copying the
computational basis states, we are not cloning/copying arbitrary superposition state.
output k (as discussed above) is Prob.(k) = ⟨ψ|Pk |ψ⟩ = Tr(Pk |ψ⟩ ⟨ψ|. These measurements lead
to the collapse of the wave function and the state after measurement ψ ′ is given by:
Pk |ψ⟩
ψ′ = p . (3.22)
⟨ψ|Pk |ψ⟩
Projective measurements (of which von Neumann is a special case) can be generalized as well but
we will not discuss it here and refer the reader to textbooks that discuss quantum measurements
in depth.
Example 4: What is the output of the quantum circuit given below? Assume U is some uni-
tary gate.
|0⟩ H • H (3.23)
|ψin ⟩ U
□ The initial state is given by: |ψ0 ⟩ = |0⟩ |ψin ⟩. Once we apply the H gate it becomes, |ψ1 ⟩ which
is given by:
1
|ψ1 ⟩ = √ |0⟩ |ψin ⟩ + |1⟩ |ψin ⟩
2
Then, if we act on this with the U as given in the Figure, we get:
1
|ψ2 ⟩ = √ |0⟩ |ψin ⟩ + |1⟩ U |ψin ⟩
2
and now we again act with the H gate,
1
|ψ3 ⟩ = (|0⟩ + |1⟩) |ψin ⟩ + (|0⟩ − |1⟩)U |ψin ⟩
2
24
and this is equal to:
1
= |0⟩ (1 + U ) |ψin ⟩ + |1⟩ (1 − U ) |ψin ⟩
2
□
3.3 Entanglement
One of the distinguishing features of quantum mechanics is ‘entanglement’22 . Though there exist
various definitions of entanglement of varying complexity, for our purposes, a simple one will suffice.
We say that the state is entangled when it cannot be written as a product state. It is often useful
to check whether a given state is separable (not entangled) or not. In order to show whether the
state is entangled or not, it is easiest to compute the reduced density matrix and compute TrρA 2
and see if it is 1 or not (for normalized states). It is a separable state (not entangled) iff TrρA 2 = 1.
Suppose we have a Bell state: |Ψ⟩ = √12 (|00⟩ + |11⟩), then we have:
1 1
ρA = TrB (|Ψ⟩⟨Ψ|) = (|0⟩⟨0| + |1⟩⟨1|) = 1
2 2
Tr(ρ2A ) = 14 Tr(1 · 1) = 2.
1
Hence, this is entangled. We have used the shorthand notation:
TrB (ρAB ) = ρA above.
▶ Question 10: Compute Tr(ρ2A ) and check if the state given below is separable?
1
|ψ⟩ = |00⟩ + |10⟩ − |01⟩ − |11⟩ . (3.24)
2
Once you find it is separable, write it in terms of |±⟩ = √12 (|0⟩ ± |1⟩). Now consider a general
state |ψ⟩ = a |00⟩ + b |10⟩ + c |01⟩ + d |11⟩ and find the condition iff the state is to be a separable
one. Now think of a measure using a, b, c, d of how we can quantify the extent of entanglement.
Clearly for this case it should vanish. In later part of these notes, we will redo this exercise
using Qiskit, see Question C.2. In the later part of the notes, we will encounter a name for
the function which can be built out of a, b, c, d.
The above arguments can be systematically understood as follows. Consider a density matrix
ρ written as:
ρ= (3.25)
X
pi |ψi ⟩⟨ψi |.
i
If the system is in a pure state then all the pi , except one, is zero, and we get ρ = |ψ⟩⟨ψ|. If
the ρ is a pure state, then the following conditions are both sufficient and necessary to prove
that it is in such a purity: ρ = ρ† , Trρ = Trρ2 . Usually one takes the ρ to be appropriately
22
This famously prompted Einstein to complain about spooky action at a distance (in German ‘spukhafte Fern-
wirkungen’)
25
P
normalized such that Trρ = 1 which is equivalent to saying that Trρ = Tr i pi |ψi ⟩⟨ψi | = 1 or
Trρ = n ⟨n|ρ|n⟩ = n ⟨n|ψ⟩⟨ψ|n⟩ = 1 as per taste. It is straightforward to show that Trρ = Trρ2 .
P P
We will just show that ρ = ρ2 , which can be done by writing: ρ2 = |ψ⟩⟨ψ|ψ⟩⟨ψ| = ρ, where the sums
have been suppressed. Now consider a mixed state, and we will show that Tr(ρmixed )2 < Trρmixed .
We also need to show that if ρ2 = ρ, the state is pure. We first note that since ρ is Hermitian, the
eigenvalues are real and the corresponding eigenvectors can be made orthonormal, the proof for
this proceeds as follows,
ρ= ; Spectral decomposition (3.26)
X
λi |λi ⟩⟨λi |
i
= ; (∵ ρ = ρ2 ) (3.27)
X
λ2i |λi ⟩⟨λi |
i
This implies that the eigenvalues are either 0 or 1. Hence, λi = 1, for some i = p and 0 for
i ̸= p. Hence, ρ = i λi |λi ⟩⟨λi | = |λp ⟩⟨λp | which implies that ρ is pure. For mixed states,
P
Tr(ρmixed )2 < Tr(ρmixed ). The other properties still hold such as, ρ = ρ† , Trρ = 1 and ρ ≥ 0
(positivity). The measure of Trρ2 from 1 is a good measure of how mixed the state is. For a
maximally mixed state, we have Trρ2 = 1/d, where d is the dimension of the system. This is
also called as a maximally mixed density matrix. A density matrix corresponding to a maximally
mixed state also has the largest entropy as:
SEE = −TrA ρ ln ρ (3.28)
1 1
ln
= −d = ln d. (3.29)
d d
Any unitary transformation preserves the pureness of the state intact, i.e., a pure state remains
pure.
h i
Tr (U ρU † )2 = Tr U ρ |U{z
†
U} ρU † (3.30)
1
= Tr U ρ U † 2
(3.31)
= Trρ2 . (3.32)
This definition of entropy (called entanglement entropy or von Neumann entropy) for pure states
of a bipartite system is the most widely used measure to quantify entanglement. As the astute
reader might have noticed before, we can also identify if the state is separable by computing the
Schmidt number. Consider a state |ψ⟩ ∈ HA ⊗ HB to be a pure state. Then we have an expansion
of the form:
|ψ⟩ =
X
λi |ai ⟩ |bi ⟩ ,
i
where |ai ⟩ and |bi ⟩ are orthonormal states belonging to HA and HB respectively. The λi ≥ 0 are
Schmidt coefficients and satisfy λ2i = 1. These are computed by constructing a matrix TrB (|ψ⟩ ⟨ψ|)
whose eigenvalues are λ2i . The Schmidt number is defined as the number of non-zero λi . The state
is separable if this is 1 and entangled if it is greater than 1.
26
3.3.1 Partial trace method
In this subsection, we will discuss the idea which facilitates the computation of bipartite entropy.
The partial trace, TrB is a map from the density matrix ρAB on some composite system with
Hilbert space HA ⊗ HB onto density matrices ρA on HA . Let us assume that {|αi ⟩} and {|βi ⟩}
are the basis of HA and, HB respectively. Then a density matrix, ρAB can be decomposed as:
ρAB = (3.33)
X
cijkl |αi ⟩⟨αj | ⊗ |βk ⟩⟨βl |
ijkl
ijkl
ρ11 ρ12 ρ13 ρ14
ρ11 + ρ22 ρ13 + ρ24
!
ρ21 ρ22 ρ23 ρ24
TrB = (3.35)
ρ31
ρ32 ρ33 ρ34
ρ31 + ρ42 ρ33 + ρ44
ρ41 ρ42 ρ43 ρ44
while the partial trace over A is given by:
ρ11 ρ12 ρ13 ρ14
ρ11 + ρ33 ρ12 + ρ34
!
ρ21 ρ22 ρ23 ρ24
TrA = (3.36)
ρ31
ρ32 ρ33 ρ34
ρ21 + ρ43 ρ22 + ρ44
ρ41 ρ42 ρ43 ρ44
A two-qubit state can be expanded in the orthonormal basis {|00⟩, |01⟩, |10⟩, |11⟩} given by:
ρA = (ρ11 + ρ22 )|0⟩⟨0| + (ρ13 + ρ24 )|0⟩⟨1| + (ρ31 + ρ42 )|1⟩⟨0| + (ρ33 + ρ44 )|1⟩⟨1| (3.38)
One of the other ideas related is - purification. The fact that given mixed density matrix can
always be thought of as being obtained from the partial trace of some bigger Hilbert space. This
idea is closely related to the phrase – there exists a ‘church of bigger Hilbert space’ supposedly
meaning that there always is a place where one can be purified. Suppose |i⟩ ∈ HA such that:
ρA = (3.39)
X
λi |i⟩⟨i|
i
Extent HA → HA ⊗ HB , then we can write ρA as,
27
▶ Question 11: Consider the state given by:
Find the eigenvalues of ρ and ρ2 and compute the von Neumann entropy.
In addition to von Neumann entropy, there is another notion of entropy often used. This is referred
to as ‘relative entropy’. For two density operators ρ and σ, it is defined as:
where the minimum is taken over all pure state decomposition of ρAB . In addition to EOF, there
is another quantitative measure of entanglement known as ‘concurrence’. The entanglement of
formation is closely related to another quantity, concurrence (C) through the following relation [35]:
√
1+ 1 − C2
!
Ef (C) = h , (3.44)
2
where h is defined as −x log2 (x) − (1 − x) log2 (1 − x). In the appendix, we compute this quantity
using Qiskit for the interested reader. These computations can also be done using Mathemat-
ica and we give a brief sample code using QI Mathematica package in the Appendix. Alterna-
tively, one can also use the QuantumFramework package from Wolfram.
▶ Question 12: Using Mathematica and the package mentioned above, answer the following:
• Pick two random density matrices and compute the relative entropy (as defined in 3.42)
between them?
28
• Consider a density matrix given by:
5/12 1/6 1/6
ρ = 1/6 1/6 1/6 (3.45)
.
1/16 1/6 5/12
• Create a random density matrix and compute the von Neumann entropy. Do this several
times.
1
= √ e2πix·0/2 |0⟩ + e2πix·1/2 |1⟩
2
1
= √ |0⟩ + eiπx |1⟩ .
2
It is easy to check that QFT |0⟩ = |+⟩ and QFT |1⟩ = |−⟩. Hence, QFT on a single qubit is just
like Hadamard gate. Now let us consider that {0, 1, · · · , N − 1} forms an orthonormal basis and
PN −1
let |α⟩ = i=0 |j⟩ denote a state with N = 2n for n qubits. Then QFT transforms the state as:
N −1 N −1 −1
1 NX
|α⟩ = γ −jk |k⟩ (3.46)
X X
|j⟩ → √
i=0 i=0 N k=0
▶ Question 13: Show that quantum Fourier transform defined by (3.47) is a unitary operation.
24
We understand that this acronym might be unsuited for field theorists
29
To see a more general working of QFT, let us assume that |x⟩ = |x1 ⟩ ⊗ |x2 ⟩ ⊗ · · · ⊗ |xN ⟩, then if
we perform quantum Fourier transformation on this, we get:
−1
1 NX
QFT |x⟩ = √ e2πixy/N |y⟩
N y=0
−1
1 NX Pn k
=√ e2πix k=1 yk /2
N y=0
−1 Y
1 NX n 2πixyk
=√ e 2k |y1 y2 . . . yn ⟩
N y=0 k=1
1 X 1 1 Y n
1 X 2πixyk
=√
X
··· e 2k |y1 y2 . . . yn ⟩
N y1 =0 y2 =0 yn =0 k=1
1 2πix 2πix 2πix
=√ |0⟩ + e 21 |1⟩ ⊗ |0⟩ + e 22 |1⟩ ⊗ · · · ⊗ |0⟩ + e 2n |1⟩ (3.48)
N
2πix·0 2πix·1
We can see that at the qubit level, it maps each of them as: |xk ⟩ → √1
2
e 2k |0⟩ + e 2k |1⟩ =
2πix
√1
2
|0⟩ + e 2k |1⟩ . The complexity of QFT is O(n2 ) where n is the number of qubits.
▶ Question 14: The process of cloning means that there is a unitary transformation U such
that U |ψ⟩ |0⟩ → |ψ⟩ |ψ⟩. Show that this is not possible for an arbitrary state.
30
The proof proceeds as follows. Lets take two cases where |ψ⟩ = |0⟩ and |ψ⟩ = |1⟩, then we have
U |10⟩ = |11⟩ and U |00⟩ = |00⟩ respectively. By linearity we can write:
|00⟩ + |10⟩ 1
! !
U √ = √ |00⟩ + |11⟩ ,
2 2
Hence, there cannot be a general U operator which can clone an arbitrary state. Note that there
are some cases where the theorem doesn’t apply, which is often a source of confusion. The ‘no-
cloning’ theorem does not apply in two cases. The first is if we have the knowledge of how the state
was prepared and the second is with reference to classical information. Suppose we have states
spanned by orthonormal basis (for example, using CNOT gate, we can do |a⟩ ⊗ |b⟩ → |a⟩ ⊗ |a ⊕ b⟩
and setting b = 0 gives |a⟩ ⊗ |0⟩ → |a⟩ ⊗ |b⟩, so we can clone a bit alone.
Now we talk about another theorem which states that it is impossible to distinguish non-
orthogonal quantum states. The ‘non-distinguishable’ theorem can be proved by contradiction as
well. Let us suppose that there is a measurement operator M which has eigenvalues mi and has
projection operators Pi of some observable and that it allows us to distinguish between two non-
orthogonal states |ψ1 ⟩ and |ψ2 ⟩ with ⟨ψ1 |ψ2 ⟩ =
̸ 0. Then we can write for some state |χ⟩ orthogonal
to |ψ1 ⟩:
|ψ2 ⟩ = α |ψ1 ⟩ + β |λ⟩ (3.51)
1 = ⟨ψ2 |P2 |ψ2 ⟩ = ⟨ψ2 |P2 P2 |ψ2 ⟩ = |β|2 ⟨λ|P2 |λ⟩ ≤ |β|2 . (3.52)
The last inequality follows from the completeness property. This implies |β|2 = 1 which means that
⟨ψ1 |ψ2 ⟩ = 0 which is contradiction. So, it is impossible to unambiguously differentiate between
non-orthogonal quantum states.
31
Section 4
One major area of present research in quantum computing is building algorithms (quantum) that
have substantial speedup25 compared to its fastest known classical counterpart. This area of re-
search is probably the most interesting and difficult. After close to three to four decades of effort,
we only have a handful of algorithms that demonstrate a clear advantage over classical algorithms.
By quantum algorithm, we mean a sequence of unitary steps that manipulate the initial state |i⟩
such that a measurement of the final state |f ⟩ provides the desired solution. In this section, we
will focus on some well-known algorithms and later show how they can be implemented in Qiskit.
We will start with probably the simplest of algorithms and one we are well familiar with from an
undergraduate course in conventional electronics, i.e., full-adder.
4.1 Full-adder
The addition of classical bits using adder circuits is one of the first things one learns in the
undergraduate digital electronics course. We will not provide a recap here, but interested readers
can refer to the classic textbook by Malvino and Leach [40]. The quantum full-adder is similar to
the classical full-adder except that now we have an identical number of inputs and outputs because
we need quantum circuits to be reversible. Therefore, we define a 4-qubit input, where the input
qubits are A, B, Ci (Carry in) and null (Z). The output qubits are A, B, S (Sum) and Co (Carry
out). The table will be:
A B Ci Z Co S A B
0 0 0 0 0 0 0 0
0 0 1 0 0 1 0 0
0 1 0 0 0 1 0 1
0 1 1 0 1 0 0 1
1 0 0 0 0 1 1 0
1 0 1 0 1 0 1 0
1 1 0 0 1 0 1 1
1 1 1 0 1 1 1 1
25
In simple terms, the speedup depends on how much quantum mechanics is available.
32
Once we have prepared the inputs A and B it can be fed to the quantum circuit which will
implement the full-adder. The circuit is given below:
A • • • A (4.1)
B • • • B
Ci • S
Z Co
The implementation of this circuit using Qiskit is given in the Appendix, and we test this for
some input from the truth table mentioned above.
where we note that controlled-U acts like U |u⟩ = ei2πϕ |u⟩. The phase has been kicked back.
This is what we set out to do, i.e., getting a phase rotation to our control qubit whereas the
phase rotation gate was applied to the bottom qubit. This is different to the common belief that
the control bit mostly remains the same and the controlled (target) bit transforms. This is the
reason this procedure is called ‘phase kickback’. We can do higher powers of U to proceed in the
k k
same manner. So, if we instead do, U 2 then we will obtain a phase of ei2π2 ϕ kicked back. The
Qiskit implementation of this algorithm is straightforward, and we do this in the Appendix for
the interested reader. Note that sometimes we cannot obtain the exact answer. For example, if
we implement the code in the Appendix for θ = 2π/3, we expect to obtain ∼ 0.3333 but indeed
get output either to be 0.25 or 0.375. This is part of the algorithm, and it is known that any
exact answer will only be obtained with some probability p. However, we can always increase the
number of qubits to get a more precise answer.
33
an example of explicitly showing the quantum advantage. This algorithm makes use of Fourier
transform like several other quantum algorithms such as Simon’s algorithm (which we do not discuss
in these notes) and several others. All these developments eventually led to Shor’s algorithm - the
most famous quantum algorithm today. We will first explain the Deutsch’s algorithm and leave
the generalization for the reader to explore from other excellent textbooks and notes available.
In simple terms, the statement of the problem is: Suppose we have two boxes and each contains
either a red or blue ball inside. We would like to know whether two boxes have the same colored
ball. Mathematically, consider the Boolean function f : {0, 1} → {0, 1}, then the problem is to find
whether f (0) = f (1) or f (0) ̸= f (1). We consider the oracle (or black box): Uf |x, y⟩ = |x, y ⊕ f (x)⟩
with x, y ∈ {0, 1}
|0⟩ H H
Black box
|1⟩ H
Figure 8. Circuit implementing the Deutsch algorithm.
In this case, the same color means that the function is constant while a different result implies
it is balanced. So, f (0) ⊕ f (1) = 0 if f (0) = f (1) and 1 otherwise. The sequence of steps as given
in the circuit diagram are summarized below:
H⊗H 1
|0, 1⟩ −−−→ |+, −⟩ = √ |0⟩ + |1⟩ ⊗ |−⟩ , (4.3)
2
1 1
" #
Uf
−−→ √ (−1)f (0) |0⟩ + √ (−1)f (1) |1⟩ ⊗ |−⟩ , (4.4)
2 2
1 1
" # " #
H⊗1
−−−→ (−1)f (0) + (−1)f (1) |0, −⟩ + (−1)f (0) − (−1)f (1) |1, −⟩ . (4.5)
2 2
Hence, if f (0) = f (1), we will measure ± |0, −⟩ while if f (0) ̸= f (1) then we will measure ± |1, −⟩.
Thus, one call to the oracle (i.e., Uf has been used only once above) solves the problem. If we ask
how many queries to the oracle must be classically made to determine f (0) ⊕ f (1), it is simple
to see that we must make two queries. This corresponds to opening both boxes and checking the
color of the ball. This algorithm is capable of achieving a speedup to any classical algorithm.
This becomes drastic with more qubits. This algorithm can be readily extended to n-qubit and
to encourage the reader to generalize this algorithm, we give the circuit diagram as an appetizer
below for the DJ algorithm in Fig. 9 below.
We might think what makes the single query to oracle possible? The reason is the paral-
lelism achieved due to rules of quantum mechanics, which enables to perform multiple evaluations
simultaneously.
34
|0⟩⊗n H ⊗n H ⊗n
Black box
|1⟩ H
Figure 9. Circuit implementing the DJ algorithm on n-qubits.
▶ Question 15: Apply the DJ algorithm to input |0⟩ |0⟩ |1⟩ with f (00) = f (01) = 0, f (10) =
f (11) = 1 and write down the output.
• Suppose the n qubit state is given by |a⟩ usually initialized as |00000 · · · 000⟩. We first start
by applying H ⊗n i.e.,
H ⊗n 1
(4.6)
X
|a⟩ −−−→ n/2 |x⟩
2 x∈{0,1}n
We leave the deduction of final step to get |s⟩ for the interested reader. The similarity between
DJ and BV algorithms are: 1) Takes in n qubits and outputs 0 or 1, 2) Use of H gate to examine
all superposition states. The difference lies in the evaluation and the initial step. DJ determines
whether the function is constant or balanced while BV determines the value of function (and search
of string, s).
▶ Question 16: Apply the BV algorithm for the three qubit case to find ‘011’ using Qiskit.
35
4.5 Grover’s algorithm
This quantum algorithm was proposed by Grover for structured searching [43, 44]. The goal of
this algorithm is to find the solution to the search problem by making calls to the oracle. Suppose
we have a list of N = 10 numbers arranged in increasing order from 0 to 9 and the goal is to find 5.
On average, it will take O(N ) calls to find this. It was shown by that quantum mechanics can help
√
us solve this problem in O( N ) attempts. This is a polynomial speedup over the classical case
and works by a method called ‘amplitude amplification’. We will see later that Shor’s algorithm
offers exponential speedup compared to the classical case. This quantum search algorithm consists
of repeated application of Grover’s operator G. There are four steps involved in one iteration
(applying G once). We list them below:
• Perform phase shift unitary operator where every state in computational basis receives a
shift. This operator is given by 2 |0⟩ ⟨0| − 1
The Hadamard transform (where N = 2n ) puts the input state in an equal superposition state
written as:
−1
1 NX
|ψ⟩ = √ |x⟩ . (4.9)
N x=0
Using this, we can write the combined effect of all four steps as:
In short, the oracle operation O reflects the state about |ψ⟩26 and then 2 |ψ⟩ ⟨ψ| − 1 (also called
‘diffuser’ D) reflects it about |ψ⟩. These are the product of two reflections, and the net result is
a rotation. One step of Grover’s iteration can be diagrammatically represented by Fig. 10. We
also note that D = H ⊗n (2 |0⟩ ⟨0| − 1)H ⊗n = H ⊗n X ⊗n (MCZ)X ⊗n H ⊗n . Hence, this can be built
from H gates, X gates, and single multi-controlled Z gate. We give the code to implement this
algorithm using Qiskit in Sec. C.
36
Figure 10. Diagrammatic representation of the Grover’s algorithm.
• |ψ⟩ is one set of qubit registers (the one below in the figure) and the other set is n qubits
counting (first) register. We have |ψ0 ⟩ = |0⟩⊗n |ψ⟩
• Apply controlled-U (CU) gate (or rather controlled phase with some θ)27 to get
1 n−1
1
0
|ψ2 ⟩ = n |0⟩ + e2πiθ2 |1⟩ ⊗ · · · ⊗ |0⟩ + e2πiθ2 |1⟩ ⊗ |0⟩ + e2πiθ2 |1⟩ ⊗ |ψ⟩ , (4.11)
22
where we note that the rightmost qubit in the first register is |q0 ⟩ (see figure)
|q0 ⟩ H • ···
|q1 ⟩ H • ···
QFT†n
.. .. ..
. . .
|qn−1 ⟩ H ··· •
|ψ⟩ /m U U2 ··· U2
n−1
27
Note that this is what we discussed before in ‘phase kickback’
37
▶ Question 17: Consider the following circuit (this is Problem 5.3 in Ref. [11]):
|0⟩ H • H
|u⟩⊗n U
where |u⟩ is an eigenstate of U with eigenvalue equal to eiθ . Show that the top qubit is measured
to be 0 with probability equal to cos2 (θ/2)
3. Pick a random integer p between 2 and N . If gcd(N,p) ̸= 1, we are done and can return the
factor. If not, we continue to Step 4 (likely will always happen!).
5. If r is even and ar/2 mod N ̸= −1, then evaluate gcd(ar/2 ±1, N ). If we find non-trivial factor,
return that value as a factor otherwise we return to Step 3.
38
Note that Euclid’s algorithm can be used to find gcd(a,b) efficiently.28 Let us clarify the step of
period finding for the reader. Consider: ar = 1(mod N) where r is the smallest positive integer.
Now suppose we have, N = 15, a = 7 then r = 4. This is well-defined only if N and a are co-prime
or relatively prime (i.e., they have no common factor except 1). In Mathematica , this can be
evaluated by doing: MultiplicativeOrder[7, 15]. The fact that finding period can actually
help us find prime factorization can be obtained from lemmas that follow from Fermat’s little
theorem (1640) i.e., for every a and prime p, we have ap = a(mod p). An alternate statement of
this theorem is also often mentioned: ap−1 = 1(mod p) where p is prime and a is any integer not
divisible by p.
Section 5
One of the main motivations why quantum computing is required is the necessity to simulate
complicated quantum many-body systems or solve large scale linear algebra problems. These are
very challenging (and sometimes not possible) for classical computers due to the high computational
cost involved. Even though quantum computers offer a promise to the solution, the error correction
and feasibility are still not well understood. One of the major areas of research with respect to how
algorithms can be developed is Variational Quantum Algorithms (VQAs). We refer the interested
reader to Ref. [48] to start the reference trail. These algorithms make use of classical optimizer
and along with quantum circuits are argued to have a role in wide-ranging areas where quantum
computation might be useful in the future. But, in particular, the earliest and well-known of these
VQAs is an algorithm that has drawn considerable interest in the last decade. This is known as
VQE and makes use of the well-known variational principle to compute the ground state energy
of a given Hamiltonian which is important for many problems in quantum chemistry, condensed
matter physics, and quantum many-body systems. One of the main advertised advantages of this
method is that it can be used to deal with complex wave functions of a wide class of systems in
polynomial time when classical methods grow exponentially. Though this method has not yet truly
outclassed the classical algorithms, it has incredible potential once we enter beyond NISQ era. This
algorithm has well-known drawbacks since this is a non-linear optimization problem. We refer the
interested reader to Ref. [49] for references. The Variational Quantum Eigensolver (VQE) was
originally developed in Ref. [50] and is among the most promising examples of NISQ algorithms.
It aims to compute an upper bound for the ground state energy of some given Hamiltonian. VQE
is a hybrid (mixture of classical and quantum) algorithm which can be implemented on NISQ
28
In his book, ‘The Art of Computer Programming, Vol. 2: Seminumerical Algorithms’, Knuth comments that
this algorithm is the granddaddy of all algorithms because it is the oldest nontrivial algorithm that has survived to
the present day. It was written down by Euclid circa 300 B.C.
39
devices and used to obtain the ground state of the quantum many-body of given Hamiltonian H
using some ansatz. The basic steps of the algorithm are as follows:
2. Generate a good ansatz quantum state |Ψ(Θ)⟩ by applying a suitable unitary transformation
(quantum circuit composed of quantum gates) as |Ψ(Θ⟩ = Û (Θ) |0⟩
4. Update the parameters Θ to get smaller energy E(Θ) by using a classical optimizing algo-
rithm.
Within VQE, the cost function is defined as the expectation value of the Hamiltonian computed in
the trial state. The ground state of the target Hamiltonian is obtained by performing an iterative
minimization of the cost function. The optimization is carried out by a classical optimizer, which
leverages a quantum computer to evaluate the cost function and calculate its gradient at each
optimization step. The local optimization within the vector space generated by ansatz can suffer
due to the problem of vanishing gradients. This can often result in a phenomenon known as
‘barren plateaus’ [51] which are a well-known issue in VQE computations but there have been
some proposed methods to overcome this issue [52]. A detailed discussion is beyond the scope of
this article.
The choice of ansatz is usually determined by hardware availability (known as hardware-
efficient ansatz) and efficiency of considering qubits as logical qubits.29 We refer the interested
reader to Ref. [53] for an elaborate discussion on hardware-efficient trial states. The VQE that
accompanies Qiskit comes with some given choices such as RX, RYRZ, SU (2) etc. with some user-
defined number of repetitions. To measure the energy expectation value in the third step above, we
must have a qubit Hamiltonian of size 2n ×2n . This is usually not an easy task, however, this can be
simplified considerably by writing the original Hamiltonian in terms of the sum of Pauli operators
(X,Y,Z, 1) and their tensor products. However, not all Hamiltonians (even though they are sparse)
admit an efficient Pauli representation. For these kind of systems, alternate methods have also been
proposed [54]. This can also be understood as the first step even before doing any computation and
has to be done only once. The choice of the right optimization method is crucial for the problem.
We can choose from a range of methods such as BFGS (Broyden–Fletcher–Goldfarb–Shanno)
optimizer method, COBYLA30 (Constrained Optimization By Linear Approximation optimizer),
29
Usually when we have qubits, they are prone to errors and can make computation incorrect. We want qubits
that are ideal or at least not prone to many errors, they are known as ‘logical qubits’. The problem is that usually
for every logical qubit we need multiple physical qubits which can sometimes be hundreds of them.
30
Note that this is non-gradient based optimization, we do not need to know the derivative
40
SLSQP (Sequential Least SQuares Programming optimizer), Nelder-Mead or any other depending
on the requirement and efficiency required. For example, another example of a local optimizer
in QISKIT is Powell method, which performs unconstrained optimization; it ignores bounds or
constraints and is a conjugate direction method. More details can be found in Ref.[55]. Another
interesting method to construct the ground state of an interacting Hamiltonian is the adiabatic
state preparation (ASP) method. It works reasonably well when there is no level crossing (i.e., the
excited state of the Hamiltonian do not cross each other and ground state). Recently, there have
been some interesting work combining the ideas of VQE approach and ASP approach [56].
When we deal with physical systems, we can often express a given Hamiltonian as the linear
combination of the tensor product of Pauli matrices σx , σy , and σz which we call ‘Pauli strings’
i.e., P̂ = ⊗ni=1 Σ̂ where Σ̂ = {σx , σy , σz , 1}. Note that as the Pauli strings form a complete basis,
any Hamiltonian of size 2N × 2N can be decomposed into a linear combination of Pauli strings.
For example, let us consider the Hamiltonian of some system to be given by:
1
0 − 2i 0 0 0 0 − 12 − i
2 2
0 1
0 i
0 0 −2 +
1 i
0
2 2 2
i
0 1
0 0 −2 +
1 i
0 0
2 2 2
0 − 2i 0 1 1
−2 − i
0 0 0
H= 2 2
0 0 0 − 12 + i 1
0 i
0
2 2 2
0 0 1
−2 − i
0 0 1
0 − 2i
2 2
0 1
−2 − i
2 0 0 − 2i 0 1
2 0
−2 +
1 i
2 0 0 0 0 i
2 0 1
2
• Zero noise extrapolation (ZNE): This technique mitigates errors in noisy quantum compu-
tations without using additional quantum resources. This is based on understanding how
the noise scales and how we can extrapolate to zero noise. In ZNE, a quantum program is
deliberately altered to run at different levels of noise from processors.
41
• Randomized compilation (RC): This is a protocol which is constructed to overcome this
issue by converting coherent errors into stochastic noise. Randomized compiling makes use
of twirling groups while preserving the overall unitarity of the circuit. Pauli twirling is a
method which was introduced for the mapping of states into canonical form in entanglement
purification studies in the quantum information literature. It was also used in reducing the
exponential cost in quantum tomography. In QEM, it is used as a technique to improve
the performance on NISQ devices. The nature of noise in quantum systems can be broadly
classified as either coherent (unitary) or incoherent. The coherent noise are more dangerous
since they accumulate quickly and can lead to worst-case error. One of the most effective
methods of dealing with coherent noise/error is to convert them to Pauli errors. For this
one often uses ‘Pauli twirling’. Pauli twirling convert error channels to Pauli channels for
estimation of error threshold. Precisely, it converts the coherent noise into incoherent Pauli
channels by supressing the off-diagonal terms. In addition, if the twirling is performed with
Clifford group, it is called Clifford twirling. This converts the error channels into depolarising
channels. In general, any arbitrary channel can be converted to Pauli channel.
• Learning based error mitigation: This method was introduced in Ref. [59]. The basic idea of
this method is to start with a noisy expectation value E(P) for some primary circuit P and
achieve the noiseless value E0 (P) passing through series of optimizations of the expectation
value which depends on some set of parameters θ. ⃗ The optimal choice of θ⃗ when obtained
through learning-based methods based on temporary circuit T which is close enough to the
primary circuit.
Ĥ ′ = Ĥ − g X̂ 3 − hX̂ 4 . (5.1)
For the cubic oscillator, if we consider three qubits, Ĥ ′ is a 8 × 8 matrix which for g = 0.02 is given
by:
42
The energy levels for cubic anharmonic oscillator (h = 0) which we take as example is known to
be:
g2
En = − 30n2 + 30n + 11 + O(g 4 ), (5.3)
8
and the ground state energy level upto O(g 6 ) is given by (see Table (3.1) of Ref. [62])
1 11 2 465 4 39709 6
E0 = − g − g − g (5.4)
2 8 32 128
We provide the code in Qiskit in the Appendix for the interested reader though admittedly it can
definitely be improved and optimized of which we have not taken any care except checking that it
works. We need to create H matrix for this system which can be done in Mathematica as below
31 which will be then converted to Pauli string and input to VQE to find E :
0
1 SetDirectory[NotebookDirectory[]];
2 nbits = 3; (* number of qubits *)
3 n = 2^nbits;
4 lattice = Table[(2 a - n - 1)/2, {a, n}]; (* Lattice for position operator *)
5 X = DiagonalMatrix[Sqrt[(2 \[Pi]/n)] lattice];(* Position operator *)
6 F = (1/Sqrt[n]) Table[N@Exp[(-I 2 Pi lattice[[j]] lattice[[k]])/n], {j, n}, {k, n}];(*
Discrete Fourier transform *)
7 P = Chop[F\[ConjugateTranspose] . X . F]; (* Momentum operator) *)
8 A = Sqrt[0.5] (X + I P); (* Annihilation operator *)
9 A1 = Table[If[(j - i) == 1, i^.5, 0], {i, n}, {j, n}] ; (* Annihilation operator in energy
(E) basis *)
10 X1 = Sqrt[0.5] (A1\[ConjugateTranspose] + A1); (* Position operator in E basis *)
11 P1 = I Sqrt[0.5] (A1\[ConjugateTranspose] - A1); (* Momentum operator in E basis *)
12 g = 0.02;
13 h = 0.04;
14 H0[X_, P_] := .5 P . P + .5 X . X; (* Harmonic oscillator Hamiltonian *)
15 H1[X_, P_] := .5 P . P + .5 X . X - g MatrixPower[X, 3]; (* cubic anharmonic Hamiltonian *)
16 H2[X_, P_] := .5 P . P + .5 X . X + h MatrixPower[X, 4]; (* quartic anharmonic Hamiltonian *)
17 H0A[A_] := A\[ConjugateTranspose] . A + .5 IdentityMatrix[n]; (* Harmonic oscillator
Hamiltonian in E basis *)
18 H1A[A_, X_] := H0A[A] - g MatrixPower[X, 3]; (* Cubic anharmonic Hamiltonian in E basis *)
19 H2A[A_, X_] := H0A[A] + h MatrixPower[X, 4]; (* Quartic anharmonic Hamiltonian in E basis *)
20 H = H1A[A1, X1]; (* Make Hamiltonian to export *)
21 hamName = "HO"; (* Set Hamiltonian name for file *)
22 Export["ham_" <> hamName <> ".txt", H, "Table"]; (* Export Hamiltonian to file which would be
read by our QISKIT program! *)
23
In fact, an astute reader might ask: What is the point of doing this VQE computation when I can
easily find the ground state energy of an 8 × 8 Hamiltonian in three lines by doing:
31
Note that there are other ways to do this, but this is probably the cleanest
43
1 from numpy import linalg as LA
2 w, v = LA.eig(H)
3 print ("Ground state energy", w[0])
4
To address this, we note that the interest in VQE algorithms is because for a Hamiltonian of
size 2n × 2n where n is a large number and H is complicated enough that it is not very sparse
like it is in this case, then it will take classical computing/exact diagonalization an exponentially
longer time and a large amount of memory. This is often given the name ‘solution does not scale
with system size’. However, if it is assisted through VQE (creating quantum state ansatz and
optimizing classically) then the growth with n and sparseness of H will be much more efficient (at
most polynomials!). It must be noted that VQE has already been able to substantially get close
to some gold standard in quantum chemistry, however, the discussion of this lies beyond the scope
of this article. We just point out one reference of the computation done in quantum chemistry
that was for quantum simulation of the deuteron binding energy on quantum processors such as
IBM QX5 (with 16 SC qubits) and Rigetti 19Q (19 SC qubits) [63] which can be used to start a
reference trail.
32
We thank Kostas Orginos and Felix Ringer for some discussions related to this
44
where i and j are the nearest neighbour sites on a spatial line, n is a unit 3-vector at site i, L is
the angular momentum and β is the coupling.
The dimension of the local on-site Hilbert space is given by l0max. (2l + 1) which is d = 2 with
P
lmax. = 1/2. Therefore, H will be a 16 × 16 matrix for N = 4. We can exactly diagonalize (ED)
the Hamiltonian by expressing (5.5) in terms of Pauli matrices and compare to the results from
Ref. [64]. We find that for β = 1/10 and N = 4, we get E0 /N = 3.72778 while for β = 10, we get
E0 /N = −2.1847 at fixed truncation of lmax. = 1/2 at each site. The result at large β is inaccurate
(not close to convergence) since the truncation effects are important. One obtains E0 /N = −5.62
if lmax. = 3/2 is used with N = 4 sites with H given by a 64 × 64 matrix. For VQE, we would
need to work with 11 qubits for which optimisation might not be straightforward. The code for
implementing this with lmax. = 1/2 is given below.
Note that going beyond the lmax. = 1/2 is non-trivial. The size of H with lmax. = 5/2 will be
124 × 124 and we would need 14-15 qubits to represent it. If we take θ = 0, then the allowed values
of l will be 0, · · · lmax. with size of Hamiltonian given by (lmax. + 1)2N × (lmax. + 1)2N for N -sites.
There is an alternative view to think about quantum computation of this model. Rather
than thinking about qubits, we can represent (5.5) in terms of two distinct harmonic oscillators
(qumodes) at each site using the Schwinger representation. This representation is straightforward
for the kinetic term (since it is just the number operator) but one can also express the nearest-
45
neighbor interaction term in oscillator basis. The schematic form of the Hamiltonian is:
⟨ij⟩ i
where the two oscillators at each site are denoted by a, b and ni = a†i ai + b†i bi . The Hamilto-
nian of this model has some similarity to the Bose-Hubbard for which mapping from bosonic
infinite-dimensional Hilbert space to qubits have been developed [65, 66]. In addition to the 1+1-
dimensional O(3) model, the (hybrid) quantum algorithms have also been applied to other models
(one spatial dimension) such as two-flavor Gross-Neveu model [67] and to Schwinger model [68].
It will be interesting to understand these models from the perspective of a continuous variable
(bosonic) quantum computing methods and some work along these lines have already been done
using Xanadu’s simulator [69] where the ground state energy for scalar field theory was computed
using the quantum imaginary time evolution (QITE) algorithm proposed with and without use of
ansatze in Refs. [70, 71].
Section 6
Quantum computers often offer drastic speedup to solutions of certain types of problems by using
principles of quantum mechanics such as: superposition and entanglement. However, the use
of qubits in place of classical bits also makes the quantum computer susceptible to errors unlike
anything we know in classical computers. The origin of these errors is primarily due to decoherence
- a process in which the environment interacts with the qubits and changes the quantum states,
which eventually leads to corrupted results. For example, the failure rate is about one error in
1017 operations for classical computers, which for quantum computers is much severe. This partly
makes the theory of quantum error correction more subtle than classical counterpart, in addition
to several reasons below:
• The act of measurement or observation in quantum mechanics destroys the quantum state
and makes its recovery impossible. For example, if we have a superposition state, and we
perform a measurement, we lose the superposition by choosing one outcome.
• No-cloning theorem prohibits the copying of any arbitrary quantum state, and this means
that repetition code obtained by just duplicating the bit will not work.
• Unlike classical bit, qubit is continuous valued and hence we need infinite precision to locate
the error exactly in order to correct it.
The goal of the quantum error-correcting (QEC) code is to protect some subspace of the entire
Hilbert space H from some errors. More precisely, suppose we want to preserve a k-dimensional
46
subspace (coding space) against some known errors. This is achieved by mapping the states into
a larger, n-dimensional Hilbert space. In that case, we can refer to it as the (n, k)-quantum code.
Sometimes, an alternate definition is also used, where by [n, k, d] we denote a quantum error-
correcting code that uses n qubits to encode k qubits with distance d. There is a well-known
Knill-Laflamme theorem [72] for the conditions of quantum error correction. It is stated as follows:
Let C be a quantum-error correcting code defined as a subspace of the n-dimensional Hilbert space,
n n
H2⊗n , and let E ⊂ C2 ×2 be a set of errors. Then C can correct E if and only if
for some Hermitian matrix αij . A quantum error-correcting code is a pair (C, R) consisting of
a quantum code and a recovery operator. We will see one example (the Shor’s nine-qubit code)
for error correction toward the end of this section. In order to implement QEC, one would like to
know which gate set are sufficient. The answer to this is given by the Rains-Solovay theorem.33
It states that: The Clifford group (denoted below by C) together with any gate not in this group
is universal for quantum computation. However, there are some combinations that are most
frequently used and proven to be universal. Such examples are {C + CCNOT}, {C + π/8}, and
{C + controlled − π/4}.
In 1995, Shor [73] discussed a way to reduce the rate of decoherence in quantum memory
and hence paved the way for the practical usage of quantum computers, This work led to a lot of
interesting developments in the field of ‘quantum error correction’. This was a remarkable result
since it implied that a quantum state even though it cannot be cloned due to the ‘no-cloning’
theorem can be protected in a noisy environment. One would at this point think - why do we need
to correct errors at all? The error correction in quantum computers is more delicate than classical
errors. This is partly because error correction is needed to protect the quantum superposition and
entanglement, both of which are crucial ingredients of any quantum computation. In the original
work, Shor proposed to store the quantum information not in a single qubit, but it was later shown
that it can be reduced to five, which is the minimum required [74].
47
occur with some probability p. Such a process is referred to as ‘bit-flip’. One way to correct this
is to do repetition as follows of the classical bit |0⟩L → |000⟩, where we mean logical qubit by
subscript L. Assuming that the probability of bit-flip as p, we can show that the total probability
of error persisting (i.e., remaining uncorrected or wrongly corrected) is 3p2 (1 − p) + p3 = 3p2 −
2p3 .
▶ Question 18: Compute the minimum fidelity attained by the three-qubit bit flip?
The circuit to correct bit-flip is given by: For the example, we will take Ebit to be a X gate for
|ψ⟩ • • • • |ψ⟩
|0⟩ Ebit •
|0⟩ •
Figure 11. Bit flip circuit
If both first and second qubit are same, we get +1 or -1 if they are different. Similarly, we can
compute Z2 Z3 . Then assuming that there is a single bit flip, we can deduce the following table.
Z1 Z2 Z2 Z3 Which bit flipped?
+1 +1 None (1)
+1 -1 Third (X3 )
-1 +1 First (X1 )
-1 -1 Second (X2 )
|1⟩ •
|2⟩ • •
|3⟩ •
|AC⟩
|AC⟩
Figure 12. A circuit to identify the bit flip with two ancillary bits. This is the error-detection part of the
bit flip code. This is followed by a recovery procedure.
This step detected the error. Now, in the recovery step, one simply applies X gate on the
flipped bit to complete the error correction process. One important thing is that these measure-
ments (ZZ) do not spoil the superposition of quantum states that we wish to preserve since they
48
never give any information about a, b (amplitudes). The bit flip code is similar in spirit to the
classical error-correcting codes. One more advanced code is the ‘phase-flip’ code which has no
classical counterpart and hence is more interesting as a quantum code. But note that there are
ways to describe ‘phase-flip’ into ‘bit-flip’. We can always go from ‘quantum’ to ‘classical’ but not
the other way around!
|ψ⟩ • • H
|0⟩ H
|0⟩ H
|ψ⟩ • • H • • • • H • • |ψ⟩
|0⟩ •
|0⟩ •
|0⟩ H • • • • H •
|0⟩ Q •
|0⟩ •
|0⟩ H • • • • H •
|0⟩ •
|0⟩ •
Figure 14. The circuit to implement Shor’s code where Q is a channel which can corrupt single qubit.
49
is to note that:
1
|0⟩ → √ |000⟩ + |111⟩ ⊗ |000⟩ + |111⟩ ⊗ |000⟩ + |111⟩ . (6.8)
2 2
Suppose the error is modelled by a unitary transformation U such that:
U = c0 I + c1 X + c2 Y + c3 Z (6.9)
Now, if U is equal to I, then no error has occurred. If U = X, then a bit flip occurs, if U = Z then a
phase flip occurs. Lastly, if U = iY then both a bit flip error and a sign flip error occur.
▶ Question 19: Show that if the probability of a single qubit being affected (either phase or
bit flip or mixture of the two) is p, then the probability of having more than one qubit having
an error in Shor’s nine qubit code is 36p2 .
The quantum error-correcting conditions are a set of equations which have to be satisfied by a
quantum error-correcting code to protect against a particular type of noise. In the next paragraph,
we will see what the stabilizer set is for Shor’s code. But before this, we need to define the definition
of a stabilizer of a state. We say that a unitary, U , stabilizes a pure state |ψ⟩ if U |ψ⟩ = |ψ⟩. Note
that the phase is important and if we have U |ψ⟩ = − |ψ⟩, then it does not stabilizes.
▶ Question 20: Show that {II, XX, −Y Y, ZZ} forms a stabilizer group for the Bell state
√
given by (|00⟩ + |11⟩)/ 2.
Now, we do a short example that will clarify this further. Suppose we are asked whether the
three-qubit phase flip code |0L ⟩ = |+ + +⟩, |1L ⟩ = |− − −⟩. satisfied the conditions for the set of
error operators {I, Z1 , Z2 , Z3 }. The stabilizer set of Shor’s code is34 :
{Z1 Z2 , Z2 Z3 , Z4 Z5 , Z5 Z6 , Z7 Z8 , Z8 Z9 , X1 X2 X3 X4 X5 X6 , X4 X5 X6 X7 X8 X9 } (6.10)
34
Note that Z1 Z2 = ZZIIIIIII or Z ⊗ Z ⊗ I128
50
The Shor’s code provides the window to the more complicated quantum error-correcting (QEC)
codes. However, this code is not the most optimal and Steane 7-qubit code [75] is better. This
code has six stabilizer generators compared to eight in Shor’s code. These are given by:
All these QEC codes are best explained by the idea of stabilizer codes. For example, one famous
example is the toric code, which is a topological quantum error correcting code and is an example
of a stabilizer code/circuit 35 . It is defined on a two-dimensional spin-lattice and has Z2 topological
order. It reduces to a Z2 lattice gauge theory well known for decades in an appropriate limit. In
this code, the stabilizer operators are defined on the spins around each vertex and on the plaquette
and are known as A and B operators defined as: Av = i∈v σix and Bp = i∈p σiz respectively.
Q Q
We often refer to a QEC code as [[n, k, 2t + 1]] code 36 and Shor’s code is an example of [[9,1,3]]
stabilizer code. Sometimes, 2t + 1 is also called ‘distance’, and code is referred to as [[n, k, d]] code.
Soon after nine-qubit code, Steane found a seven-qubit code that can correct the same error as
Shor’s code. In fact, both these codes are ‘degenerate’ which loosely means that it can be further
improved. One of the ways we can optimize the code is to introduce the quantum Hamming bound
[76]. If a given code uses n qubits, corrects error on up to t qubits and encodes k qubits, then the
following inequality holds:
t
!!
n
3j 2k ≤ 2n . (6.12)
X
j=0
j
It is easy to check that with k = 1, t = 1, the lower bound is saturated with n = 5 hence there exists
a 5-qubit code which is [[5,1,3]] which is nondegenerate. In general, it is clear that the stabilizer
circuits/codes are very important for performing quantum error-correction and play an important
role in fault-tolerant circuits. The idea of stabilizer circuits is also important for a theorem known
as ‘Gottesman-Knill’ (GK) theorem [77]. The theorem implies that any stabilizer circuits can
be perfectly simulated in polynomial time on a (probabilistic) classical computer. Hence, they
offer no quantum advantage by themselves. This theorem originated in Ref. [77] where author
refers to private communication with Knill. This result does not explain the reason why quantum
computing can provide exponential speedup over classical computing, but it does tell us that
quantum algorithms which make use of entanglement built using Hadamard and CNOT gates do
not offer any advantage. This result is contrary to the natural expectation that no quantum gates
can be simulated efficiently by classical computers since n-qubit quantum circuit operates in a
2n -dimensional Hilbert space. But admittedly the situation if very different for non-Clifford gates
which cannot be simulated efficiently. If it was shown someday that even non-Clifford gates can be
35
A stabilizer circuit is a quantum circuit in which every gate is selected from a stabilizer set i.e.,{H, CNOT, P }
or a 1-qubit measurement gate
36
The two braces denote that is a quantum code unlike classical code such as Hamming code which uses single
parentheses
51
simulated by classical computers, then it would imply a further (and significant) lack of usefulness
of quantum computers.
However, even after different codes to perform quantum error correction, this has been not
possible to do in practice. One of the issues is that encoding of a single logical qubit in N physical
qubits also raises the possibility of error occurring by that factor. The apparatus which fixes
the single-qubit error must therefore be reasonably fast to not incur other errors in one of those
N qubits to reach a reasonable trade-off. This is not an easy experimental problem and hence
there have been various other proposals to perform error corrections. One of the main alternatives
is the use of ‘continuous variables’ degrees of freedom (quantum harmonic oscillator). In such
a setting, the logical qubits will be photon (Fock) states that span a two-dimensional subspace
from the potentially infinite harmonic oscillator states. Though, we have discussed the qubit-
based quantum computing in this article, the quantum computation and information based on
continuous variables (CV) are also extensively used in quantum teleportation, error correction,
and cryptography. For the CV approach to quantum computation, the main role is played by Bose
operators b†i , bi known as creation and annihilation operators satisfying following commutation
relations (also known as ‘Heisenberg-Weyl algebra):
The inner product space must be of infinite dimension for (6.13) to hold. One defines the vacuum
state of N qumodes (similar to N qubits) as |0⟩ = |000 · · · 0⟩. The normalized number state (or
Fock state) can be written as:
1
√ (b† )n1 (b†j2 )n2 · · · (b†jk )nk |0⟩ = |n1 , n2 , · · · , nk ⟩ . (6.14)
n1 !n2 ! · · · nk ! j1
We refer the reader to Appendix A and excellent review [78] for more technical details and to start
the reference trail.
Section 7
One of the motivations for building the quantum computer, at least for physicists, is to solve the
time evolution of some complicated quantum mechanical system. This was also the motivation
given by Feynman around 1982. However, it was only in 1996 that an explicit quantum-inspired
algorithm for simulating the time evolution of a quantum system with local Hamiltonian was given
for the first time [79]. The algorithm made use of the Lie-Trotter formula to express the unitary
time evolution as a sequence of exponentials and had a complexity of O(t||H||)2 where t is the
time and ||H|| is the spectral norm (also called two-norm) of the Hamiltonian.
However, it is clear that most of the physically interesting quantum models cannot be simulated
on NISQ devices with just a few hundred/thousand noisy qubits. However, there is still a lot to
52
understand and this is an active area of research. It is already evident that even for non-relativistic
quantum systems the size of Hilbert space is very large and adding the relativistic behavior when
studying quantum field theories makes it worse. One has to understand the reduction of the
degrees of freedom properly while keeping the symmetries (such as ‘gauge symmetry’) intact.
There have been various proposals such as D-theory/quantum link models [80], dual variable using
character expansions with sum over irreducible representations of the gauge group [81] which are
then truncated, quantum groups such as SU (2)q approach, loop-string-hadron formalism [82],
light front dynamics method, and truncating the continuous symmetry groups by discrete point
symmetry such as in Ref. [83]. All these methods are based on finding smaller subspace of the
vector space to be represented by qubits. There is also a method based on continuous variables
(CVs) which plays an important role in analog quantum computing and has several advantages
over the discrete methods. These schemes have their merits and drawbacks and the effectiveness in
obtaining the continuum limit is still debatable. Some qubit regularization schemes also exits for
O(3) non-linear sigma model by exploiting equivalence to SU (2) and associated truncation over
irreducible representations but it is by no means a general method and works only for this specific
group. We do not know of any work which attempts O(N ) models with N ≥ 4. Even for scalar
field theories such as ϕ4 theory in 1+1-dimensions, the quantum simulation and extracting of real-
time properties and correlators are still not fully understood. There are approaches based on field
variables following JLP [84], harmonic oscillator basis [85], continuous variable approach [86], and
single-particle basis [87] to name a few. Here, we will simply focus on some simple examples where
one desires time evolution using some Hamiltonian with circuit depths 37 that may be performed
on the NISQ devices.
We can perceive any quantum circuit as a simulation of some Hamiltonian H. This follows
from the standard observation that any (noiseless) the quantum circuit can be built up of pieces
of unitary transformations whose product is also unitary. Once we have a given unitary transfor-
mation, we can find H such that U = e−iHt where t is some real parameter. The time evolution
of any given state can be defined by this U .
In addition to the time evolution of a given quantum state with some H, this unitary evolution
also plays an important role in the HHL algorithm [88, 89] which is a quantum algorithm to solve
a linear system of equations i.e., A⃗x = ⃗b where A is a Hermitian n × n matrix which is d-sparse.
HHL algorithm started a mini-revolution in various areas of research including quantum machine
learning (QML). The reason was in the fact that it addresses one of the most important problems of
linear algebra - solving linear systems. HHL is expected to have time complexity O(log(n)d2 κ2 /ϵ)
and exponential speedup over the best known classical algorithm, conjugate gradient [90], with
√
complexity O(nd κ log(1/ϵ)).
However, there are some conditions that must be satisfied for this to hold. These conditions
37
The depth of a circuit is the longest path between the data input and the output, where each intermediate gate
counts as one. The circuit depth can be easily found in Qiskit using qc.depth() where qc is the quantum circuit.
53
related to loading ⃗b quickly, applying e−iAt with A being d-sparse 38 , well-behaved condition number
κ of matrix A, and the lack of obtaining all elements of ⃗x [91]. It is clear that these might be
difficult to satisfy all at once in practice and hence the speedup might be lost. And even if we
satisfy all these conditions, we do not have full access to the ⃗b like the classical case but only to
A−1 b . With the state in hand, we can make measurements to know the features of the output
state. It might have deep implications in the future, but, in practice, HHL does not appear to be
of much use in the NISQ era. Also, the HHL algorithm complexity severely depends (more than
the best classical) on condition number and sparsity.
• • (7.2)
Rz
where the argument of Rz gate is −2t. This is sometimes also written as: exp(itZj ⊗ Zk ) =
CNOTjk (Ij Rz (−2t)k ) ⊗ CNOTjk with j, k denoting the qubits on which the gates act. Similarly,
we can construct a circuit for the three-qubit term, σz ⊗ σz ⊗ σz as:
38
A matrix is d-sparse if it contains at most d nonzero entries per row/column for some d ≪ n
39
Note that we have exp(±iθU ) = cos(θ)1 ± i sin(θ)U if U 2 = 1.
54
• • (7.3)
• •
Rz
Sometimes, for brevity, we refer to the Pauli matrices just by X, Y, Z respectively.
Now, suppose
we have different Pauli matrices term in the Hamiltonian as: X ⊗ X + Y ⊗ Y . The corresponding
circuit can be used to perform time evolution i.e., it is equivalent to exp[i(α/2)(X ⊗ X + Y ⊗ Y )]
• H • Rz (−α) • H • (7.4)
Rz (α)
It is easy to check this using Mathematica code below which has been broken down for simplicity.
1 X = PauliMatrix[1];
2 Y = PauliMatrix[2];
3 Z = PauliMatrix[3];
4 XXplusYY = MatrixExp[I (KroneckerProduct[X, X] + KroneckerProduct[Y, Y]) \[Alpha]/2];
5 XtimesX = MatrixExp[I (KroneckerProduct[X, X]) \[Alpha]/2];
6 ZtimesZ = MatrixExp[I (KroneckerProduct[Z, Z]) \[Alpha]/2];
7 YtimesY = MatrixExp[I (KroneckerProduct[Y, Y]) \[Alpha]/2];
8 XtimesY = MatrixExp[I (KroneckerProduct[X, Y]) \[Alpha]/2];
9 CNOT = {{1, 0, 0, 0}, {0, 1, 0, 0}, {0, 0, 0, 1}, {0, 0, 1, 0}};
10 HAD = {{1/\[Sqrt]2, 1/\[Sqrt]2}, {1/\[Sqrt]2, -(1/\[Sqrt]2)}};
11 S = {{1, 0}, {0, I}};
12 S1 = KroneckerProduct[S, S];
13 HAD1 = KroneckerProduct[HAD, IdentityMatrix[2]];
14 HAD2 = KroneckerProduct[HAD, HAD];
15 RZ1 = KroneckerProduct[IdentityMatrix[2], MatrixExp[I (\[Alpha]/2) Z]];
16 RZ2 = KroneckerProduct[MatrixExp[I (\[Alpha]/2) Z], MatrixExp[I (-\[Alpha]/2) Z]];
17
18 (* Check! *)
19
55
31 YYcir = KroneckerProduct[HY, HY] . ZZ . KroneckerProduct[HY, HY] // FullSimplify ;
32 YtimesY == YYcir;
33 XYcir = KroneckerProduct[HAD, HY] . ZZ . KroneckerProduct[HAD, HY] // FullSimplify ;
34 XtimesY = XYcir;
It is also useful to note that eitI⊗P⊗I = I ⊗ eitP ⊗ I, where P is single Pauli matrix or a string
because eitI⊗P⊗I = cos(t)I ⊗ I ⊗ I + i sin(t)I ⊗ P ⊗ I = I ⊗ cos(t)I + i sin(t)P ⊗ I = I ⊗ eiPt ⊗ I.
Hy • • Hy (7.5)
H Rz (−2t) H
1 −i
!
where Hy = √1
2
while the second term is given by (7.2). Combining, we get for one step,
i −1
• • Hy • • Hy (7.6)
Rz (−2t) H Rz (−2t) H
1 CT = KroneckerProduct;
2 X = PauliMatrix[1];
3 Y = PauliMatrix[2];
4 Z = PauliMatrix[3];
5 CNOT = {{1, 0, 0, 0}, {0, 1, 0, 0}, {0, 0, 0, 1}, {0, 0, 1, 0}};
6 HAD = {{1/\[Sqrt]2, 1/\[Sqrt]2}, {1/\[Sqrt]2, -(1/\[Sqrt]2)}};
7 HY = {{1/\[Sqrt]2, -I/\[Sqrt]2}, {I/\[Sqrt]2, -(1/\[Sqrt]2)}};
8 XXYYv1 = CNOT . CT[HAD, IdentityMatrix[2]] . CNOT . CT[MatrixExp[I (\[Alpha]/2) Z],
MatrixExp[I (-\[Alpha]/2) Z]] . CNOT . CT[HAD, IdentityMatrix[2]] . CNOT // FullSimplify;
9 XXYYv2 = (CT[HAD, HAD] . CNOT . CT[IdentityMatrix[2], MatrixExp[I (\[Alpha]/2) Z]] . CNOT .
CT[HAD, HAD]) . (CT[HY, HY] . CNOT . CT[IdentityMatrix[2], MatrixExp[I (\[Alpha]/2) Z]] .
CNOT . CT[HY, HY] ) // FullSimplify;
10 XXYYv1 == XXYYv2 == MatrixExp[I (KroneckerProduct[X, X] + KroneckerProduct[Y, Y]) \[Alpha]/2]
56
▶ Question 22: Consider the three-qubit Hamiltonian given by:
H = σy ⊗ σy ⊗ σx − σz ⊗ σz ⊗ σz − σz ⊗ 1 ⊗ 1.
Construct the quantum circuit for the unitary operator (exp(iH)) corresponding to it. It might
1
!
−i
be useful to remember that X = H · Z · H and Y = Hy · Z · Hy where Hy = √12 .
i −1
However, the method we just described in terms of Pauli strings is highly inefficient and in
fact for most cases, as worse as classical methods. We will now consider some state-of-the-art
Hamiltonian simulation techniques which are better suited for quantum computers. These are
based on sparse representation rather than local representation in terms of Pauli operators.
We recall some useful definitions about norms of vectors and operators since they will appear
later in the section. To measure the distance between two elements in an arbitrary vector space,
we can use - Manhattan norm (also called ‘l1 norm’): ||x||1 = ni=1 |xi |, or the Euclidean norm
P
!1/2
(also called ‘l2 norm’): ||x||2 = or the Supremum norm: ||x|| = max.|xi | where
Pn 2
i=1 xi
x = (x1 , · · · , xn ) ∈ Rn . For matrices (operators), let us denote by σ(A), the vector whose elements
are singular values of positive operator |A| which is defined as: (A† · A)1/2 . Then the Schatten
p-norm (where 1 ≤ p < ∞) is defined as:
N
!1/p
p
||A||p = (7.7)
X
σi .
i=1
This norm is unitary invariant. When p = 2, it is called the Frobenius norm or the Hilbert–Schmidt
√
norm. We also note that Frobenius norm is ||A||F = TrA† A = i,j A2ij . And that ||U A||2F =
P
||A||2F . We can use this and the equivalent result ||AV ||2F = ||A||2F for unitary matrices U, V to
reduce it to the form of singular values. FirstqPwe write SVD of A as U SV . Then we have
T
||A||F = ||U SV T ||F = ||SV T ||F = ||S||F = i=1 σi . The p = ∞ limit is called the spectral
N 2
norm. In some cases, people also refer to the spectral or operator norm (Schatten ∞-norm) by
induced 2-norm which is square root of maximum eigenvalue of (A† · A)1/2 .
In general, there are two most-used ways of decomposing the unitary operator (exponential of
Hermitian matrix H): 1) Lie-product method, and 2) Taylor Series. We discuss them below.
• Lie-product decomposition approach: This is sometimes called divide and conquer method
since the Hamiltonian is broken into small pieces as H = m
j=1 αj Hj which are then evolved.
P
m
!N !
exp(−iHt) = exp(−iHj t/N ) +O [Hj , Hk ] t /N (7.8)
Y X
2
j=1 j,k
57
So, if we have all the terms in decomposition of H nearly-commuting, then the Trotter error
is reduced greatly and vanishes if they commute. Therefore, one can improve on errors by
making use of various commutative relations. Based on the structure of H, some Hamiltonian
simulations might be very simple and some can be notoriously hard.
However for all practical purposes, we have to truncate this infinite sum at some order K as:
K
b (t) =
X (−itH)k
U
k=0
k!
K XL k
t
= αl (−i)k (7.10)
X Y Y
Hl
k=0 l=1
k!
N
= (7.11)
X
α
fi H
fi .
i=0
where H̃ = (−i)k H and coefficients α̃ = tk /k! α. The second sum in (7.10) comes
Q Q
log(αt/ϵ)
!
K=O . (7.13)
log log(αt/ϵ)
58
Proof.
∞ ∞
b (t) − (−itH)k (−itH)k
=
X X
U
k=0
k! k=K+1
k!
∞
(t αl )k
P
l
X
≤
K+1
k!
∞
(t αl )K+1 X
P " #
l
(t αl )j /j!
X
≤
(K + 1)! j=0 l
(αt/r)K+1
≤ eαt/r (7.14)
(K + 1)!
Note that in the literature, the LCU followed by oblivious amplitude amplification [93] is
referred to as ‘truncated Taylor series’ (TTS) algorithm [94].
The efficiency of the quantum simulation depends strongly on how the terms in Hamiltonian
behave and how many qubits they act at a given time. In this regard, one defines the notion of
k-local Hamiltonian. Suppose we have a Hamiltonian acting on n qubits, i.e., the operator is a
2n × 2n matrix, H = a Ha , it is k-local in the sense that each Ha acts non-trivially on at most k
P
qubits at a time. A k-local Hamiltonian can be read in polynomial time and is simpler to handle.
If we want to determine the ground state energy of such a Hamiltonian, then it is called the k-local
Hamiltonian problem. There is a very close relationship between complexity classes and k-local
Hamiltonian problem. It was shown in several works that it is QMA complete for all k ≥ 2
[95]. A detailed discussion of this lies beyond the scope of this article. In Table, we list all major
Hamiltionian simulation algorithms and their complexity. However, note that no one algorithms fit
all conditions. The choice is based on the nature of Hamiltonian (time-dependent or independent)
and symmetries which can be exploited and how local the H is in general. In general, it is known
that if the size of H is 2n × 2n , then there exists a decomposition of H m j=1 Hj where each Hj is
P
1-sparse, such that m = O(d ) and each query to any Hj can be simulated41 by making O(log∗ n).
2
41
Note that log∗ n implies the iterated algorithm. It is defined as:
(
0 if n ≤ 1
log∗ n =
∗
1 + log (log n) if n > 1
59
Algorithm Complexity
One thing to note is that the Hamiltonian simulation algorithms based on Lie-Trotter product
formulas do not admit error dependence that is polylog(1/ϵ) whereas starting with Ref. [94, 100].
However, for most applications in Physics, it seems like the use of Trotter method is preferred since
for models with local interactions, the complexity of using non-Trotter is not worth the gain in
errors. We are not aware of a systematic study of a lattice gauge theory model comparing different
time evolution methods.
Section 8
Future
The challenges in making scalable quantum computers and performing interesting computations
which could change the way we perceive the world is still decades away. We have come a long
way since the first papers in the field were written about 45 years ago, however, lot remains to be
done both on theoretical and experimental front. For the physically interesting problems physicists
would really like to solve, it is expected that an order of million noisy qubits might be needed as
shown in Fig. 15. The pursuit of this goal will definitely teach us new things about computation
and more importantly about deep foundations of quantum mechanics. One must be hopeful to
solve several if not all problems.
Section 9
Acknowledgements
The research was supported by the U.S. Department of Energy, Office of Science, National Quan-
tum Information Science Research Centers, Co-design Center for Quantum Advantage under con-
60
Figure 15. Estimate of the number of qubits needed to perform different types of computations. The inset
mentions the effect of gate operation time on the estimate. The figure is taken from Ref. [101].
tract number DE-SC0012704. This material is based upon work supported by the U.S. Depart-
ment of Energy, Office of Science, Office of Nuclear Physics under contract DE-AC05-06OR23177.
Research at Perimeter Institute was supported by the Government of Canada through the Depart-
ment of Innovation, Science and Economic Development Canada and by the Province of Ontario
through the Ministry of Research, Innovation and Science. All the quantum circuits were made
using Qcircuit introduced in Ref. [102].
Section A
In this article, we have focused only on the qubit-based quantum computing which utilize the
two-state quantum system (qubits) to store and manipulate the information. However, not all
quantum systems in nature are not restricted to this setup. For example, one can have qudit
systems where the local Hilbert space is d > 2. In fact, one can go all the way to consider the
d → ∞ limit which are formally referred to as ‘qumodes’ and constitute the continuous variable
(CV) formulation of quantum computing (CVQC). One can think of ‘qumodes’ as storing the
state of a boson which lives in an infinite dimensional vector space. Therefore, a single qumode
can be described by a quantum-mechanical harmonic oscillator. It is these states which one uses
to encode the information similar to qubits where only |0⟩ and |1⟩ are used. In general, the state
of the qumode is usually represented by two bases: 1) Phase-space basis where the CV gates or
operators are written in terms of x̂, p̂, and 2) Fock space basis where operators are written in
terms of â, ↠. In the phase-space representation, the computational basis is in terms of strength
of electric and magnetic fields which are related by Fourier transform. In the Fock basis, it is given
in terms of measurement of the number of bosons (or photons) measured in the computational
61
basis represented by |n⟩. In practice, one truncates the qumodes at some cutoff Λ to obtain a qudit
system. We refer the interested reader to Ref. [103] for more detailed explanation.
This approach to quantum computing is formally related to the storing and manipulation
in terms of quantum harmonic oscillators (QHO) and makes use of physical observables whose
numerical values belong to continuous intervals (say the x and p quadrature operators). The CV
formulation has a very natural experimental realisation in terms of photon and the protocols of
quantum information can be implemented using the techniques of quantum optics. Every mode of
the electromagnetic field is a single QHO with its own set of creation and annihilation operators
which are related to the ‘quadratures’. It has been well-known now for decades that the theory
of quantum information based on this alternate CV formalism provides an alternative ground
for quantum computing [104, 105]. In particular, they have been shown to be useful towards
long-term goal of fault-tolerant quantum computing [106, 107]. The CV quantum systems is also
significant for quantum machine learning since it can provide an arena for realization of quantum
neural networks [108]. There also have been extension of algorithms to continuous variables such
as Grover’s algorithm [109], Deutsch-Jozsa [110] and analog of Shor’s code to correct an arbitrary
single wavepacket errors using a 5-wavepacket code [111]. Before going into further details of
CV states, gates, and how measurements are done, we present a quick summary of the QHO. A
one-dimensional quantum harmonic oscillator is described by the following Hamiltonian:
p̂2 x̂2
Ĥ = + . (A.1)
2 2
One can then define a complex operator â as:
1
â = √ (x̂ + ip̂) (A.2)
2
and the complex conjugate of this as ↠. Using this, we can write x̂ and p̂ as:
1
x̂ = √ (â + ↠),
2
1
p̂ = i √ (â − ↠). (A.3)
2
The operator â is not Hermitian, since it is not equal to ↠. The action of these operators on the
energy eigenstates |n⟩ (also ‘Fock’ states) are given as:
√
↠|n⟩ = n + 1 |n + 1⟩ ,
√
â |n⟩ = n |n − 1⟩ . (A.4)
because of how it adds and removes quanta, these are also known as ‘creation’ and ‘annihilation’
operators. Using these relations, it is sometimes useful to define the number operator N = ↠â
which acts as: N |n⟩ = n |n⟩. Using this, we can write the QHO Hamiltonian as:
1
Ĥ = ℏω N + . (A.5)
2
62
We will first discuss some important gates in CVQC and then move to discuss the CV states and
measurements.
A.1 CV gates
Just like the qubit based computation, we have CV gates in terms of creation and annihilation
operators. We describe some Gaussian CV gates below:
where α ∈ C and ↠and â are the creation and annihilation operators respectively. The
set of all displacement operators form a Heisenberg-Weyl group which is the ‘qumodes’
generalization of Pauli group for qubits. This operator affects the position and momentum
√ √
operators as D† (α)x̂D(α) = x̂ + 2ℏ R(α)1 and D† (α)p̂D(α) = p̂ + 2ℏ I(α)1
• Rotation:
R(ϕ) = exp iϕ↠â (A.9)
63
• Controlled-X: The controlled-X gate (also known as sum/addition gate is a controlled posi-
tion displacement and is given by (in position basis):
It is called addition gate because CX(r) |x1 , x2 ⟩ = |x1 , x2 + rx1 ⟩. This gate can also be
decomposed in terms of single-mode squeezing and beamsplitter gate. One can also define
double-controlled version [112] of this gate i.e, CCX(r) = exp(−irp̂3 (x̂1 + x̂2 )). These gates
have some interesting usage. For example, in the qubit formalism, to add, we use full-adder
as discussed in Sec. 4.1 which makes use of single and double-controlled CNOT gates. An
equivalent CV version would then make use of the gates discussed above.
There is another useful state known as ‘displaced squeezed’ state which is obtained |α, z⟩ =
D(α) |0, z⟩ = D(α)S(z) |0⟩, with z being the squeezing parameter as above. In addition to these
γ 3
gates, there are also non-Gaussian gates such as ‘cubic’ and ‘Kerr’ gates given by V (γ) = exp(i 3! x̂ )
and K(κ) = exp(iκn̂ ) respectively where κ is some real parameter and n̂ is the number operator.
2
Example 5: Assume that we set ϕ = 0 such that BS(θ) = exp(θ(âb̂† − ↠b̂)). Show that
Proof. To show this, we have to use the BCH formula given by:
∞
αn
eαX Ae−αX = (A.14)
X
Cn ,
n=0
n!
= a cos θ + b sin θ.
64
A.2 CV states
The most basic CV state is the vacuum state (Gaussian) defined as:
1
Z
2 /(2)
|0⟩ = √
4
dx e−x |x⟩ , (A.17)
π
Following this, we can define other states by acting with some operator on |0⟩ as:
• Coherent states: These are minimum uncertainty state and eigenstate of the annihilation
operator (â |α⟩ = α |α⟩) given by:
∞
1 2 αn
|α⟩ = D(α) |0⟩ = e− 2 |α| (A.18)
X
√ |n⟩
n=0 n!
• Squeezed states: A squeezed state is a minimum uncertainty state with unequal quadrature
variances unlike coherent states. They are obtained by the action of squeezing operator on
vacuum i.e., |z⟩ = S(z) |0⟩
• Displaced squeezed (or squeezed coherent) states: A displaced squeezed state is obtained by
the action of squeezing operator on vacuum followed by a displacement operator i.e., |α, z⟩ =
D(α)S(z) |0⟩
• Cat states: These are superpositions of two coherent states (with opposite phases) |α⟩ and
|−α⟩ and are given by:
2
|cat⟩ = N e−|α| /2 |α⟩ + eiϕ |−α⟩ , (A.19)
when ϕ = 0, this is known as even cat state denoted by Cα+ while an odd cat state which
is |cat⟩ ∝ |α⟩ − |−α⟩ is obtained with ϕ = π. The normalization N is equal to (2 +
2 2
2e−2|α| cos(ϕ))−1/2 = (2 ± 2e−2|α| )−1/2 for even (odd) cat states i.e., |Cα± ⟩. These states are
2
non-Gaussian in nature. The odd and even cat states are quasi-orthogonal: ⟨−α|α⟩ = e−2α
and become orthogonal only as α → ∞.
A.3 Measurements
There are two classes of measurements in CVQC namely Gaussian and non-Gaussian. The Gaus-
sian class consists of two types: homodyne and heterodyne measurements. The non-Gaussian
measurement is photon counting.
Homodyne detection (ideal case) is a kind of projective measurement onto the eigenkets of
the quadrature operator x̂. While on the other hand, the heterodyne is a kind of projective
measurement onto the eigenkets of both the quadrature operator x̂ and p̂. Since they do not
commute, they can only be measured with some uncertainity. They can also be thought of as
projection onto the coherent states |α⟩. The lack of certainity stems from the fact that coherent
states are not orthogonal.
65
The non-Gaussian photon counting measurement, also known as photon number resolving
(PNR) detector, as the name suggests, counts the number of photos. This uses the particle like
character of the quanta rather than wavelike from the above mentioned ‘dyne’-type measurements.
This measurements projects onto the eigenkets of the number operator |n⟩. The process of PNR
detection on single mode of the multi-mode (large number of qumodes) Gaussian state changes
the other modes to non-Gaussian. This is not the case for the ‘dyne’-type measurements which
preserves the Gaussian character of the multimode state. In view of this, photon counting mea-
surement is useful for implementing non-Gaussian gates like cubic gate discussed before.
Now, with some background behind us, let us implement these using some SDK. Similar to the
use of Qiskit for qubit based QC, there is a photonic simulator using CVs developed by Xanadu
known as Strawberry Fields [113]. We refer to the reader to this reference for additional
simulation details. We give a small code snippet below with this simulator.
1 import strawberryfields as sf
2 from strawberryfields.ops import *
3
4 with prog.context as q:
5
Section B
The fundamental commutation relation in quantum mechanics is between the position and mo-
mentum operator (we often suppress the hat over x and p and other operators):
66
This commutation relation is strictly obeyed only in infinite-dimensional Hilbert space. One way to
see this is to obtain a ‘paradox’ by assuming that they belong to a finite vector space. Considering
taking trace on both sides of (B.1). We find that left side is zero using cyclic nature of trace while
the right side is non-zero. This is paradox arising because strictly speaking x, p are not trace-class
operators. We can also consider commutation relation between powers of x, p as:
using [A, BC] = [A, B]C + B[A, C] in the first step and repeating several intermediate steps n − 1
times. We can also use the relation below to compute the above commutator:
using [AB, C] = A[B, C] + [A, C]B and [a, a† ] = 1. Similarly, we can prove that [N, a] = −a. We
also need to compute commutator such as [an , a]. For this, it is useful to note two relations when
f is an analytic function.
df (a)
[a† , f (a)] = − ,
da
df (a† )
[a, f (a† )] = . (B.6)
da†
This immediately leads to [a, (a† )n ] = n(a† )n−1 , and [a† , an ] = −nan−1 . Using these we can then
compute:
[aq , n] = (aq a† − a† aq )a
= −[a† , aq ]a
= qaq . (B.7)
67
where q is some integer power. Similarly, we can show that [(a† )q , n] = −q(a† )q . Some other useful
† †
commutation relations which follows are: [â, eαâ ] = αeαâ and [↠, eαâ ] = −αeαâ . When dealing
with these operators, we should normal order them. The process of putting a product into normal
order is called normal ordering, also known as Wick ordering. Doing this results in all creation
operators being left of all annihilation operators in the product. It is denoted by the symbol : :.
For example, : bb† := b† b and : b† b := b† b. We give a Mathematica code to normal order the
operators and simplify some commutation expressions discussed above.
1 Unprotect[NonCommutativeMultiply];
2 A_ ** (B_ + C_) := A ** B + A ** C
3 (B_ + C_) ** A_ := B ** A + C ** A
4 A_ ** c_?NumberQ := c A
5 c_?NumberQ ** A_ := c A
6 A_ ** (B_ c_?NumberQ) := c A ** B
7 (A_ c_?NumberQ) ** B_ := c A ** B
8 A_ ** (B_ c_Rational) := c A ** B
9 (A_ c_Rational) ** B_ := c A ** B
10 A_ ** (B_ c_Power) := c A ** B
11 (A_ c_Power) ** B_ := c A ** B
12
13 commutator[A_, B_] := A ** B - B ** A
14 fundamentalXP[expr_] := ExpandAll[expr //. p[i_] ** q[i_] :> q[i] ** p[i] - I h]
15 fundamentalHO[expr_] := ExpandAll[expr //. a ** SuperDagger[a] :> SuperDagger[a] ** a + 1 //.
b ** SuperDagger[b] :> SuperDagger[b] ** b + 1]
16 h /: NumberQ[h] = True;
17 commutator[p[x], q[x] ** q[x] ** q[x]] // fundamentalXP (* [p,q^3] = -3 i \hbar q^2 *)
18 NCP[x___] := NonCommutativeMultiply[x];
19 NCP[0.50*SuperDagger[a] ** a + SuperDagger[b] ** b, 0.50 * SuperDagger[a] ** a +
SuperDagger[b] ** b] // fundamentalHO
In dealing with continuous variable approach to quantum computation, one often has to ma-
nipulate the bosonic operators. We collect some results in this section for the convenience of the
reader. The central result is the ‘BCH formula’. It is given by:
1 1
eX eY = eX+Y + 2 [X,Y ]+ 12 ([X,[X,Y ]]+[Y,[Y,X]])+... . (B.8)
D(α) = exp α↠− ᾱâ
1
= exp(− |α|2 ) exp(α↠) exp(−ᾱâ)) (B.9)
2
68
There is another very useful expression often called the dual of BCH formula first discussed
in Sec. 4 of Ref. [114]. This is known as Zassenhaus formula.
t2 t3
et(X+Y ) = etX · etY · e− 2 [X,Y ] · e 6 (2[Y,[X,Y ]]+[X,[X,Y ]]) · · · (B.10)
where as written above, the first few terms are C2 (X, Y ) = − 21 [X, Y ] and C3 (X, Y ) = 31 [Y, [X, Y ]]+
6 [X, [X, Y ]]. Though this is not that well-known, the corrolary of this formula is widely known as
1
, or equivalently:
The error with p-order product formula goes as O(tp+1 ). In fact, rather than exponential
of just sum of two operators, we can consider the general case which is often the most useful in
quantum simulation problems. In that case, we have the following result:
Pm m
−i Hj t
= e−iHj t + O(m2 t2 ), (B.14)
Y
e j=1
j=1
with t ≪ 1. This expansion would have been exact (i.e. no error) if it was just an ordinary
exponential but the error is because H is an operator/matrix. What happens if our simulation
time is t ≫ 1. In that case, one just divides the entire evolution into r steps such that t′ = t/r ≪ 1,
Pm m
!r
−i H t −iHj t′
= + O(m2 t2 /r). (B.15)
Y
e j=1 j e
j=1
If we desire an error of ϵ, then we must take r ∼ m2 t2 /ϵ. One can also use second-order formula:
Pm m 1
!r
−i H t −iHj t/2r −iHj t/2r
= + O(m3 t3 /r2 ). (B.16)
Y Y
e j=1 j e e
j=1 j=m
√
In this case, we need to scale r as ∼ m3/2 t3/2 / ϵ. The gate costs, accuracy, and the structure of
the Hamiltonian determines which choice is better.
Another frequently used identity is
†
U e−iHt U † = e−iU HU t . (B.17)
69
To prove the identity, let’s start with the left hand side and expand it:
∞
(−iHt)n
!
U †, (B.18)
X
U
n=0
n!
since the operators U and U † commute with the scalar coefficients in the series, we can rearrange
as: ∞
(−iU HU † t)n †
= e−iU HU t (B.19)
X
n=0
n!
which proves the result. An expression often encountered in Hamiltonian evolution problem is of
the form U † AU where U is exponential of matrix. For this, we have the following result known as
‘BCH lemma’ given by:
1 1
eB Ae−B = A + [B, A] + [B, [B, A]] + [B, [B, [B, A]]] + · · · (B.20)
2! 3!
† †a
Using (B.20), we can show that e−iθa a a† e−iθa = a† eiθ . The proof proceeds as follows:
† †a (iθ)2 † (iθ)2
e−iθa a a† e−iθa = a† + iθ[a† a, a† ] + [a a, [a† a, a]] + · · · = a† (1 + iθ + + · · · = a† eiθ .
2! 2!
(B.21)
Suppose now we have two set of oscillators (denoted by a and b respectively) with their own
creation and annihilation operators. Let us define the following:
L+ = a† b, L− = b† a, K+ = a† b† , K− = ba (B.24)
[K+ , K− ] = a† b† ba − baa† b†
= a† b† ba − aa† bb†
= a† b† ba − a† abb† − bb†
= a† a(b† b − bb† ) − bb†
= −a† a − 1 − b† b = −2K3 . (B.27)
70
The operators K+ , K− , K3 form a representation of the Lie algebra su(1, 1) and is the basis of
Schwinger’s work of rewriting the angular momentum in terms of oscillators.
1 2 1 1 1 1
eA Be−A = (I + A + A + A3 + . . . )(B − [A, B] + [A, [A, B]] − [A, [A, [A, B]]] + . . . )
2! 3! 1! 2! 3!
(B.28)
1 2 1
= B + [A, B] + (A B − AB 2 + [A, [A, B]]) + (A3 B − A2 B 2 + AB 3 − [A, [A, [A, B]]]) + . . .
2! 3!
∞ n−1 ∞
1 1 n−1
=B+ (−1) A B (−1)k [A, [A, [. . . [A, B] . . . ]]]
X X X X
k k n−1−k
A −
n=1
n! k=0
| {z }
n=1
n! k=0
(n − 1 − k) times
∞ n−1 ∞
1 1 n−1
=B+ (−1) A B − (−1)k [A, Bk ]
X X X X
k k
n=1
n! k=0 n=1
n! k=0
∞
1 n−1
=B+ [A, Bk ].
X X
n=1
n! k=0
where we have defined the nested commutator. There is another way to prove this using the idea
of parameter differentiation. For this, consider f (t) defined as etA Be−tA with f (0) = B. Then the
derivatives are:
f ′ (t) = etA ABe−tA + etA B(−A)e−tA = etA [A, B]e−tA , f ′ (0) = [A, B] (B.29)
f ′′ (t) = etA [A, [A, B]]e−tA f ′ (0) = [A, [A, B]].
Y i.e., [A, [A, B]], [B, [A, B]] = 0, we can also prove a general result. Let us denote f (ϵ) = eϵA eϵB ,
then we have:
where we have used eϵA Be−ϵA = B + ϵ[A, B]. The solution of (B.31) is:
ϵ2
f (ϵ) = exp(ϵ(A + B) + [A, B]). (B.32)
2
Setting ϵ = 1 above, the special case of BCH formula as:
1
eA eB = eA+B+ 2 [X,Y ] . (B.33)
71
Another result that follows from BCH lemma is when the commutator of A and B is a c-number
i.e., [A, B] = c and [A, [A, B] = 0. Then we get,
If the nested first commutator is non-zero i.e., [A, [A, B]] = βB then one can show that:
√
−αA sinh(α β)
αA
= B cosh(α β) + [A, B] (B.35)
p
e Be √ .
β
Note that this reduces to former result since the β → 0 limit of sinh term is α. There is another
useful theorem (often called similarity theorem):
Proof. From the identity [eϵA Be−ϵA ]n = eϵA B n e−ϵA , we find that the theorem follows if f (B) can
be expanded in power series.
Section C
As mentioned before, Qiskit (pronounced kiss-kit) is a backend simulator created by IBM where
we can build up a code which can then be sent to actual quantum hardware or quantum processing
units (QPU) in use by companies like IBM, Amazon, Honeywell etc. This is like how commercial
airline pilots train in a simulator when a new Boeing/Airbus aircraft is about to be launched42 .
Once we have sufficient practice, we can pass the quantum program to the real machines, but until
we really need them for some problem, the simulator is good enough to learn and get acquainted
with the fundamental working of the computation. We also note that the calculation of computa-
tion time and associated charges for quantum computing on real devices is not as straightforward
as classical computers. For example, we will see below that to get reasonable output from the
simulator, we have to perform a certain step number of times, which is referred to as ‘shot’ i.e., a
42
In fact, one of the reasons for the failure of 737 Max aircraft resulting in tragic accidents around 2019 is that
even though some new systems were introduced, the pilots were never ordered to take the new simulator training
because Boeing cited similarity with the ones they had already taken. It was however not true, and the cause of
accidents (MCAS system) was indeed the crucial difference.
72
shot is a single execution of a quantum algorithm on a QPU. Depending on the quality of QPU,
the per shot cost is determined. So, it might be that some quantum computing hardware company
will charge 1 for 100 shots and some will charge the same for 1000 shots. The per-shot price is
usually not affected by the number or type of gates used in a quantum circuit or the number of
variables employed. The idea of shots is closely related to the errors in quantum computers, and it
is to be expected that if there is a QPU with a well-defined error correcting procedure, then it will
limit the number of shots needed considerably. Another part of the computation cost is based on
number of ‘tasks’. A task is a sequence of successive shots using the same circuit design. Qiskit is
made up of four elements, each of which has a specific functionality. These elements are Terra
(Earth), Aer (Air), Ignis (Fire), and Aqua (Water). For example, the Aer provider contains a
variety of high performance simulator backends for a variety of simulation methods. The available
backends on the current system can be viewed using Aer.backends() in a Jupyter notebook.
This open-source software platform enables one to work with the quantum language Open
Quantum Assembly Language (Open QASM), used in quantum computers in the IBM. We encour-
age the reader to read more about them if interested in Ref. [55]. Here, we will briefly summarize
the different core modules of Qiskit for convenience. The Qiskit open-source development library
is composed of four core modules:
• Qiskit Terra: This contains core elements to create quantum programs at the circuit/pulses
level as well as to optimize these core elements by considering the particular physical quantum
processor constraints.
• Qiskit Aer: This provides a C++ simulator framework and tools to develop noise models to
conduct realistic simulations in the presence of noise and errors occurring during execution
on real quantum devices.
• Qiskit Ignis: This provides a framework to understand the noise sources in the quantum
circuits/devices as well as to develop different noise reduction procedures.
• Qiskit Aqua: This contains a library of cross-domain quantum algorithms suitable for appli-
cation in the NISQ era.
The syntax of Qiskit consists of following high-level steps: 1. Building step in which we design
a quantum circuit that represents the problem at hand, 2. The execution step in which we run
experiments on different backends (including both actual quantum hardware and simulators), and
the last is the analysis step where one summarizes the statistics and visualize the results. The SDK
we will focus on in these notes deals with systems with finite local Hilbert space of d = 2 (qubits)
or maybe some generalization to qudits too (d > 2) but they are often not the best way for bosonic
states which have infinite sized vector space. For these models, it is often more practical to make
use of what is called qumodes which are continuous-variable quantum modes. Very recently, an
open-source software was introduced in Ref. [115] which extends Qiskit to admit bosonic degrees
73
of freedom. This enables the simulation of hybrid qubit and bosonic systems such as bosonic
Hubbard models, Jaynes-Cummings etc. However, the support for parametrized circuits43 is still
in development phase. Another open-source project which is probably better suited for ground
state energy computation of bosonic models is Xanadu’s Strawberry Fields, which is a full-
stack Python library for designing, optimizing, and utilizing photonic quantum computers (analog
computing). Using continuous variables (CV) instead of the more traditional qubits (digital)
approach has both advantages and disadvantages. Some groups [69] have explored the use of
QITE (quantum imaginary-time evolution) to study the ground state energy using CVs. This
approach might also be useful in the future for other interesting models such as ϕ4 -theory. Though
the scope of this discussion lies beyond the scope of the current article, we will briefly mention
some differences to qubit approach. The CV approach to quantum computing keeps the same
computational power of the qubit model. This approach utilizes the infinite-dimensional bosonic
mode called ‘qumodes’. While the qubits make use of discrete coefficients, the CV model makes
use of bosonic harmonic oscillator, which is defined by the operators a and a† satisfying [a, a† ] = 1
and where |x⟩ are the eigenstates of x operator defined in terms of a, a† . In this approach, the
information about input states are stored in terms of Gaussian states which are non-classical states
with Gauss-Wigner quasi-probabilistic functions.
We then extend this to write our first ‘quantum’ code given below:
43
Parameterized quantum circuits consist of quantum gates defined through tunable parameters. They are funda-
mental building blocks of majority of near-term quantum machine learning algorithms
44
https://research.google.com/colaboratory
74
5 sim = Aer.get_backend(’aer_simulator’)
6
It is easy to generate d = 2n -dimensional state vector using a short program and then view it
on the Bloch sphere. Suppose we take n = 2 (two qubits) and generate a random state |ψ⟩.
It can be done as given below. Running this different times will move the arrow (on the Bloch
sphere) corresponding to different random state. The reader is encouraged to check that they are
appropriately normalized, i.e., ⟨ψ|ψ⟩ = 1. The output on the Bloch sphere for a random state
looks like that given in Fig. 16. Note that orthogonal states (such as |0⟩ and |1⟩) are antipodal on
the Bloch sphere.
75
Figure 16. A random two-qubit state depicted on the sphere.
4 rand_sv = random_statevector(4).data
5 print(rand_sv)
6 plot_bloch_multivector(rand_sv)
7
Now, since we have a bipartite random state, we can compute EOF as discussed in Sec. 3.3.2. For
example, if we compute this for Bell state mentioned above, it will be 1 (maximally entangled).
We give the code below:
4 rand_sv = random_statevector(4).data
5 print("Entanglement of Formation = ", entanglement_of_formation(rand_sv))
6
▶ Question 21: Set up a quantum circuit using Qiskit to create the state given by Eq. ??
and show that it is not entangled.
Let us now show the program to implement CSWAP gate as discussed in the text using Qiskit.
Note that if we take q0 = |+⟩, q1 = |0⟩, and q2 = |1⟩, then the action of CSWAP looks like:
√ 1
CSWAP 1
|1⟩ ⊗ |0⟩ ⊗ (1/ 2)(|0⟩ + |1⟩) = √ |100⟩ + |101⟩ −−−−−→ √ |100⟩ + |011⟩ (C.1)
2 2
76
1 from qiskit import *
2 from qiskit.quantum_info import *
3 from qiskit.visualization import *
4
5 qc = QuantumCircuit(3)
6 qc.h(0);
7 qc.x(2);
8 st = Statevector.from_instruction(qc)
9 display(array_to_latex(st, prefix="\\text{In state} = "))
10 qc.cswap(0,1,2)
11 st = Statevector.from_instruction(qc)
12 display(array_to_latex(st, prefix="\\text{ Out state} = "))
13 qc.draw()
14
In the program above, we have used qc.cswap(0,1,2) to implement CSWAP. Suppose we do not
have this three qubit gate and only have access to CNOT gate. We encourage the reader to write
the equivalent program. We can also entangle n qubits (using GHZ state construction) as follows:
8 circ = QuantumCircuit(qn)
9 circ.h(0)
10 circ.cx(0, 1)
11 circ.cx(0, 2)
12 circ.cx(0, 3)
13 circ.cx(0, 4)
14 circ.draw()
15 ghz = Statevector.from_instruction(circ)
16 display(array_to_latex(ghz, prefix="\\text{Statevector} = "))
17
Suppose we prepare some initial state and someone applies a quantum gate in our absence, is there
a way in Qiskit to see what this transformation was? The way to do it, this is (apart from usual
stuff):
77
4
We now turn to the computation of fidelity of two states which was discussed in the main text.
Consider two-states given by:
1
|ψ⟩ = |001⟩ + |101⟩ − |011⟩ − |111⟩ ,
2
and
1
√ |000⟩ + |111⟩ .
2
Compute the fidelity between them using Qiskit.
6 qc1 = QuantumCircuit(3)
7 qc1.h(0);
8 qc1.h(1);
9 qc1.x(2);
10 qc2 = QuantumCircuit(3)
11 qc2.h(0)
12 qc2.cx(0,1);
13 qc2.cx(0,2);
14
15 backend = Aer.get_backend(’statevector_simulator’)
16 sv1 = execute(qc1, backend).result().get_statevector(qc1)
17 sv2 = execute(qc2, backend).result().get_statevector(qc2)
18 print(state_fidelity(sv1, sv2))
19
6 qc = QuantumCircuit(4,2)
7
8 # Preparing inputs
9 # We do: A and B to a Bell state and CarryIn to a superposition state
78
10 qc.h(0)
11 qc.cx(0,1)
12 # To Bell State: Hadamard followed by CNOT
13 qc.h(2) # CarryIn to superposition by Hadamard
14
15 # Adder starts
16 qc.ccx(0,1,3) # Toffoli gate [three qubit]
17 qc.cx(0,1)
18 qc.ccx(1,2,3)
19 qc.cx(1,2)
20 qc.cx(0,1)
21
22 qc.measure(2,0) # Sum
23 qc.measure(3,1) # Carry-out
24 counts = execute(qc, Aer.get_backend(’qasm_simulator’), shots=1024).result().get_counts()
25 print(counts)
26 plot_histogram(counts)
The circuit for quantum full-adder is given by (we have left out the part where qubits are
initialized, see code for details):
a • • • p1 (C.2)
b • • • p2
q2 • carry-in
q3 sum
5 n = 3
6
7 def diffuser(nqubits):
8
79
13 for qubit in range(nqubits):
14 qc.h(qubit)
15
20 # ****************************
21 # Do multi-controlled-Z gate
22 # by using Multi controlled Toffoli
23 # Recall that HXH = Z
24 qc.h(nqubits-1)
25 qc.mct(list(range(nqubits-1)), nqubits-1) # Multi-controlled
26 qc.h(nqubits-1)
27 # ****************************
28
29 # Now X to all
30 # Apply transformation |1 ... 1> -> |0 ... 0>
31 for qubit in range(nqubits):
32 qc.x(qubit)
33
43
46 if n == 2:
47 oracle.cz(0,1)
48 if n == 3:
49 oracle.cz(1, 2)
50
51 oracle.to_gate()
52 # Oracle is CZ gate. This will change based on target state.
53 # We provide two example |11> and |110>
54
55 backend = Aer.get_backend(’statevector_simulator’)
56 gro_circ = QuantumCircuit(n,n)
57 gro_circ.h(list(range(n)))
58 gro_circ.append(oracle,list(range(n)))
80
59
60 gro_circ.append(diffuser(n),list(range(n)))
61
62 backend = Aer.get_backend(’qasm_simulator’)
63 gro_circ.measure([0,1],[0,1])
64 job = execute(gro_circ,backend, shots=1)
65 result = job.result()
66 result.get_counts()
|x3 ⟩ • • H |y1 ⟩
1 # QuantumFourier program
2
11 if n == 0:
12 return circuit
13
14 n -= 1
81
15 circuit.h(n)
16
20 qft_rotations(circuit, n)
21
22
29
36
41 qc = QuantumCircuit(nbits)
42
43 # If done nothing, encodes 000 [i.e., all qubits set to 0 i.e., |000>]
44 # We will try encoding 5 i.e, |101>
45 qc.x(0)
46 qc.x(2)
47
48 sim = Aer.get_backend("aer_simulator")
49 qc_init = qc.copy()
50 qc_init.save_statevector()
51 statevector = sim.run(qc_init).result().get_statevector()
52 plot_bloch_multivector(statevector, title= "Before: |101> := |dud> ")
53
54 # Apply QFT
55
56 qft(qc,nbits)
57 #qc.draw()
58
59 psi_AB = Statevector.from_instruction(qc)
60 plot_bloch_multivector(psi_AB, title= "After: QFT_8|101>")
82
C.6 Bit-flip code, Phase kickback
7 backend = Aer.get_backend(’qasm_simulator’)
8 circuit = QuantumCircuit(3,1)
9
10 # Encode
11 circuit.cx(0,1)
12 circuit.cx(0,2)
13
14 # Noise
15 circuit.x(0) # Impose a bit flip error by Pauli X
16
17 # Decode
18 circuit.cx(0,1)
19 circuit.cx(0,2)
20 circuit.ccx(2,1,0)
21 circuit.measure(0,0)
22
Now we do phase kickback to reproduce the state mentioned in (4.2) with ϕ = π/4.
1 # Phase kickback
2
8 def phase_kickback():
9 qreg = QuantumRegister(2, ’q’)
10 qc1 = QuantumCircuit(qreg)
11 qc1.x(qreg[1])
12 qc1.h(qreg[0])
13 qc1.cp(pi/4, 0, 1) # Controlled T
14 return qc1
15
16 qc = phase_kickback()
83
17 qc.draw()
18 co = Statevector.from_instruction(qc)
19 plot_bloch_multivector(co)
20 # We can see the qubit 0 has been rotated by pi/4 around
21 # the Z-axis of the Bloch sphere as expected.
17 def decompose(H):
18
19 def dagger(a):
20 return np.transpose(a).conj()
21
26 def c2s(c):
27 if c == 0.0:
28 return "0"
29 if c.imag == 0:
30 return "%g" % c.real
31 elif c.real == 0:
32 return "%gj" % c.imag
33 else:
34 return "%g+%gj" % (c.real, c.imag)
84
35
44 if nbits == 2:
45 for i, j in itertools.product(range(4),range(4)):
46 a = (1/2**nbits) * HS(np.kron(S[i], S[j]), H)
47 # Formula: (1/2^2) (Si otimes Sj) dot H
48 if a != 0.0:
49 term = c2s(a),’*’,labels[i],’^’,labels[j]
50 t2 = str(term).replace(’,’, ’’)
51 t2 = str(t2).replace("’", "")
52
53 if final == "":
54 final = "".join((final, t2))
55 else:
56 final = "+".join((final, t2))
57
58 if nbits == 3:
59 for i, j, k in itertools.product(range(4),range(4),range(4)):
60 a = (1/2**nbits) * HS(np.kron(np.kron(S[i], S[j]),S[k]), H)
61
62 if a != 0.0:
63 term = c2s(a),’*’,labels[i],’^’,labels[j],’^’,labels[k]
64 t2 = str(term).replace(’,’, ’’)
65 t2 = str(t2).replace("’", "")
66
67 if final == "":
68 final = "".join((final, t2))
69 else:
70 final = "+".join((final, t2))
71
72 return final
73
74
75 # Alternative way
76
85
81 counter = 0
82 while n:
83 digits[counter] = int(n % b)
84 n //= b
85 counter += 1
86 return digits[::-1]
87
88 def decomposePauli(H):
89
116
120 n = int(np.log2(len(H)))
121 N = 2 ** n
122 # Basic checks!
123
86
126
153
87
167 # array_to_latex(H_matrix)
168
172 rngseed = 5
173 warnings.filterwarnings("ignore")
174 backend = Aer.get_backend("statevector_simulator", max_parallel_threads=1,
max_parallel_experiments=0)
175 q_instance = QuantumInstance(backend, seed_transpiler=rngseed, seed_simulator=rngseed)
176 #optimizer = SLSQP(maxiter=600)
177 optimizer = COBYLA(maxiter=600)
178 # COBYLA works little better!
179
7 qbits=4
8 cbits=3
88
9 theta= 2*pi*(1/4) # Actually \theta is without 2*pi but abuse notation!
10 qc = QuantumCircuit(qbits, cbits)
11
27 sheets = 1
28 for qubit_first_reg in range(qbits-1):
29 for i in range(sheets):
30 qc.cp(theta, qubit_first_reg, qbits-1); # Target is last qubit (i.e. first qubit of
second register)
31 sheets *= 2
32
42 backend = Aer.get_backend(’aer_simulator’)
43 job = execute(qc,backend,shots=2048)
44 result = job.result()
45 count = result.get_counts()
46 plot_histogram(count)
1 import numpy as np
2 from qiskit import QuantumCircuit, QuantumRegister
89
3 from qiskit.quantum_info.synthesis import two_qubit_decompose
4 from qiskit.compiler import transpile
5
8 def random_unitary_matrix(n):
9 # Generate a random complex matrix
10 mat = np.random.randn(n, n) + 1j * np.random.randn(n, n)
11 # Compute the QR decomposition
12 q, r = np.linalg.qr(mat)
13 # Return the unitary matrix
14 return q
15
16
25
33 # Example usage
34 qbits=3
35 qubits = [i for i in range(0, qbits)]
36
43 print(dict(circuit.count_ops()))
90
1 ent = Sqrt[1/2]*(KetV[0,2] \[CircleTimes] KetV[0,2]+ KetV[1,2] \[CircleTimes] KetV[1,2])
2 rho12 = DM[ent];
3 rhonew = {{5/12, 1/6, 1/6}, {1/6, 1/6, 1/6}, {1/6, 1/6, 5/12}};
4 vNEntropy[rhonew, {1}, {3}]*Log[2] // N
5 rho1 = PickRandomRho[4];
6 rho2 = PickRandomRho[4];
7 Chop[RelEnt[rho1, rho2]]
8 rstate = PickRandomRho[4]
9 vNEntropy[rstate, {1}, {4}] * Log[2]
10
91
References
[1] R. Landauer, “Information is physical,” Physics Today 44 no. 5, (May, 1991) 23–29.
https://doi.org/10.1063%2F1.881299.
[2] R. Landauer, “The physical nature of information,” Physics Letters A 217 no. 4-5, (Jul, 1996)
188–193. https://doi.org/10.1016%2F0375-9601%2896%2900453-7.
[3] J. Preskill, “Quantum information and physics: some future directions,” J. Mod. Opt. 47 (2000)
127–137, arXiv:quant-ph/9904022.
[4] R. Landauer, “Irreversibility and heat generation in the computing process,” IBM Journal of
Research and Development 5 no. 3, (Jul, 1961) 183–191. https://doi.org/10.1147%2Frd.53.0183.
[5] C. H. Bennett, “The thermodynamics of computation—a review,” International Journal of
Theoretical Physics 21 no. 12, (Dec, 1982) 905–940. https://doi.org/10.1007%2Fbf02084158.
[6] P. Benioff, “The computer as a physical system: A microscopic quantum mechanical hamiltonian
model of computers as represented by turing machines,” Journal of Statistical Physics 22 no. 5,
(May, 1980) 563–591. https://doi.org/10.1007%2Fbf01011339.
[7] P. Benioff, “Quantum mechanical hamiltonian models of turing machines,” Journal of Statistical
Physics 29 no. 3, (Nov., 1982) 515–546.
[8] C. H. Bennett, “Logical reversibility of computation,” IBM Journal of Research and Development
17 no. 6, (Nov, 1973) 525–532. https://doi.org/10.1147%2Frd.176.0525.
[9] Y. Manin, “Computable and Uncomputable (in Russian),” 1980.
[10] R. P. Feynman, “Simulating physics with computers,” International Journal of Theoretical Physics
21 no. 6, (1982) 467–488.
[11] M. A. Nielsen and I. L. Chuang, Quantum Computation and Quantum Information: 10th
Anniversary Edition. Cambridge University Press, USA, 10th ed., 2011.
[12] P. W. Shor, “Introduction to Quantum Algorithms,” arXiv e-prints (Apr., 2000) quant–ph/0005003,
arXiv:quant-ph/0005003 [quant-ph].
[13] D. P. DiVincenzo, “The physical implementation of quantum computation,” Fortschritte der Physik
48 no. 9-11, (Sep, 2000) 771–783. https://doi.org/10.1002%2F1521-3978%28200009%2948%3A9%
2F11%3C771%3A%3Aaid-prop771%3E3.0.co%3B2-e.
[14] S. P. Jordan, H. Krovi, K. S. M. Lee, and J. Preskill, “BQP-completeness of Scattering in Scalar
Quantum Field Theory,” Quantum 2 (2018) 44, arXiv:1703.00454 [quant-ph].
[15] S. Aaronson and L. Chen, “Complexity-theoretic foundations of quantum supremacy experiments,”
2016. https://arxiv.org/abs/1612.05903.
[16] https://ai.googleblog.com/2019/10/quantum-supremacy-using-programmable.html.
[17] P. A. M. Dirac, “A new notation for quantum mechanics,” Mathematical Proceedings of the
Cambridge Philosophical Society 35 no. 3, (Jul, 1939) 416–418.
https://doi.org/10.1017%2Fs0305004100021162.
92
[18] Y. Shi, “Both toffoli and controlled-not need little help to do universal quantum computation,”
arXiv preprint quant-ph/0205115 (2002) .
[19] D. Aharonov, “A simple proof that toffoli and hadamard are quantum universal,” arXiv preprint
quant-ph/0301040 (2003) .
[20] V. V. Shende and I. L. Markov, “On the CNOT-cost of TOFFOLI gates,” arXiv e-prints (Mar.,
2008) arXiv:0803.2316, arXiv:0803.2316 [quant-ph].
[21] G. J. Milburn, “Quantum optical fredkin gate,” Phys. Rev. Lett. 62 (May, 1989) 2124–2127.
https://link.aps.org/doi/10.1103/PhysRevLett.62.2124.
[22] R. P. Feynman, “Quantum mechanical computers,” Foundations of Physics 16 no. 6, (1986)
507–531.
[23] W. Dür, G. Vidal, and J. I. Cirac, “Three qubits can be entangled in two inequivalent ways,”
Physical Review A 62 no. 6, (Nov, 2000) . https://doi.org/10.1103%2Fphysreva.62.062314.
[24] P. Boykin, T. Mor, M. Pulver, V. Roychowdhury, and F. Vatan, “A new universal and fault-tolerant
quantum basis,” Information Processing Letters 75 no. 3, (Aug, 2000) 101–107.
https://doi.org/10.1016%2Fs0020-0190%2800%2900084-3.
[25] A. Y. Kitaev, “Quantum computations: algorithms and error correction,” Russian Mathematical
Surveys 52 no. 6, (Dec, 1997) 1191–1249.
https://doi.org/10.1070%2Frm1997v052n06abeh002155.
[26] A. Barenco, C. H. Bennett, R. Cleve, D. P. DiVincenzo, N. Margolus, P. Shor, T. Sleator, J. A.
Smolin, and H. Weinfurter, “Elementary gates for quantum computation,” Phys. Rev. A 52 (Nov,
1995) 3457–3467. https://link.aps.org/doi/10.1103/PhysRevA.52.3457.
[27] C. M. Dawson and M. A. Nielsen, “The solovay-kitaev algorithm,” 2005.
https://arxiv.org/abs/quant-ph/0505030.
[28] D. P. DiVincenzo and J. Smolin, “Results on two-bit gate design for quantum computers,” arXiv
e-prints (Sept., 1994) cond–mat/9409111, arXiv:cond-mat/9409111 [cond-mat].
[29] A. Barenco, “A Universal two bit gate for quantum computation,” Proc. Roy. Soc. Lond. A 449
(1995) 679, arXiv:quant-ph/9505016.
[30] Y. Shi, “Both Toffoli and Controlled-NOT need little help to do universal quantum computation,”
arXiv e-prints (May, 2002) quant–ph/0205115, arXiv:quant-ph/0205115 [quant-ph].
[31] D. Aharonov, “A Simple Proof that Toffoli and Hadamard are Quantum Universal,” arXiv e-prints
(Jan., 2003) quant–ph/0301040, arXiv:quant-ph/0301040 [quant-ph].
[32] V. Shende, S. Bullock, and I. Markov, “Synthesis of quantum-logic circuits,” IEEE Transactions on
Computer-Aided Design of Integrated Circuits and Systems 25 no. 6, (June, 2006) 1000–1010.
https://doi.org/10.1109/tcad.2005.855930.
[33] S. Hill and W. K. Wootters, “Entanglement of a pair of quantum bits,” Physical Review Letters 78
no. 26, (Jun, 1997) 5022–5025. https://doi.org/10.1103%2Fphysrevlett.78.5022.
[34] W. K. Wootters, “Entanglement of formation of an arbitrary state of two qubits,” Physical Review
Letters 80 no. 10, (Mar, 1998) 2245–2248. https://doi.org/10.1103%2Fphysrevlett.80.2245.
93
[35] W. K. Wootters, “Entanglement of formation and concurrence,” Quantum Info. Comput. 1 no. 1,
(Jan, 2001) 27–44.
[36] D. Coppersmith, “An approximate fourier transform useful in quantum factoring,”.
https://arxiv.org/abs/quant-ph/0201067.
[37] W. K. Wootters and W. H. Zurek, “A single quantum cannot be cloned,” Nature 299 no. 5886,
(Oct, 1982) 802–803. https://doi.org/10.1038%2F299802a0.
[38] D. Dieks, “Communication by EPR devices,” Physics Letters A 92 no. 6, (Nov, 1982) 271–272.
[39] A. K. Pati and S. L. Braunstein Nature 404 no. 6774, (Mar, 2000) 164–165.
https://doi.org/10.1038%2F35004532.
[40] D. Leach and A. Malvino, “Digital principles and applications,”.
[41] D. Deutsch and R. Jozsa, “Rapid solution of problems by quantum computation,” Proceedings of the
Royal Society of London. Series A: Mathematical and Physical Sciences 439 no. 1907, (Dec, 1992)
553–558. https://doi.org/10.1098%2Frspa.1992.0167.
[42] R. Cleve, A. Ekert, C. Macchiavello, and M. Mosca, “Quantum algorithms revisited,” Proceedings of
the Royal Society of London. Series A: Mathematical, Physical and Engineering Sciences 454
no. 1969, (Jan, 1998) 339–354. https://doi.org/10.1098%2Frspa.1998.0164.
[43] L. K. Grover, “A fast quantum mechanical algorithm for database search,” arXiv e-prints (May,
1996) quant–ph/9605043, arXiv:quant-ph/9605043 [quant-ph].
[44] L. K. Grover, “Quantum mechanics helps in searching for a needle in a haystack,” Physical Review
Letters 79 no. 2, (Jul, 1997) 325–328. https://doi.org/10.1103%2Fphysrevlett.79.325.
[45] P. W. Shor, “Polynomial time algorithms for prime factorization and discrete logarithms on a
quantum computer,” SIAM J. Sci. Statist. Comput. 26 (1997) 1484, arXiv:quant-ph/9508027.
[46] L. M. K. Vandersypen, M. Steffen, G. Breyta, C. S. Yannoni, M. H. Sherwood, and I. L. Chuang,
“Experimental realization of shor's quantum factoring algorithm using nuclear magnetic resonance,”
Nature 414 no. 6866, (Dec, 2001) 883–887. https://doi.org/10.1038%2F414883a.
[47] C. Gidney and M. Ekerå, “How to factor 2048 bit RSA integers in 8 hours using 20 million noisy
qubits,” arXiv e-prints (May, 2019) arXiv:1905.09749, arXiv:1905.09749 [quant-ph].
[48] M. Cerezo, A. Arrasmith, R. Babbush, S. Benjamin, S. Endo, K. Fujii, J. McClean, K. Mitarai,
X. Yuan, L. Cincio, and P. J. Coles, “Variational quantum algorithms,” nature reviews physics
(2020) .
[49] J. Tilly et al., “The Variational Quantum Eigensolver: a review of methods and best practices,”
arXiv:2111.05176 [quant-ph].
[50] A. Peruzzo, J. McClean, P. Shadbolt, M.-H. Yung, X.-Q. Zhou, P. J. Love, A. Aspuru-Guzik, and
J. L. O’Brien, “A variational eigenvalue solver on a photonic quantum processor,” Nature
Communications 5 no. 1, (Jul, 2014) . https://doi.org/10.1038%2Fncomms5213.
[51] J. R. McClean, S. Boixo, V. N. Smelyanskiy, R. Babbush, and H. Neven, “Barren plateaus in
quantum neural network training landscapes,” Nature Communications 9 no. 1, (Nov., 2018) .
https://doi.org/10.1038/s41467-018-07090-4.
94
[52] R. Wiersema, C. Zhou, Y. de Sereville, J. F. Carrasquilla, Y. B. Kim, and H. Yuen, “Exploring
entanglement and optimization within the hamiltonian variational ansatz,” PRX Quantum 1 (Dec,
2020) 020319. https://link.aps.org/doi/10.1103/PRXQuantum.1.020319.
[53] A. Kandala, A. Mezzacapo, K. Temme, M. Takita, M. Brink, J. M. Chow, and J. M. Gambetta,
“Hardware-efficient variational quantum eigensolver for small molecules and quantum magnets,”
arXiv:1704.05018 [quant-ph].
[54] W. M. Kirby and P. J. Love, “Variational quantum eigensolvers for sparse hamiltonians,” Physical
Review Letters 127 no. 11, (Sept., 2021) . https://doi.org/10.1103/physrevlett.127.110503.
[55] https://qiskit.org/textbook/preface.html.
[56] B. F. Schiffer, J. Tura, and J. I. Cirac, “Adiabatic Spectroscopy and a Variational Quantum
Adiabatic Algorithm,” PRX Quantum 3 no. 2, (2022) 020347, arXiv:2103.01226 [quant-ph].
[57] W. M. Kirby and P. J. Love, “Variational Quantum Eigensolvers for Sparse Hamiltonians,” PRLl
127 no. 11, (Sept., 2021) 110503, arXiv:2012.07171 [quant-ph].
[58] Z. Cai, R. Babbush, S. C. Benjamin, S. Endo, W. J. Huggins, Y. Li, J. R. McClean, and T. E.
O’Brien, “Quantum Error Mitigation,” arXiv e-prints (Oct., 2022) arXiv:2210.00921,
arXiv:2210.00921 [quant-ph].
[59] A. Strikis, D. Qin, Y. Chen, S. C. Benjamin, and Y. Li, “Learning-Based Quantum Error
Mitigation,” PRX Quantum 2 no. 4, (Nov., 2021) 040330, arXiv:2005.07601 [quant-ph].
[60] Raffaele Miceli and Michael McGuigan, “Quantum Computation and Visualization of Hamiltonians
using Discrete Quantum Mechanics and IBM QISKIT,” quant-ph/1812.01044.
[61] O. Higgott, D. Wang, and S. Brierley, “Variational quantum computation of excited states,”
Quantum 3 (Jul, 2019) 156. https://doi.org/10.22331%2Fq-2019-07-01-156.
[62] H. Kleinert, “Path Integrals in Quantum Mechanics, Statistics, Polymer Physics, and Financial
Markets,”.
[63] E. Dumitrescu, A. McCaskey, G. Hagen, G. Jansen, T. Morris, T. Papenbrock, R. Pooser, D. Dean,
and P. Lougovski, “Cloud quantum computing of an atomic nucleus,” physical review letters (2018) .
[64] J. Y. Araz, S. Schenk, and M. Spannowsky, “Towards a Quantum Simulation of Nonlinear Sigma
Models with a Topological Term,” arXiv:2210.03679 [quant-ph].
[65] R. Somma, G. Ortiz, E. Knill, and J. Gubernatis, “Quantum simulations of physics problems,”
arXiv:quant-ph/0304063.
[66] N. P. D. Sawaya, T. Menke, T. H. Kyaw, S. Johri, A. Aspuru-Guzik, and G. G. Guerreschi,
“Resource-efficient digital quantum simulation of d-level systems for photonic, vibrational, and
spin-s hamiltonians,” arXiv:1909.12847.
[67] M. Asaduzzaman, S. Catterall, G. C. Toga, Y. Meurice, and R. Sakai, “Quantum Simulation of the
N flavor Gross-Neveu Model,” arXiv:2208.05906 [hep-lat].
[68] A. F. Shaw, P. Lougovski, J. R. Stryker, and N. Wiebe, “Quantum Algorithms for Simulating the
Lattice Schwinger Model,” Quantum 4 (2020) 306, arXiv:2002.11146 [quant-ph].
95
[69] K. Yeter-Aydeniz, E. Moschandreou, and G. Siopsis, “Quantum imaginary-time evolution algorithm
for quantum field theories with continuous variables,” Phys. Rev. A 105 no. 1, (2022) 012412,
arXiv:2107.00791 [quant-ph].
[70] S. McArdle, T. Jones, S. Endo, Y. Li, S. C. Benjamin, and X. Yuan, “Variational ansatz-based
quantum simulation of imaginary time evolution,” npj Quantum Information 5 (Sept., 2019) 75,
arXiv:1804.03023 [quant-ph].
[71] M. Motta, C. Sun, A. T. K. Tan, M. J. O’Rourke, E. Ye, A. J. Minnich, F. G. S. L. Brandão, and
G. K.-L. Chan, “Determining eigenstates and thermal states on a quantum computer using
quantum imaginary time evolution,” Nature Physics 16 no. 2, (Jan., 2020) 205–210,
arXiv:1901.07653 [quant-ph].
[72] E. Knill and R. Laflamme, “A Theory of quantum error correcting codes,” Phys. Rev. Lett. 84
(2000) 2525–2528, arXiv:quant-ph/9604034.
[73] P. W. Shor, “Scheme for reducing decoherence in quantum computer memory,” Phys. Rev. A 52
(Oct, 1995) R2493–R2496. https://link.aps.org/doi/10.1103/PhysRevA.52.R2493.
[74] R. Laflamme, C. Miquel, J. P. Paz, and W. H. Zurek, “Perfect quantum error correction code,”
arXiv:quant-ph/9602019.
[75] A. Steane, “Multiple particle interference and quantum error correction,” Proc. Roy. Soc. Lond. A
452 (1996) 2551, arXiv:quant-ph/9601029.
[76] D. Gottesman, “An Introduction to Quantum Error Correction and Fault-Tolerant Quantum
Computation,” arXiv e-prints (Apr., 2009) arXiv:0904.2557, arXiv:0904.2557 [quant-ph].
[77] D. Gottesman, “The Heisenberg representation of quantum computers,” in 22nd International
Colloquium on Group Theoretical Methods in Physics, pp. 32–43. 7, 1998.
arXiv:quant-ph/9807006.
[78] S. L. Braunstein and P. van Loock, “Quantum information with continuous variables,” Rev. Mod.
Phys. 77 (2005) 513–577, arXiv:quant-ph/0410100.
[79] S. Lloyd, “Universal quantum simulators,” Science 273 no. 5278, (Aug., 1996) 1073–1078.
https://doi.org/10.1126/science.273.5278.1073.
[80] S. Chandrasekharan and U. J. Wiese, “Quantum link models: A Discrete approach to gauge
theories,” Nucl. Phys. B 492 (1997) 455–474, arXiv:hep-lat/9609042.
[81] A. Bazavov, S. Catterall, R. G. Jha, and J. Unmuth-Yockey, “Tensor renormalization group study of
the non-Abelian Higgs model in two dimensions,” Phys. Rev. D 99 no. 11, (2019) 114507,
arXiv:1901.11443 [hep-lat].
[82] I. Raychowdhury and J. R. Stryker, “Loop, string, and hadron dynamics in SU(2) Hamiltonian
lattice gauge theories,” Phys. Rev. D 101 no. 11, (2020) 114502, arXiv:1912.06133 [hep-lat].
[83] A. Alexandru, P. F. Bedaque, R. Brett, and H. Lamm, “Spectrum of digitized QCD: Glueballs in a
S(1080) gauge theory,” Phys. Rev. D 105 no. 11, (2022) 114508, arXiv:2112.08482 [hep-lat].
[84] S. P. Jordan, K. S. M. Lee, and J. Preskill, “Quantum Computation of Scattering in Scalar
Quantum Field Theories,” Quant. Inf. Comput. 14 (2014) 1014–1080, arXiv:1112.4833 [hep-th].
96
[85] N. Klco and M. J. Savage, “Digitization of scalar fields for quantum computing,” Phys. Rev. A 99
no. 5, (2019) 052335, arXiv:1808.10378 [quant-ph].
[86] K. Marshall, R. Pooser, G. Siopsis, and C. Weedbrook, “Quantum simulation of quantum field
theory using continuous variables,” Phys. Rev. A 92 no. 6, (2015) 063825, arXiv:1503.08121
[quant-ph].
[87] J. Barata, N. Mueller, A. Tarasov, and R. Venugopalan, “Single-particle digitization strategy for
quantum computation of a ϕ4 scalar field theory,” Phys. Rev. A 103 no. 4, (2021) 042410,
arXiv:2012.00020 [hep-th].
[88] A. W. Harrow, A. Hassidim, and S. Lloyd, “Quantum algorithm for linear systems of equations,”
Phys. Rev. Lett. 103 (Oct, 2009) 150502.
https://link.aps.org/doi/10.1103/PhysRevLett.103.150502.
[89] J. Morrell, Hector Jose, A. Zaman, and H. Y. Wong, “Step-by-Step HHL Algorithm Walkthrough to
Enhance the Understanding of Critical Quantum Computing Concepts,” arXiv e-prints (Aug., 2021)
arXiv:2108.09004, arXiv:2108.09004 [quant-ph].
[90] M. Hestenes and E. Stiefel, “Methods of conjugate gradients for solving linear systems,” Journal of
Research of the National Bureau of Standards 49 no. 6, (Dec., 1952) 409.
https://doi.org/10.6028/jres.049.044.
[91] S. Aaronson, “Read the fine print,” Nature Physics 11 no. 4, (Apr., 2015) 291–293.
https://doi.org/10.1038/nphys3272.
[92] J. D. Whitfield, J. Biamonte, and A. Aspuru-Guzik, “Simulation of electronic structure
hamiltonians using quantum computers,” Molecular Physics 109 no. 5, (Mar, 2011) 735–750.
https://doi.org/10.1080%2F00268976.2011.552441.
[93] D. W. Berry, A. M. Childs, R. Cleve, R. Kothari, and R. D. Somma, “Exponential improvement in
precision for simulating sparse Hamiltonians,” arXiv e-prints (Dec., 2013) arXiv:1312.1414,
arXiv:1312.1414 [quant-ph].
[94] D. W. Berry, A. M. Childs, R. Cleve, R. Kothari, and R. D. Somma, “Simulating Hamiltonian
Dynamics with a Truncated Taylor Series,” PRL 114 no. 9, (Mar., 2015) 090502, arXiv:1412.4687
[quant-ph].
[95] J. Kempe, A. Kitaev, and O. Regev, “The complexity of the local hamiltonian problem,”
arXiv:quant-ph/0406180.
[96] D. W. Berry, G. Ahokas, R. Cleve, and B. C. Sanders, “Efficient quantum algorithms for simulating
sparse hamiltonians,” Communications in Mathematical Physics 270 no. 2, (Dec., 2006) 359–371.
https://doi.org/10.1007/s00220-006-0150-x.
[97] A. M. Childs and R. Kothari, “Simulating sparse hamiltonians with star decompositions,”.
https://doi.org/10.1007/978-3-642-18073-6_8.
[98] D. W. Berry, A. M. Childs, and R. Kothari, “Hamiltonian simulation with nearly optimal
dependence on all parameters,” arXiv e-prints (Jan., 2015) arXiv:1501.01715, arXiv:1501.01715
[quant-ph].
97
[99] G. Hao Low and I. L. Chuang, “Hamiltonian Simulation by Qubitization,” arXiv e-prints (Oct.,
2016) arXiv:1610.06546, arXiv:1610.06546 [quant-ph].
[100] D. W. Berry, A. M. Childs, R. Cleve, R. Kothari, and R. D. Somma, “Exponential improvement in
precision for simulating sparse Hamiltonians,” arXiv e-prints (Dec., 2013) arXiv:1312.1414,
arXiv:1312.1414 [quant-ph].
[101] M. E. Beverland, P. Murali, M. Troyer, K. M. Svore, T. Hoeffler, V. Kliuchnikov, G. Hao Low,
M. Soeken, A. Sundaram, and A. Vaschillo, “Assessing requirements to scale to practical quantum
advantage,” arXiv e-prints (Nov., 2022) arXiv:2211.07629, arXiv:2211.07629 [quant-ph].
[102] B. Eastin and S. T. Flammia, “Q-circuit tutorial,” arXiv:quant-ph/0406003 [quant-ph].
[103] A. Serafini, “Quantum Continuous Variables: A Primer of Theoretical Methods,” CRC Press (2017)
.
[104] S. L. Braunstein and P. van Loock, “Quantum information with continuous variables,” Reviews of
Modern Physics 77 no. 2, (Apr., 2005) 513–577, arXiv:quant-ph/0410100 [quant-ph].
[105] C. Weedbrook, S. Pirandola, R. García-Patrón, N. J. Cerf, T. C. Ralph, J. H. Shapiro, and S. Lloyd,
“Gaussian quantum information,” Reviews of Modern Physics 84 no. 2, (Apr., 2012) 621–669,
arXiv:1110.3234 [quant-ph].
[106] D. Gottesman, A. Kitaev, and J. Preskill, “Encoding a qubit in an oscillator,”
arXiv:quant-ph/0008040 [quant-ph].
[107] M. Mirrahimi, Z. Leghtas, V. V. Albert, S. Touzard, R. J. Schoelkopf, L. Jiang, and M. H. Devoret,
“Dynamically protected cat-qubits: a new paradigm for universal quantum computation,” New
Journal of Physics 16 no. 4, (Apr., 2014) 045014, arXiv:1312.2017 [quant-ph].
[108] N. Killoran, T. R. Bromley, J. M. Arrazola, M. Schuld, N. Quesada, and S. Lloyd,
“Continuous-variable quantum neural networks,” Physical Review Research 1 no. 3, (Oct., 2019)
033063, arXiv:1806.06871 [quant-ph].
[109] A. K. Pati, S. L. Braunstein, and S. Lloyd, “Quantum searching with continuous variables,” arXiv
preprint quant-ph/0002082 (2000) .
[110] A. K. Pati and S. L. Braunstein, “Deutsch-jozsa algorithm for continuous variables,” Quantum
Information with Continuous Variables (2003) 31–36.
[111] S. L. Braunstein, “Error correction for continuous quantum variables,” Phys. Rev. Lett. 80 (1998)
4084–4087, arXiv:quant-ph/9711049.
[112] X. Wang, “Continuous-variable and hybrid quantum gates,” Journal of Physics A: Mathematical
and General 34 no. 44, (Oct., 2001) 9577–9584. https://doi.org/10.1088/0305-4470/34/44/316.
[113] N. Killoran, J. Izaac, N. Quesada, V. Bergholm, M. Amy, and C. Weedbrook, “Strawberry Fields:
A Software Platform for Photonic Quantum Computing,” Quantum 3 (Mar., 2019) 129,
arXiv:1804.03159 [quant-ph].
[114] W. Magnus, “On the exponential solution of differential equations for a linear operator,” Commun.
Pure Appl. Math. 7 (1954) 649–673.
98
[115] T. J. Stavenger, E. Crane, K. Smith, C. T. Kang, S. M. Girvin, and N. Wiebe, “Bosonic Qiskit,”
arXiv:2209.11153 [quant-ph].
99