Exact Ising model simulation on a quantum computer
Alba Cervera-Lierta
1,2
1
Barcelona Supercomputing Center (BSC), Barcelona, Spain
2
Institut de Ciències del Cosmos, Universitat de Barcelona, Barcelona, Spain
Decemb er 20, 2018
We present an exact simulation of a one-
dimensional transverse Ising spin chain
with a quantum computer. We construct
an efficient quantum circuit that diagonal-
izes the Ising Hamiltonian and allows to
obtain all eigenstates of the model by just
preparing the computational basis states.
With an explicit example of that circuit for
n = 4 spins, we compute the expected value
of the ground state transverse magneti-
zation, the time evolution simulation and
provide a method to also simulate thermal
evolution. All circuits are run in IBM and
Rigetti quantum devices to test and com-
pare them qualitatively.
1 Introduction
In recent years the quantum computing has dived
fully into the experimental realm. Control of
quantum systems has improved so much that
quantum computing devices have become a near
term reality. These experimental advances rely
on some criteria proposed in the 2000’s by DiVi-
cenzo [1]: scalable physical system to characterize
the qubits, simple fiducial qubit state initializa-
tion, long coherence times (longer than the gate
implementation times), universal set of quantum
gates and qubit-specific measurement capability.
Although there are some candidates that can ful-
fill the first criterion, the field is still in an early
stage of development of this technology, where
the improvement of qubits control is crucial to
accomplish the others.
Private companies have also joined the field.
Since 2016, IBM offers cloud based quantum com-
putation platform [2]. Any user can run quantum
algorithms on their two five qubits devices, their
16 qubits device, and their 20 qubits device which
is available for hubs and partners. It is not the
Alba Cervera-Lierta: a.cervera.lierta@gmail.com
only company that has launched this kind of ser-
vice: Rigetti Computing also allows the use of
its 19-qubits device on the cloud [3]. Although
both companies are betting for superconducting
qubits, their respective device characterization is
not the same: basic gate sets and qubits connec-
tivity are some of the differences. As more quan-
tum devices are appearing, it is important to find
some methods to test their quality when running
sophisticated quantum algorithms.
Several approaches on computer’s quantumness
have already been tried. The first published ar-
ticle using an IBM device tested the violation of
Bell inequalities by more than two qubits (Mer-
min inequalities) [4], or a recent article tests if the
16-qubit IBM device can be fully entangled by
generating graph states [5]. Other works tried to
exploit different few qubit experiments, such as
error correcting codes and quantum arithmetics
[6].
On the other hand, the community has not for-
got Feynman’s original aim for the proposal of
construction of a quantum computer [7]: the sim-
ulation of quantum systems. Many classical tech-
niques have been developed in that direction, for
instance quantum Monte Carlo methods [8, 9, 10]
or tensor networks algorithms [11]. However, the
first suffer from the well-known sign problem and
the second are only efficient for slightly entangled
systems [12]. In the end, very strongly correlated
quantum systems, such as those displaying frus-
tration, will need a quantum computer to be ef-
ficiently simulated [13]. There are some works
that propose quantum algorithms to construct
arbitrary Slater determinants, both in one and
two dimensions, to simulate the dynamics of the
ground state of fermionic hamiltonians, in partic-
ular the Hubbard model [14, 15]. Other propos-
als introduce the concept of compressed quantum
computation, i.e. simulation of n-spin chain using
log n qubits [16]. This method has been tested in
one of the IBM’s quantum computers also simu-
Accepted in Quantum 2018-12-18, click title to verify 1
arXiv:1807.07112v3 [quant-ph] 19 Dec 2018
lating the transverse magnetization of the Ising
model [17]: the main difference respect to the
work proposed in that paper is we have access to
the whole energy spectrum, which allows us to
simulate time and temperature evolution as well.
In this work, we implement a four-qubit experi-
ment that could be interesting both as a proposal
for testing and comparing devices quality and for
its implications in condensed matter physics. We
perform the exact simulation of a spin chain pro-
posed in Ref.[18] with an Ising-type interaction.
The Ising model is one of the most famous ex-
actly solvable models, i.e. those models that are
integrable. Actually, the steps to find a quan-
tum circuit that diagonalizes the Ising Hamilto-
nian follow the same strategy than the analytical
solution of the model. Therefore, the method can
be extended to other integrable models like the
Kitaev-honeycomb model, which a circuit has al-
ready been proposed [19]. As we are performing
an exact simulation, we have access to the whole
spectrum and not only to ground state: time evo-
lution and thermal states can be simulated ex-
actly as well. This provides a new approach in
quantum simulation if an exact circuit is found
for those non trivial models, such as Heisenberg
model, which have an ansatz to be solved. In
particular, for one-dimensional spin chains, the
Bethe ansatz [20] is the most successful method
and several proposals exist to simulate and ex-
tend it to two-dimensions using tensor network
techniques [21]. As the one-dimensional Ising
model has analytic solutions for arbitrary num-
ber of spins and the circuit proposed in this paper
can be efficiently generalized to larger number of
qubits, the methods outlined in this work can be
used to benchmark a quantum computer by see-
ing how this compares against known solutions.
The paper is structured as follows. In section
2 we describe the method proposed in Ref.[18] to
construct an efficient circuit that diagonalizes the
Ising Hamiltonian: the number of gates scales as
n
2
and the circuit depth as n log n. In section 3
we explain briefly the basic concepts of time evo-
lution in quantum mechanics and give a specific
example to be simulated using the circuit derived
in the previous section. In section 4, we propose
two methods to simulate the expected value of an
operator for finite temperature. Section 5 sum-
marizes the properties of the three devices used
for this work, two from IBM and one from Rigetti,
and in section 6 we present the results of ground
state transverse magnetization and the time evo-
lution of | ↑↑↑↑i state and compare the three de-
vices according to them. Finally, the conclusions
are exposed in section 7.
2 Quantum circuit for the Ising Hamil-
tonian
Let’s consider the existence of a quantum cir-
cuit that disentangles a given Hamiltonian and
transforms its entangled eigenstates into product
states. This circuit will be represented by an uni-
tary transformation U
dis
e
H = U
dis
HU
dis
, (1)
where H is the model Hamiltonian and
e
H is a
noninteracting Hamiltonian that can be written
as
e
H =
P
i
i
σ
z
i
. This diagonal Hamiltonian con-
tains the energy spectrum
i
of the original one
and its eigenstates correspond to the computa-
tional basis states. Then, we will have access to
the whole spectrum of the model by just prepar-
ing a product state and applying U
dis
.
There exist infinite U
dis
gates for a given
Hamiltonian. In general, to find these disentan-
gling unitaries will be a hard task, probably as
hard as finding a method to diagonalize analyti-
cally the Hamiltonian. However, for some mod-
els we can follow a kind of recipe to construct a
disentangling gate. For the case of Ising Hamilto-
nian, the steps to obtain the U
dis
quantum gate
are based on the analytical solution of the model
[22, 23]: i) Implement the Jordan-Wigner trans-
formation to map the spins into fermionic modes.
ii) Perform the Fourier transform to get fermions
to momentum space. iii) Perform a Bogoliubov
transformation to decouple the modes with op-
posite momentum. Thus, the construction of the
disentangling gate can be done by pieces:
U
dis
= U
JW
U
F T
U
Bog
. (2)
In the following subsections, we derive the quan-
tum gates needed to implement the above trans-
formation.
Accepted in Quantum 2018-12-18, click title to verify 2
2.1 Jordan-Wigner transformation
Let’s start with the antiferromagnetic Ising
Hamiltonian with transverse field
H =
n
X
i=1
σ
x
i
σ
x
i+1
+σ
y
1
σ
z
2
···σ
z
n1
σ
y
n
+λ
n
X
i=1
σ
z
i
, (3)
where λ is the transverse field strength. The sec-
ond term has been added to cancel the periodic
boundary term, σ
x
n
σ
x
1
, after the Jordan-Wigner
transformation in order to solve the system as
it was infinite. This modified Hamiltonian will
have finite size effects that become negligible as
n grows.
The Jordan-Wigner transformation corre-
sponds to transform the spin operators σ into
fermionic modes c [24]:
c
j
=
Y
l<j
σ
z
l
!
σ
x
j
+
y
j
2
, c
j
=
σ
x
j
y
j
2
Y
l<j
σ
z
l
!
,
(4)
where c
j
and c
j
are the fermionic annihilation
and creation operators acting on the vacuum |
c
i,
c
i
|
c
i = 0, and following the anticommutation
rules {c
i
, c
j
} = 0 and {c
i
, c
j
} = δ
ij
. After this
transformation the Hamiltonian reads
H
c
=
1
2
n
X
i=1
c
i
c
i+1
+c
i+1
c
i
+c
i
c
i+1
+c
i
c
i+1
+λ
n
X
i=1
c
i
c
i
.
(5)
In terms of the wave function,
|ψi =
X
i
1
,···,i
n
=0,1
ψ
i
1
···i
n
|i
1
···i
n
i
=
X
i
1
,···,i
n
=0,1
ψ
i
1
···i
n
(c
1
)
i
1
···(c
n
)
i
n
|
c
i. (6)
Notice that the coefficients ψ
i
1
···i
n
do not change.
Then it will not be necessary to implement any
gates on the quantum register to perform this
transformation. However, for now on we should
take into account we are dealing with fermionic
modes, so any swap between two occupied modes
will carry a minus sign. In terms of quantum
gates, this is translated into the use of fermionic
SWAP gate (fSWAP) each time we exchange two
modes:
fSWAP =
1 0 0 0
0 0 1 0
0 1 0 0
0 0 0 1
, (7)
which corresponds with the usual SWAP gate fol-
lowed or preceded by a controlled-Z gate (see ap-
pendix A).
2.2 Fourier Transform
The next step to solve the Ising model consists on
getting the fermionic modes to momentum space
using the well-known quantum Fourier transform
b
k
=
1
n
n
X
j=1
exp
i
2πj
n
k
c
j
, k =
n
2
+1, ··· ,
n
2
.
(8)
For n = 2
m
for some integer m, this transfor-
mation can be implemented with a log-depth cir-
cuit and using at most two-body quantum gates.
This method is called fast Fourier transform and
consists in two parallel Fourier transformations
over n/2 sites, the even and the odd sites [25]:
n1
X
j=0
e
2πik
n
j
c
j
=
n
2
1
X
j
0
=0
e
2πik
n/2
j
0
c
2j
0
+ e
2πik
n
e
2πik
n/2
j
0
c
2j
0
+1
.
(9)
To implement such a transformation we need
a combination of a two-qubit gate, a ‘beam-
splitter’ F
2
, and one-qubit gate, the ‘phase-delay’
ω
k
n
, which applies the so-called twiddle-factor
e
2πik/n
:
F
2
=
1 0 0 0
0
1
2
1
2
0
0
1
2
1
2
0
0 0 0 1
, ω
k
n
=
1 0
0 e
2πik
n
!
,
(10)
where the fermionic anticommutation relation
has been taken into account in the 1 element
of the F
2
matrix.
All together, the Fourier transform gate be-
comes
F
n
k
=
1 0 0 0
0
1
2
e
2πik
n
2
0
0
1
2
e
2πik
n
2
0
0 0 0 e
2πik
n
. (11)
The appendix shows the explicit decomposition
of this gate.
Accepted in Quantum 2018-12-18, click title to verify 3
After the Fourier transformation, the Hamilto-
nian becomes
H
b
=
n/2
X
k=n/2+1
2
λ cos
2πk
n

b
k
b
k
+i sin
2πk
n
b
k
b
k
+ b
k
b
k
, (12)
which it is not diagonal yet as modes with oppo-
site momentum are still coupled.
2.3 Bogoliubov transformation
The last step will consist on finding a transfor-
mation which mixes the two modes according to
a
k
= u
k
b
k
+ iv
k
c
k
,
a
k
= u
k
c
k
iv
k
c
k
. (13)
This will be implemented by a two-qubit gate
which acts over qubits that represent opposite
momenta. For the case of Ising model, this gate
is
B
n
k
=
cos
θ
k
2
0 0 i sin
θ
k
2
0 1 0 0
0 0 1 0
i sin
θ
k
2
0 0 cos
θ
k
2
,
θ
k
= arccos
λcos
(
2πk
n
)
q
(
λcos
(
2πk
n
))
2
+sin
2
(
2πk
n
)
,(14)
and its decomposition in basic gates is shown in
the appendix.
Then, we have finally arrived to the diagonal
Hamiltonian:
e
H = H
a
=
n/2
X
k=n/2+1
ω
k
a
k
a
k
, (15)
where ω
k
=
r
λ cos
2πk
n

2
+ sin
2
2πk
n
.
2.4 n = 4 spin chain
The explicit circuit for a n = 4 chain is shown in
Figure 1. First, we prepare the initial state as the
ground state for the diagonal Hamiltonian
e
H:
|gsi =
(
|0000i for λ > 1,
|0001i for λ < 1.
(16)
The circuit strategy consists in undoing the
steps that diagonalize the Ising Hamiltonian.
B
1
F
1
F
0
F
0
F
0
Figure 1: Quantum circuit that transforms computa-
tional basis states into transverse Ising eigenstates. The
two qubit gates F
1
and F
0
apply the inverse Fourier
transform and the B
1
with the inverse Bogoliubov trans-
formation. Gates represented with crosses correspond
with the fSWAP gates that take care of the fermion an-
ticommutation relations and can be removed depending
on the connectivity of the quantum chip.
Thus we first undo Bogoliubov transformation
by applying (B
n
k
)
gates, followed by undoing
the Fourier transform using the (F
n
k
)
gates and
finally undo the Jordan-Wigner transformation
which, fortunately, does not need from any gate
as has been explained in the previous section.
For n = 4, the Bogoliubov modes are ±3π/2
and ±π/2, so we need two Bogoliubov gates. No-
tice that we have removed the B
0
gate from the
circuit of Figure 1; this gate corresponds with
the identity for λ > 1 and exchange qubits in the
same state for λ < 1, i.e. |00i i|11i and
|11i i|00i. As the initial state for λ < 1
is the |0001i and B
0
is applied over the last two
qubits, it does not affect this state and we can
avoid it. If we want to obtain an excited state
which eigenstate in the diagonal basis contains
|00i or |11i states, then we should only apply bit
flip gates over the last two qubits to implement
the B
0
gate.
The circuit shown in Figure 1 also contains
fSWAP gates represented with crosses. These will
be necessary if even and odd qubits are not phys-
ically connected and, as much, they will increase
the total number of gates in n
2
. We can eliminate
them if the implementation is done in the ibmqx5
device, which allow us to save up to 16 gates of
depth according to IBM gate set, but they are in-
dispensable for the implementation in the other
IBM device, ibmqx4, as well as in Rigetti’s 19-
qubit chip.
Accepted in Quantum 2018-12-18, click title to verify 4
3 Time evolution
Once we have the U
dis
circuit, we have access
to the whole Ising spectrum by only implement-
ing this gate over the computational basis states.
This allows us to perform exactly time evolution,
where the characterization of all states is needed.
The time evolution of a given state driven by a
time-independent Hamiltonian is described using
the time evolution operator U(t) e
itH
:
|ψ(t)i = U(t)|ψ
0
i =
X
i
e
it
i
|E
i
ihE
i
|ψ
0
i, (17)
where |ψ
0
i is the initial state and
i
are the ener-
gies of the Hamiltonian states |E
i
i. Then, if |ψ
0
i
is an eigenstate of H there is no change in time
(steady state) and therefore the expected value of
an observable O will be constant in time. On the
contrary, and if [H, O] 6= 0, the expected value
will show an oscillation in time given by
hO(t)i =
X
i,j
e
it(
i
j
)
hψ
0
|E
j
ihE
j
|O|E
i
ihE
i
|ψ
0
i.
(18)
We can take advantage from the fact that the
eigenstates of the non-interacting Hamiltonian
e
H
are the computational basis states and, as we
have solved the model, we also know all energies
i
. Then, it is straightforward to construct the
time evolution of a given state |ψ
0
i by only ex-
pressing it in the computational basis and adding
the corresponding factors e
it
i
. After that, we
only need to implement U
dis
gate over this state
to obtain the time evolution driven by the Ising
Hamiltonian.
As example, we compute the time evolution of
the expected value of transverse magnetization.
We take all spins aligned in the positive z direc-
tion as initial state, i.e. | ↑↑↑↑i, which in the
computational basis is the |0000i state. First, we
have to express this state in the
e
H basis, which
using U
dis
become
|ψ
0
i = U
dis
|0000i = cos φ|0000i + i sin φ|1100i,
(19)
with φ = arccos(λ/
1 + λ
2
)/2. Then, we apply
the time evolution operator to obtain |ψ(t)i:
|ψ(t)i =
cos φ|00i + ie
4it
1+λ
2
sin φ|11i
|00i.
(20)
Analytically,
hσ
z
i =
1 + 2λ
2
+ cos
4t
1 + λ
2
2 + 2λ
2
, (21)
Figure 2: Transverse magnetization of n = 4 Ising spin
chain as a function of temperature β = 1/(k
B
T ) and
transverse field λ. The system undergoes a transition,
from antiferromagnetic to paramagnetic, as λ increases.
For zero temperature (β ) the transition point is
located at λ = 1, whereas for finite temperature there
is a quantum critical region around λ = 1.
from which we can obtain the expected value of
transverse magnetization, M
z
=
1
2
hσ
z
i.
4 Thermal simulation
When a quantum system is exposed to a heat
bath its density matrix at thermal equilibrium
is characterized by thermally distributed popula-
tions of its quantum states following a Boltzmann
distribution:
ρ(β) =
e
βH
Z
=
1
Z
X
i
e
β
i
|E
i
ihE
i
|, (22)
where β = 1/(k
B
T ), Z =
P
i
e
β
i
is the parti-
tion function and
i
and |E
i
i are the energies and
eigenstates of the Hamiltonian H. The expected
value of some operator O for finite temperature
is computed as
hO(β)i = Tr[Oρ(β)] =
1
Z
X
i
e
β
i
hE
i
|O|E
i
i.
(23)
Simulate thermal evolution according to Ising
Hamiltonian is, again, straightforward once we
have U
dis
gate, since it consists on preparing the
corresponding state in the
e
H basis and apply U
dis
circuit. In the case of thermal evolution, |E
i
i
states are the states of the computational basis,
so no further gates are needed to initialize qubits
apart from the corresponding combination of X
gates.
At that point, we can perform an exact simu-
lation or sampling. In the first case, we run the
Accepted in Quantum 2018-12-18, click title to verify 5
Figure 3: IBM quantum chips used in this work. Up fig-
ure corresponds to ibmqx4 and down figure to ibmqx5.
Arrows indicate the directionality of CNOT gates (con-
trol Ý target).
circuit to obtain the expected value of the ob-
servable taking as initial state all states in the
computational basis and average them with their
corresponding energies. This is done classically
once we have the expected values of each state.
On the other hand, we can perform a more re-
alistic simulation by sampling all states accord-
ing to Boltzmann distribution. First, we need to
prepare classically a random generator that re-
turns one of the computational states following
the distribution e
β
i
. Then, we run the circuit
many times and compute the expected value of
the operator by preparing as initial state the one
returned by the generator each time.
The first method demands more runs of the
experiment, N × 2
n
, needed for the computation
of each expected value. No statistical errors come
from the averaging part, as it is done classically.
For the second method, with only N runs we will
obtain a value for the observable with a statistical
error of 1/
N.
For n = 4 the transverse magnetization can be
computed analytically and it is shown in Figure 2.
At zero temperature, i.e. β , the system un-
dergoes to phase transition in the thermodynamic
limit, i.e. n , from antiferromagnetic to
paramagnetic, at the corresponding critical point
of λ = 1. As temperature increases (β decreases),
the system have a critical region around λ = 1
until the temperature is high enough to disor-
der all spins, independently of the transverse field
strength (limit β 0) [26].
5 Implementation on a quantum com-
puter
5.1 IBM Quantum Experience
Since 2016, IBM is providing universal quan-
tum computer prototypes based on supercon-
ducting transmon qubits which are accessible on
the cloud, both interactively in their webpage
(Quantum Composer )[2] or using a software de-
velopment kit (QISKit). Currently, three quan-
tum chips are available for the general public: two
of 5 qubits, ibmqx2 and ibmqx4, and one of 16
qubits, ibmqx5 [27]. When we performed the ex-
periments ibmqx2 was offline, so we have only
used ibmqx4 and ibmqx5.
All backends work with an universal gate set
composed by one-qubit rotational and phase
gates
U
1
(λ) =
1 0
0 e
!
, U
2
(λ, φ) =
1
2
e
2
e
2
e
i(λ+φ)
2
,
U
3
(θ, λ, φ) =
cos(θ/2) e
sin(θ/2)
e
sin(θ/2) e
i(λ+φ)
cos(θ/2)
!
,
(24)
and a two-qubit gate, the controlled-X or CNOT
gate.
The differences between the devices, apart from
the number of qubits, come from the qubits con-
nectivity or topology and the role that each qubit
plays when applied a CNOT gate (control or tar-
get). Figure 3 shows the connectivity of the
used devices. Each qubit in the 5-qubit device is
connected with other two except the central one
which is connected with the other four. Qubits
in the 16-qubit device are connected with three
neighbors in a ladder-type geometry. Both, the
one-directionality of CNOT gate and the qubits
connectivity, are crucial for the quantum circuit
implementation. If the circuit demands an inter-
action between qubits that are not physically con-
nected, we should implement SWAP gates which
will increase our circuit depth and the probability
of errors in our final result. Moreover, each time
we need to implement a CNOT gate using as a
control qubit a physical qubit which is actually
a target, we have to invert the CNOT direction
using Hadamard gates which, again, will increase
the circuit depth and the error probability.
For our propose, ibmqx5 is the best choice for
the implementation of the n = 4 circuit. We can
use any of the squares and identify upper qubits
as 0 and 2 and lower qubits as 1 and 3: according
to the circuit of Figure 1, we will not need to
use any fSWAP gates. We should only take into
account which qubits are control or target to try
to reduce the times that we have to invert the
Accepted in Quantum 2018-12-18, click title to verify 6
Figure 4: Rigetti’s 19-qubit processor ‘Acorn’. Lines in-
dicate the two-qubit connection ruled by a controlled-Z
gate. For technical reasons, qubit 3 is offline.
CNOT direction.
5.2 Rigetti Computing: Forest
At the end of 2017, Rigetti Computing launched
a 19-qubit processor, ‘Acorn’, that can be used
in the cloud through a development environment
called Forest [3]. It includes a python toolkit,
pyQuil, that allows the users to program, sim-
ulate and run quantum algorithms in a similar
way as IBM’s QISKit. The chip is made of of 20
superconducting transmon qubits but for some
technical reasons, qubit 3 is off-line and cannot
interact with its neighbors, so it is treated as a
19-qubit device.
Currently, Rigetti’s gate set is formed by three
one-qubit rotational gates
R
X
(θ) = e
i
θ
2
σ
x
, R
Y
(θ) = e
i
θ
2
σ
y
, R
Z
(θ) = e
i
θ
2
σ
z
,
(25)
and a two-qubit gate, controlled-Z. This two-
qubit gate has the advantage of bi-directionality
as the result is the same independently of which
is the control qubit. For that reason, the connec-
tivity of the device shown in Figure 4 does not
specify the direction of the two-qubit gate.
The qubit topology is very different from IBM’s
devices: some qubits are connected with three
neighbors and others with two in a zigzag-type ge-
ometry. Then, we can not do without the fSWAP
gates, which means that the circuit depth will be
greater than the ibmqx5’s. On the other hand, it
will be comparable with the ibmqx4, which also
needs from these gates.
6 Results and discussion
Figure 5 shows the results of the exact simulation
of ground state transverse magnetization for the
three devices. All points contain a statistical er-
ror of 1/
N with N = 1024 which comes from
the average over all runs to compute the expected
value. The other error sources are discussed qual-
itatively in the following paragraphs.
The best performance come from the ibmqx5
device. This is an expected result as we do not
need from fSWAP gates because the qubits con-
nectivity. On the other hand, Rigetti’s device
performs better than the ibmqx4, even though
the number of gates is very similar.
The simulation approaches better to the pre-
diction for low λ. The explanation could come
from how affect the experimental error sources
to the magnetization. Assuming that two-qubit
gates implementation take several hundreds of ns
and single qubit gates around one hundred of ns,
errors coming from decoherence are expected to
be low, as these times are around 50 µs. On the
other hand, errors coming from the gate imple-
mentation are cumulative and probably the most
important error source. It is not negligible nei-
ther errors coming from qubits readout, which
can induce a bit flip.
The analysis of the results become more clear if
we look at the exact ground state wave function:
|gsi=
1
N
α(|0001i|0010i+|0100i|1000i)
+|0111i|1011i+|1101i|1110i
for λ<1,
α(|0011i|0110i+|1001i+|1100i)
+2|1111> for λ>1,
(26)
where α = λ
1 + λ
2
and N = 2
2
1 + λα.
As λ increases, the amplitude for the states pro-
portional to α goes to zero. That means that any
error occurring for λ > 1 is dramatic as it will af-
fect the state with higher probability amplitude,
the |1111i. Then, any error in that regime will
inevitably cause a decrease in magnetization. On
the other hand, errors in some states for λ < 1
can be compensated in average for the other ele-
ments with the same probability amplitude.
Similar results are obtained for the time evolu-
tion simulation. Figure 6 shows the results for the
simulation of the | ↑↑↑↑i state transverse magne-
tization as it was explained in Section 3. Since
for the preparation of the initial state it is neces-
sary to implement more gates, we only show the
results for the ibmqx5 device, which is the one
that can afford this extra circuit depth.
Accepted in Quantum 2018-12-18, click title to verify 7
Figure 5: Expected value of hσ
z
i of the ground state of
a n = 4 Ising spin chain as a function of transverse field
strength λ. Solid line represents the exact result in com-
parison with the experimental simulations represented by
scatter points. The best simulation comes from ibmqx5
device, which is an expected result since the number of
gates used is lesser than with the other devices because
of qubits connectivity.
As expected from the previous result, points
that represent higher magnetization have more
error respect the theoretical values. However, it is
remarkable that the relations among the different
points for different values of transverse magnetic
field are proportionally correct. The oscillations
take place for lower values of hσ
z
i, have lower
amplitudes and are a little bit shifted to the left:
even though, they cross each other at the corre-
sponding points and increase and decrease pro-
portionally to the exact result. That is a clear
indicator that the error sources in the quantum
device are systematic, as the result does not de-
pend on the state preparation.
Notice that in this work we have computed the
transverse magnetization instead of the staggered
magnetization, i.e. M
x
=
P
i
(1)
i
σ
x
i
, which
is the order parameter for the antiferromagnetic
Ising model. For our purpose, it is more nat-
ural to compute hσ
z
i since the states obtained
with these quantum devices are expressed in the
σ
z
basis. However, it will be straightforward to
compute M
x
as the only change needed appears
in the classical post-processing part.
7 Conclusions
In this work we have implemented the exact sim-
ulation of a one-dimensional Ising spin chain with
transverse field in some quantum computers. To
Figure 6: Time evolution simulation of transverse mag-
netization, hσ
z
i, for the state | ↑↑↑↑i of a n = 4 Ising
spin chain. Left plot compares the exact result with the
experimental run in the ibmqx5 chip for different val-
ues of λ. Right plots detailed the results for each λ to
compare them with the theoretical values. Although the
magnetization is lesser than expected, the oscillations
follow the same theoretical pattern.
do so, we programmed the algorithm proposed in
Ref.[18] in IBM and Rigetti quantum chips. We
have simulated the expected value of ground state
transverse magnetization as well as the time evo-
lution of the state of all spins aligned. We have
also provided two methods to compute thermal
evolution of some operator using the same cir-
cuit: exact simulation or sampling.
The circuit presented allows to compute all
eigenstates of the Ising Hamiltonian by just ini-
tializing the qubits in one of the states of the com-
putational basis. It is then a implementation of
a Slater determinant with a quantum computer.
Since the one-dimensional Ising model is an ex-
actly solvable model, which means that we can
compute analytically all the states and energies
for any number of spins, and the circuit is effi-
cient, the number of gates scales as n
2
and the cir-
cuit depth as n log n, it can represent a method to
test quantum computing devices of any size. As
has been shown, it is also a hard test since this
model is strongly correlated and both the simula-
tion of the phase transition surrounding and time
evolution require a high qubits control.
The best performance has been obtained with
the ibmqx5 chip, although the error respect to the
theoretical prediction is large in the paramagnetic
phase of the model. A possible reason why this
chip shows better results than the others comes
from the number of gates used in the quantum
circuit, as the qubits connectivity in that device
allows us to save all the fSWAP gates. On the
other hand, Rigetti’s chip performs better than
Accepted in Quantum 2018-12-18, click title to verify 8
the ibmqx4 chip, even though both implemented
circuits have the same gate depth.
The paramagnetic phase is difficult to simulate
due to the fact that any error that can induce a
qubit bit flip will produce a decrease in magne-
tization, as can be traced out from the ground
state wave function of Eq.(26). However, and
taking into account this fact, the time evolution
simulation is reasonably good since the expected
oscillations for different transverse magnetic field
strengths are shifted to the left and have lower
amplitude and magnetization, but are also pro-
portional each other as are the theoretical values.
As a final remark, this circuit is also interest-
ing from a point of view of condensed matter
physics as specific methods to simulate exactly
time and thermal evolution are provided. This
can open the possibility of simulate other inter-
esting models: integrable, like Kitaev Honeycomb
model [19], or with an ansatz, like Heisenberg
model.
Notes
The program used for this work for the IBM
quantum devices was awarded with the IBM
“Teach Me QISKit” award [28].
Recently, Rigetti computing changed the quan-
tum device to one of 8 qubits. The results shown
in this work correspond to the previous device of
19 qubits.
Acknowledgements
We acknowledge use of the IBM Q experi-
ence for this work. The views expressed are
those of the authors and do not reflect the of-
ficial policy or position of IBM or the IBM
Q experience team. We also acknowledge
use of the Rigetti computing device as well
as the help and availability of Rigetti staff.
This work has been possible with the support
of FIS2015-69167-C2-2-P and FIS2017-89860-P
(MINECO/AEI/FEDER,UE) grants. Finally, we
would like to thank the discussions with Quantic
group members, in particular with José Ignacio
Latorre.
Appendix: Gate decomposition
7.1 Fermionic-SWAP
The Jordan-Wigner transformation do not need
from any quantum gate, but as it transforms the
spin operators σ into fermionic modes c, any swap
between qubits should obey the fermionic anti-
commutation relations, i.e. the exchange between
two occupied modes carries a minus sign. This is
represented with the use of fermionic SWAP gate
(fSWAP), decomposed in basic gates in Figure 7.
From the point of view of IBM’s implemen-
tation, at least one CNOT should be inverted
to fit the circuit to the qubits connectivity; this
can be easily done using the identity (H
1
H
2
)
CNOT(H
1
H
2
) =
CNOT. In addition,
controlled-Z gate could be implemented using two
Hadamard gates and a CNOT, as it is also shown
in Figure 7.
From Rigetti’s implementation point of view,
controlled-Z gates are part of their basic gate set
and, although CNOT gate and H are not, they are
included in pyquil language, so the quantum pro-
grammer should not care about decompose them
in terms of the other gates (except to keep in
mind the circuit depth will increase with the use
of non-basic gates).
×
×
Z
H H
Figure 7: Fermionic SWAP gate.
7.2 Fourier transform
The building blocks of Fourier transform gate
are represented by the quantum gate of Eq.(11),
which decomposition is shown in Figure 8. Its im-
plementation requires the controlled-Hadamard
gate, decomposed in Figure 9. Phase gate Ph is
included in Rigetti’s pyquil language and it is
equivalent to IBM’s U
1
gate (see Eq. (24)). In
particular, Ph(π/2) and Ph(π/4) correspond to
S and T gates respectively.
Accepted in Quantum 2018-12-18, click title to verify 9
F
n
k
Ph
2πk
n
H
Z
Figure 8: Decomposition of the building block of Fourier
transform gate. The controlled-Hadamard gate is shown
in Figure 9.
H
S
H
T
T H S
Figure 9: Controlled-Hadamard gate.
7.3 Bogoliubov transformation
Bogoliubov transformation is implemented using
B
n
k
gates written in Eq. (14). The explicit de-
composition is shown in Figure 10, where the
controlled-RX gate (shown in Figure 11 has been
decomposed using the methods of Ref.[29]). Ro-
tational gates are part of the basic Rigetti gate set
and are equivalent to IBM’s gates R
X
U
3
(φ =
0, λ = π), R
Y
U
3
(φ = λ = 0) and R
Z
U
1
.
B
n
k
X
R
X
(θ
k
)
X
Figure 10: Bogoliubov gate decomposition. Controlled-
RX gate needed is shown in Figure 11.
R
X
(θ
k
)
A B C
Figure 11: Controlled-RX gate decomposition in terms
of the rotational gates A = R
Z
π
2
R
Y
θ
2
, B =
R
Y
θ
2
and C = R
Z
π
2
.
7.4 Initial state preparation
The ground state of the n = 4 Ising model in
the diagonal basis is |0000i for λ > 1 and |0001i
for λ < 1. Qubits are always initialized in the
|0i state both in IBM and Rigetti devices. Then,
to compute the ground state, we only need to
perform a bit-flip gate (Pauli-X or X gate), on
fourth qubit to initialize the circuit for λ < 1.
The example given for time evolution simula-
tion requires from the preparation as the initial
state the one shown in Eq.(20). This can be done
by applying a R
Y
(φ) gate on the first qubit to
introduce the φ angle, followed by a phase gate
to introduce the evolution phase e
4it
1+λ
2
and a
CNOT gate between first and second qubits.
References
[1] D. P. DiVincenzo, Fortschritte der Physik
48, 771 (2000).
[2] IBM Quantum Experience, https://www.
research.ibm.com/ibm-q/.
[3] R. Smith, M. J. Curtis and W. J. Zeng,
arXiv:1608.03355 [quant-ph] (2016).
[4] D. Alsina and J. I. Latorre, Phys. Rev. A 94,
012314 (2016).
[5] Y. Wang, Y. Li, Z. Yin and B. Zeng, npj
Quantum Information 4, 46 (2018).
[6] J. S. Devitt, Phys. Rev. A 94, 032329 (2016).
[7] R. P. Feynman, Int. J. Theor. Phys. 21, 467
(1982).
[8] M. H. Kalos, Phys. Rev. 128, 1791 (1962).
[9] B.L. Hammond, W. A. Lester Jr. and P.J.
Reynolds, MonteCarlo Methods in Ab Initio
Quantum Chemistry, World Scientific, Sin-
gapore (1994).
[10] N. S. Blunt, T. W. Rogers, J. S. Spencer and
W. M. C. Foulkes, Phys. Rev. B 89, 245124
(2014).
[11] R. Orús, Ann. Phys. 349, 117 (2014).
[12] G. Vidal, Phys. Rev. Lett. 91, 147902
(2003).
[13] G. Ortiz, J. E. Gubernatis, E. Knill, and R.
Laflamme, Phys. Rev. A 64, 022319 (2001).
[14] D. Wecker, M. B. Hastings, N. Wiebe, B. K.
Clark, C. Nayak and M. Troyer, Phys. Rev.
A 92, 062318 (2015).
[15] Z. Jiang, K. J. Sung, K. Kechedzhi, V. N.
Smelyanskiy and S. Boixo, Phys. Rev. Appl.
9, 044036 (2018).
[16] B. Kraus, Phys. Rev. Lett. 107, 250503
(2011).
Accepted in Quantum 2018-12-18, click title to verify 10
[17] M. Hebenstreit, D. Alsina, J. I. Latorre and
B. Kraus, Phys. Rev. A 95, 052339 (2017).
[18] F. Verstraete, J. I. Cirac and J. I. Latorre,
Phys. Rev. A 79, 032316 (2008).
[19] P. Schmoll and R. Orús, Phys. Rev. B 95,
045112 (2017).
[20] H. Bethe, Z. Phys. 71, 205 (1931).
[21] V. Murg, V. E. Korepin and F. Verstraete,
Phys. Rev. B 86, 045125 (2012).
[22] E. Lieb, T. Schultz and D. Mattis, Ann.
Phys. 16, 407 (1961).
[23] S. Katsura, Phys. Rev. 127, 1508 (1962).
[24] P. Jordan and E. Wigner, Z. Phys. 47, 631
(1928).
[25] A. J. Ferris, Phys. Rev. Lett. 113, 010401
(2014).
[26] S. Sachdev, Quantum Phase Transitions,
Cambridge University Press, Cambridge
(1999).
[27] Device specifications: https:
//github.com/Qiskit/
qiskit-backend-information/tree/
master/backends.
[28] Official announce of IBM “Teach
Me QISKit" award winnerhttps:
//www.ibm.com/blogs/research/2018/
06/teach-qiskit-winner/.
[29] A. Barenco, C. H. Bennett, R. Cleve, D.
P. DiVincenzo, N. Margolus, P. Shor, T.
Sleator, J. Smolin and H. Weinfurter, Phys.
Rev. A 52 3457 (1995).
Accepted in Quantum 2018-12-18, click title to verify 11