Technische Universit at Munc hen - TUM · List of Notations C Complex number (2) Kronecker product...

68
Technische Universit¨ at M¨ unchen Computational Science and Engineering (Int. Master’s Program) Master’s Thesis Tensor Contraction Schemes for 2D Problems in Quantum Simulation Ing. Javier Enciso First examiner: Univ.-Prof. Dr. Thomas Huckle Second examiner: Univ.-Prof. Dr. Hans-Joachim Bungartz Assistant advisor: Dipl.-Math. Konrad Waldherr Thesis handed in on 30.09.2010

Transcript of Technische Universit at Munc hen - TUM · List of Notations C Complex number (2) Kronecker product...

Page 1: Technische Universit at Munc hen - TUM · List of Notations C Complex number (2) Kronecker product operator (2) H Hamiltonian (4) L n 1D lattice with nsites (8) L m n 2D lattice with

Technische Universitat MunchenComputational Science and Engineering

(Int. Master’s Program)

Master’s Thesis

Tensor Contraction Schemes for 2D Problems inQuantum Simulation

Ing. Javier Enciso

First examiner: Univ.-Prof. Dr. Thomas HuckleSecond examiner: Univ.-Prof. Dr. Hans-Joachim Bungartz

Assistant advisor: Dipl.-Math. Konrad Waldherr

Thesis handed in on 30.09.2010

Page 2: Technische Universit at Munc hen - TUM · List of Notations C Complex number (2) Kronecker product operator (2) H Hamiltonian (4) L n 1D lattice with nsites (8) L m n 2D lattice with
Page 3: Technische Universit at Munc hen - TUM · List of Notations C Complex number (2) Kronecker product operator (2) H Hamiltonian (4) L n 1D lattice with nsites (8) L m n 2D lattice with

Declaration

I hereby declare that this thesis is entirely the result of my own work exceptwhere otherwise indicated. I have only used the resources given in the listof references.

Munchen, 30.09.2010 Javier Enciso

Page 4: Technische Universit at Munc hen - TUM · List of Notations C Complex number (2) Kronecker product operator (2) H Hamiltonian (4) L n 1D lattice with nsites (8) L m n 2D lattice with

Contents

1 Introduction 11.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.2 Basic Notions . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.3 Problem Definition . . . . . . . . . . . . . . . . . . . . . . . . 41.4 Challenges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

2 Quantum Simulation 72.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72.2 Quantum Dynamics . . . . . . . . . . . . . . . . . . . . . . . 72.3 Spin Interaction . . . . . . . . . . . . . . . . . . . . . . . . . . 92.4 Ising Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112.5 Numerical Solution . . . . . . . . . . . . . . . . . . . . . . . . 12

3 Ground State Calculation 193.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193.2 Data Representation . . . . . . . . . . . . . . . . . . . . . . . 193.3 Contraction Scheme . . . . . . . . . . . . . . . . . . . . . . . 233.4 Numerical Ansatz . . . . . . . . . . . . . . . . . . . . . . . . . 24

4 Numerical Experiments 294.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294.2 Experimental Setup . . . . . . . . . . . . . . . . . . . . . . . 294.3 Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 354.4 Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38

5 Conclusions and Outlook 415.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415.2 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415.3 Further Improvements . . . . . . . . . . . . . . . . . . . . . . 42

A Computer Program 43A.1 Function Specification . . . . . . . . . . . . . . . . . . . . . . 43A.2 Code Example . . . . . . . . . . . . . . . . . . . . . . . . . . 43A.3 Licence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45

i

Page 5: Technische Universit at Munc hen - TUM · List of Notations C Complex number (2) Kronecker product operator (2) H Hamiltonian (4) L n 1D lattice with nsites (8) L m n 2D lattice with

B Configuration Management 47B.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47B.2 Hardware Configuration . . . . . . . . . . . . . . . . . . . . . 47B.3 Software Configuration . . . . . . . . . . . . . . . . . . . . . . 47

Bibliography 51

Index 53

ii

Page 6: Technische Universit at Munc hen - TUM · List of Notations C Complex number (2) Kronecker product operator (2) H Hamiltonian (4) L n 1D lattice with nsites (8) L m n 2D lattice with

List of Figures

1.1 Dimensional and time requirements . . . . . . . . . . . . . . . 5

2.1 1D lattice with n sites . . . . . . . . . . . . . . . . . . . . . . 82.2 2D lattice with m× n sites . . . . . . . . . . . . . . . . . . . 92.3 Bloch sphere . . . . . . . . . . . . . . . . . . . . . . . . . . . 102.4 1D lattice with external field . . . . . . . . . . . . . . . . . . 122.5 Sparsity pattern in Hamiltonians . . . . . . . . . . . . . . . . 132.6 Sparsity pattern after exact diagonalisation . . . . . . . . . . 142.7 Integration via Monte Carlo method . . . . . . . . . . . . . . 162.8 Decomposition and sweep directions in DMRG . . . . . . . . 18

4.1 Setup for numerical experiments . . . . . . . . . . . . . . . . 304.2 Sparsity pattern in numerical experiments . . . . . . . . . . . 304.3 Tensor blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . 314.4 Index set arrangement for six tensors . . . . . . . . . . . . . . 334.5 Simulation results . . . . . . . . . . . . . . . . . . . . . . . . 364.6 Energy level after 100 iterations . . . . . . . . . . . . . . . . . 37

B.1 Profiling sample output . . . . . . . . . . . . . . . . . . . . . 49

iii

Page 7: Technische Universit at Munc hen - TUM · List of Notations C Complex number (2) Kronecker product operator (2) H Hamiltonian (4) L n 1D lattice with nsites (8) L m n 2D lattice with

iv

Page 8: Technische Universit at Munc hen - TUM · List of Notations C Complex number (2) Kronecker product operator (2) H Hamiltonian (4) L n 1D lattice with nsites (8) L m n 2D lattice with

List of Tables

3.1 Mapping components of final state . . . . . . . . . . . . . . . 21

4.1 Tensor configurations . . . . . . . . . . . . . . . . . . . . . . . 344.2 Statistics for six tensors . . . . . . . . . . . . . . . . . . . . . 354.3 Statistics for four tensors . . . . . . . . . . . . . . . . . . . . 364.4 Statistics for three tensors . . . . . . . . . . . . . . . . . . . . 364.5 Statistics for two tensors . . . . . . . . . . . . . . . . . . . . . 374.6 Statistics for ground state calculation . . . . . . . . . . . . . 374.7 Condition number for selected Hamiltonians . . . . . . . . . . 39

A.1 Function description . . . . . . . . . . . . . . . . . . . . . . . 44

B.1 Hardware configuration . . . . . . . . . . . . . . . . . . . . . 48B.2 Software configuration . . . . . . . . . . . . . . . . . . . . . . 48

v

Page 9: Technische Universit at Munc hen - TUM · List of Notations C Complex number (2) Kronecker product operator (2) H Hamiltonian (4) L n 1D lattice with nsites (8) L m n 2D lattice with

vi

Page 10: Technische Universit at Munc hen - TUM · List of Notations C Complex number (2) Kronecker product operator (2) H Hamiltonian (4) L n 1D lattice with nsites (8) L m n 2D lattice with

List of Notations

C Complex number (2)

⊗ Kronecker product operator (2)

H Hamiltonian (4)

Ln 1D lattice with n sites (8)

Lm×n 2D lattice with m× n sites (8)

σ0, . . . , σ3 Pauli Matrices (9)

In n× n Identity Matrix (9)

MC Monte Carlo (14)

QMC Quantum Monte Carlo (14)

DoF Degrees of Freedom (14)

sincx Sinc Function (14)

D&C Divide and Conquer (17)

DMRG Density Matrix Renormalisation Group (17)

R(H, |ψ〉) Rayleigh Quotient (24)

ALS Alternating Least Squares (25)

CPU Central Process Unit (47)

GPU Graphic Process Unit (47)

RAM Random Access Memory (47)

HD Hard Disk (47)

GB Giga Bytes (47)

vii

Page 11: Technische Universit at Munc hen - TUM · List of Notations C Complex number (2) Kronecker product operator (2) H Hamiltonian (4) L n 1D lattice with nsites (8) L m n 2D lattice with

viii

Page 12: Technische Universit at Munc hen - TUM · List of Notations C Complex number (2) Kronecker product operator (2) H Hamiltonian (4) L n 1D lattice with nsites (8) L m n 2D lattice with

Acknowledgements

Thanks are due to the Colombian Government, Colfuturo and the GermanAcademic Exchange Service (DAAD) for the financial support through theScholarship-loan Programme 2008 and Scholarship A/08/72528 respectively.Thanks to the people at the education and Public Outreach Department(ePOD) at the European Southern Observatory (ESO) for their outstandingcollaboration during the internship and the writing process.

Thanks to Univ.-Prof. Dr. Thomas Huckle at the Institute for Scien-tific Computing for his continuous advice and extraordinary support alongthe two years of the Master Programme. Thanks to Dipl.-Math. KonradWaldherr for his valuable discussions and sharp thoughts that smoothed thedevelopment of the scripts. Thanks to Wilmer Hernandez for the superbvisual ideas, spooky sound effects, and mind-blowing animation presentedduring the talk at the Scientific Computing in Computer Science colloquium.

I thank my parents, brother, and sister for their omniscient support andgood-will. Last but not least, special thanks are due to my beautiful wifefor her kind support, lovely understanding, and invaluable companion inthe time being. Perhaps my memory is not good enough to remember allpeople that made this academic project possible, however, my most sinceregratitude is with all of them, after all you know how you are.

This document was produced with LATEX, vector graphics were createdwith Inkscape, and the drawings were processed with GIMP.

ix

Page 13: Technische Universit at Munc hen - TUM · List of Notations C Complex number (2) Kronecker product operator (2) H Hamiltonian (4) L n 1D lattice with nsites (8) L m n 2D lattice with

x

Page 14: Technische Universit at Munc hen - TUM · List of Notations C Complex number (2) Kronecker product operator (2) H Hamiltonian (4) L n 1D lattice with nsites (8) L m n 2D lattice with

Abstract

Quantum simulation describes a great variety of process observed in labo-ratories [16] and daily life [5], however, as soon as the computer programsinvolve more particles, time and storage turn out to be critical issues thatconstraint the execution of larger simulations. Tensor Contraction Schemesfor 2D Problems in Quantum Simulation is based on the ideas of Huckleand Waldherr [11] and is a courageous attempt to describe many-body sys-tems accurately without the intrinsic dimensional problems. To achieve thisgoal, two well-established techniques are applied to represent large vectorsimplicitly and, through a variational-based numerical method, minimise therelated optimisation problem. Remarkably, the contraction schemes demandlinear storage and time resources only. As result, the proposed scheme wasable to produce solutions up to the first significant digit for 12-particle sys-tem, taking no more than few iterations. Finally, there are still open issuesregarding the accuracy in the vector representation and the local optimalityof the iterative method that must to be addressed in future investigations.

xi

Page 15: Technische Universit at Munc hen - TUM · List of Notations C Complex number (2) Kronecker product operator (2) H Hamiltonian (4) L n 1D lattice with nsites (8) L m n 2D lattice with

Chapter 1

Introduction

“Number is the ruler of forms and ideas, and the cause of godsand daemons”

Pythagoras

1.1 Overview

From the scientific crisis that leaded the definition of a new set of ideas toexplain really to the difficulties in the realisation of the quantum simula-tions, first chapter is intended to provide to the non-experienced reader ageneral introduction into the field of quantum simulation. In section 1.2, thebasic introduction to the realm of quantum mechanics is presented, mak-ing emphasis in the clever notation used by physicists. In section 1.3, thedefinition of the problem that motivated the implementation of the contrac-tion schemes is described. Finally in section 1.4, the main challenges in theimplementation of the numerical scheme are listed.

1.2 Basic Notions

Newtonian mechanics provide reasonable explanation for the motion of bod-ies we experience in daily life [5]. From planes flying around to the tidaleffects that govern the sees and the beautiful formation of the rainbow,nonetheless, the notions underlying classical mechanics straggle in the accu-rate description of the really fast/small systems, since then a new paradigmin science to reconcile reason with reality was needed.

In 1907, the first problem was addressed by Albert Einstein [6, 21] ele-gantly. Thanks to the theoretical contributions done by the German physi-cist one hundred years ago, modern marvels such as the Global PositioningSystem[3] have been possible. Einstein’s brilliant insight was able to explainthe physics of objects subject to really intense gravitational fields, with ve-locities approaching the cosmic barrier of the speed of light. Certainly, his

1

Page 16: Technische Universit at Munc hen - TUM · List of Notations C Complex number (2) Kronecker product operator (2) H Hamiltonian (4) L n 1D lattice with nsites (8) L m n 2D lattice with

moment of genius redefined mainstream science and paved the highway forthe upcoming theories that would defy common sense.

The second problem, related to the infinite small objects like electronsand photons, posed serious difficulties for the scientific community of thelate nineteenth and early twentieth century. Among them Max Planck, whoin 1900 settled the foundation of the latter know Quantum Mechanics, anew conceptual framework so powerful, that no other theory can describeat the exquisite level of detail and astonishing accuracy the phenomena atthe atomic scale depicted by the quantum formalism.

Quantum mechanics introduced several concepts far beyond commonsense. For example, according to Heisenberg’s uncertainty principle [10], itis not possible to know particle’s position and momentum simultaneouslywithout disturbing the other. Heisenberg’s observations implied not onlyprofound changes in physics but a revolution in the understanding of real-ity. Additionally, quantum superposition allows particles to be in all possiblestates at the same time, in other words, a quantum coin might be heads andtails at the same time and the real outcome will be known after measure-ment only. Althought no formal definition for a state of a system has beenpresented, it will be developed thoroughly in the following section.

1.2.1 Quantum State

Contrary to the intuitive notion, a quantum state is a abstract mathematicalconstruction. It does not describe any physical or measurable property of thesystem, instead it supports the formalism of quantum mechanics and allowsthe evolution of the system through the application of unitary operations.The foundation for the evolution of quantum systems will be presented inthe next section.

In mathematical terms, a quantum state |ψ〉 is a complex row vectorthat lays on a finite Hilbert space H. The dimension d = dim (H) of theHilbert space is also replicated by the number of components of the state|ψ〉, which grows exponentially with the number of particles in the system.A quantum state |ψ〉 can be expressed as the linear combination of a setof orthonormal basis states |ψ〉 =

∑i ci|ki〉 where ci ∈ C and

∑i |ci|2 = 1.

The orthogonality of the support vectors |ki〉 implies that the inner product〈kj |ki〉 = 0 for all i, j ∈ N and i 6= j. Analogously, the normality of thebasis |ki〉 is verified by 〈ki|ki〉 = 1.

Dirac Notation: In 1939, Paul Dirac introduced a clever notationthat became standard de facto in the field of quantum computationand quantum information [13]. The so-called Bra-Ket notation uses thesymbol |·〉 to represent column vector and 〈·| for its complex conjugate.

The linear combination of the computational basis |0〉 =(

10

)and |1〉 =

2

Page 17: Technische Universit at Munc hen - TUM · List of Notations C Complex number (2) Kronecker product operator (2) H Hamiltonian (4) L n 1D lattice with nsites (8) L m n 2D lattice with

(01

)can represent non-trivial quantum states |ψ〉 = α|0〉+ β|1〉, where

α, β ∈ C and α2 + β2 = 1. The interaction of between the state ofparticles is modelled via the Kronecker product,

|ψ〉 ⊗ |φ〉 = α|0〉+ β|1〉 ⊗ γ|0〉+ δ|1〉= αγ|00〉+ αδ|01〉+ βγ|10〉βδ|11〉 ,

where the vector |00〉 is

|00〉 = |0〉 ⊗ |0〉

=(

10

)⊗(

10

)

=

1000

.

The same analysis holds for the remaining vectors |01〉, |10〉, and |11〉,

which correspond to column vectors

0100

,

0010

, and

0001

respectively.

As we have seen, Dirac Notation can easily represent large vectors in acompact way, which turns out to be useful considering the explosive growin the number of components when dealing with many-body systems.

Ground States

Ground states are quantum states where the minimum level of energy isachieved. They are vital in quantum simulation because they characterisequantum systems without any external influence, making possible to en-gineer strategies for their controlled evolution. Assuming the rules for theevolution of a quantum system are summarised by a matrix, the ground stateis the eigenvector related to the minimum eigenvalue of the given matrix.

As direct consequence of their origin, ground states might not be unique.When there are multiple ground states, they are called degenerated statesand they are derived from the multiplicity of the minimum eigenvalue.

3

Page 18: Technische Universit at Munc hen - TUM · List of Notations C Complex number (2) Kronecker product operator (2) H Hamiltonian (4) L n 1D lattice with nsites (8) L m n 2D lattice with

1.2.2 Hamiltonian

A Hamiltonian H is an operator used in quantum mechanics to account forthe total system’s energy. It considers the interaction between neighbourparticles as well as the contribution from external fields to produce therules that allow the evolution in time of the many-body system. In simplerterms, a Hamiltonian H takes the form of Hermitian matrix which operateson quantum states at certain time to produce the system’s state at the nexttime step.

Hamiltonians in quantum simulation are characterised by their high spar-sity. They are created out of the linear combination of Kronecker productsof 2 × 2 matrices. As expected from the definition of the Kronecker prod-uct, Hamiltonian’s dimension d = 2p, where p is the number of interactingparticles, grows exponentially with the number of particles making virtuallyimpossible to store such matrices for even moderately sized systems.

1.3 Problem Definition

Ground state calculation involves the solution of the minimisation problem

min|ψ〉∈C⊗2p

〈ψ|H|ψ〉〈ψ|ψ〉

(1.1)

where the quantum state |ψ〉 is given by the Kronecker product of states|ψ(1) . . . ψ(q)〉, the Hamiltonian H is a highly sparse matrix, and the numberof tensors q is smaller or equal to the number of particles p.

Because the number of components in the state |ψ〉 increases exponen-tially with the number of particles p, we are aiming to implement a numericalscheme capable of

1. constructing a quantum state |ψ〉 able to describe systems with largenumber of particles,

2. calculating the inner product 〈ψ|φ〉 between two arbitrary non-trivialstates, and

3. minimising problem (1.1) without storing neither huge Hamiltoniansnor large vectors explicitly.

To some extend, the experimental results would be comparable to thoseproduced in the exact solution of the problem. Leaving the threshold oc-curring about 15 particles, it is not feasible to store the problem in thesimulation’s machine, hence only conjunctures about the correctness of theoutcome will be available.

4

Page 19: Technische Universit at Munc hen - TUM · List of Notations C Complex number (2) Kronecker product operator (2) H Hamiltonian (4) L n 1D lattice with nsites (8) L m n 2D lattice with

(a) Dimensional requirements (b) Time requirements

Figure 1.1: Dimensional and time requirements associated with quantumsimulation. The exponential nature of the problem makes it intractableunder normal assumptions and forces to find alternative solutions.

1.4 Challenges

Understanding the problem’s domain is the first implicit challenge. Albeitthe foundation of quantum mechanics relies on the mathematics of linear al-gebra and complex numbers, the incredible diversity of ideas and approachesmake it an ideal scenario to test the ability to grasp concepts on the fly, ap-propriate them, and integrate them in the solution of complex problems.

The high dimensionality of the related minimisation problem is the sec-ond challenge. The number of elements in matrices and vectors increasesexponentially with the number of particles involved, therefore even prob-lems dealing with 50 sites cannot be represented by traditional means (e.g.,full matrix). One can think in compressed formats such coordinate form,compressed sparse row, diagonalwise storage, etc., to store sparse matricesand vectors and circumvent the issue, however, no one knows beforehandabout the sparsity of the resulting vectors, hence compressed formats mightbe insufficient to treat dense vectors.

In Figure 1.1 time and storage requirements for the simulation of many-body system is presented. As the draw suggest, there is an exponentialrelationship between the number of particles and the performance indicators,therefore it is needed a new approach that let the simulations go beyond tensof particles without losing accuracy and within reasonable times.

5

Page 20: Technische Universit at Munc hen - TUM · List of Notations C Complex number (2) Kronecker product operator (2) H Hamiltonian (4) L n 1D lattice with nsites (8) L m n 2D lattice with

6

Page 21: Technische Universit at Munc hen - TUM · List of Notations C Complex number (2) Kronecker product operator (2) H Hamiltonian (4) L n 1D lattice with nsites (8) L m n 2D lattice with

Chapter 2

Quantum Simulation

“I think I can safely say that nobody understands quantum me-chanics”

Richard Feynman

2.1 Overview

Since ancient times, human beings have been always fascinating by the trueof nature of matter and pursued their understanding trough simpler and sim-pler principles, powerful enough, to accurately describe the vast majority ofphenomena seen in daily life. The idea of indivisible blocks of matter wasfirst proposed by early Indian and Greek philosophers and took centuriesuntil chemists and physicists unveiled the multiple facets of the atom. Yearslater, a gang of physicists drastically changed the way reality was thought.They introduced a complete set of new ideas and invented quantum me-chanics, now nature is telling us an unheard story far beyond our wildestimagination.

Along the lines of this chapter, conceptual elements that enable scien-tists to perform quantum simulations are discussed. In section 2.2, furtherdetails about the quantum dynamics are presented as well as the basic setupconsidered in the time evolution of the atomic systems. In section 2.3, theinteraction between atoms reveals how the Hamiltonian is built. In section2.4, the simplest model for particle interaction shows how elegant mathe-matics can describe nature at atomic level. Finally, in section 3.4, a concretereview on the major numerical approaches used in quantum simulation ispresented.

2.2 Quantum Dynamics

Quantum dynamics refers to the evolution in time of quantum systems.Understanding the behaviour of matter at atomic scale enables researches

7

Page 22: Technische Universit at Munc hen - TUM · List of Notations C Complex number (2) Kronecker product operator (2) H Hamiltonian (4) L n 1D lattice with nsites (8) L m n 2D lattice with

0 1 k-1 k k+1 n-2 n-1

Figure 2.1: 1D lattice with n sites and open boundary conditions. Everyintermediate site has exactly two neighbours. The boundary sites have onlyone neighbour each. Labels are assigned from left to right.

to predict material’s macroscopic properties. For example in the design oftopological insulators [12] – materials that behaves like insulators withintheir interior and conductors in their boundaries – it is worth to know theexternal conditions that allow conventional materials exhibit such remark-able properties, in other words, it is important to know the conditions forstate transitions.

The numerical study of the state evolution of atoms and molecules is ademanding computational task. Scientists have been puzzled by the amountof resources needed to simulate relative small systems. Luckily, physicistscame about with an elegant insight to solve the atomic conundrum. Insteadof simulating hundreds of thousands of individual particles, they focused insmall samples of the material only and then inferred the general proper-ties out of the local observations, this approach is also known as StatisticalPhysics and describes nuclear reactions accurately, shedding light on prob-lems from a variety of disciplines including biology, chemistry, neurologyamong others.

2.2.1 Lattice

Ideally, atoms and molecules are assumed to be localed in a uniform struc-ture called Lattice. A 1D lattice Ln, as shown in Figure 2.1, is a collection ofn sites where every site has two neighbours except the boundary ones. Sincethe particles placed on the lattice’s boundaries do not interact each other,the 1D lattice has open boundary conditions. In contrast, when there areinteractions between the boundary elements, the lattice is said to have pe-riodic boundary conditions. As a consequence of the two types of boundaryconditions, 1D Hamiltonians of this study differ in one addend only, the onethat accounts for the bound interaction between the first and last particles.

Naturally, the 1D case might be extended to the second dimension. A2D lattice Lm×n with m × n sites and open boundary conditions is shownin Figure 2.2. This is the standard arrangement of atoms utilised in thesubsequent chapters and whenever a new lattice is introduced, it is assumedto be a 2D one. As a convention, every site p within the lattice is labeled by

p = i · j + j (2.1)

where i and j are the abscissa and ordinate respectively. For instance,given a rectangular lattice L2×3, the label for a particle located at (1, 2) is4 = 1 · 2 + 2.

8

Page 23: Technische Universit at Munc hen - TUM · List of Notations C Complex number (2) Kronecker product operator (2) H Hamiltonian (4) L n 1D lattice with nsites (8) L m n 2D lattice with

0 1 n-2 n-1

m(n-1) m(n-1)+1 mn-2 mn-1

Figure 2.2: 2D lattice with m × n sites and open boundary conditions,distributed in m rows and n columns. The label for each site is assignedfrom left to right and from bottom to top, starting from the left-most lowerand ending at the right-most upper corner.

Finally, although out of reach for the present study, the particles areallowed to be placed in the 3D scenario. If that is the case, labels for the 3Dlattice are given from the left-most lower to the right-most upper corners,and from front to back.

2.3 Spin Interaction

Spin is a fundamental property present in elementary particles as well inatoms and molecules. It suggests some sort of rotation around an axisand, from the macroscopic point of view, it explains phase transitions inmaterials; for example from iron to a permanent magnet. For the sake ofthe non-physicist reader, the spin will be regarded as a binary quantitywhich after measurement is either 1 or 0. Nonetheless, spin superpositionis allowed and destroyed after the measurement, producing one of the twoinitial outcomes only.

In a geometrical sense, the spin – a quantum state – can be modelledas a unit vector circumscribed by the Bloch sphere [20]. The Bloch sphere,shown in Figure 2.31, is a graphical representation of a two-level pure state2

|ψ〉, where the projection onto the z-axis is the outcome of the measurement

1Source: Wikipedia contributors. “Bloch sphere”. Wikipedia, The Free Encyclopedia.Wikipedia, The Free Encyclopedia, 2 Aug. 2010. Web. 18 Aug. 2010.

2A pure quantum state can be written by a single ket vector, or as a sum of basisstates.

9

Page 24: Technische Universit at Munc hen - TUM · List of Notations C Complex number (2) Kronecker product operator (2) H Hamiltonian (4) L n 1D lattice with nsites (8) L m n 2D lattice with

x

y

z

φ

θ

1

0

ψ

Figure 2.3: Bloch sphere is a geometrical representation of a two-level purestate. The projection onto the z-axis is the outcome after measurement, itcan be 0 or 1.

process. In general the spin is fully defined by

|ψ〉 = cos(θ/2)|0〉+ eiφ sin(θ/2)|1〉 (2.2)

where 0 ≤ θ ≤ π, 0 ≤ φ ≤ 2π, and eiφ = cosφ+ i sinφ.

Spin interacts with neighbour particles and external forces to producenew states. The mutual influence of the two-level system is realised bythe application of the Pauli Matrices. Pauli Matrices (see equations (2.3)),named after Wolfgang Pauli, are represented by the Greek letter σi, wherei ∈ {0, 1, 2, 3}. They are 2 × 2 complex Hermitian3 and Unitary4 matrices,capable to rotate vectors that represent the quantum states in any direction.This fact is incredibly useful since by the rotation, the energy of the systemis unchanged and the conservation laws of physics remain safe under thenumerical treatment.

For the quantum simulations developed in latter sections, σ3-matrix –neighbour interaction –, σ1-matrix – external interaction – and σ0-matrix– no interaction – will be taken into account only. The linear combinationof the Kronecker product of the 2× 2 matrices reproduces the evolution intime of the quantum systems faithfully.

3A Hermitian matrix A satisfies A = A†.4A Unitary matrix U of size n× n satisfies UU† = U†U = In.

10

Page 25: Technische Universit at Munc hen - TUM · List of Notations C Complex number (2) Kronecker product operator (2) H Hamiltonian (4) L n 1D lattice with nsites (8) L m n 2D lattice with

σ0 :=(

1 00 1

)(2.3a)

σ1 :=(

0 11 0

)(2.3b)

σ2 :=(

0 −ii 0

)(2.3c)

σ3 :=(

1 00 −1

)(2.3d)

2.4 Ising Model

By early 20th century, German physicists Wilhelm Lenz presented a mathe-matical model to explain ferromagnetism – the mechanism by certain mate-rials transform into permanent magnets – in a bare but convincing manner.Few years latter, one of his doctoral student named Ernst Ising solved theproblem for the 1D case and wrote his name in the physics textbooks. Nowa-days, the Ising Model is one of the standard test problems where a varietyof novel numerical methods are examined looking for the fastest and mostaccurate technique in quantum simulation.

In its simplest form, the Ising model represents a 1D lattice Ln withopen boundary conditions (see Figure 2.4). On each site, the particle’s spinis affected by the interaction with its neighbour, as well as the external field.The Hamiltonian H for an Ising-like system is given by

H =M∑k=1

αkQ(k)1 ⊗ . . .⊗Q

(k)N , (2.4)

where N is the number of sites, the scalar αk is the strength of the magneticfield and Q

(k)i is one of the Pauli matrices shown in (2.3).

For instance the Ising-like Hamiltonian for a 4-particle systems with openboundary conditions looks like

H = α1σ3 ⊗ σ3 ⊗ σ0 ⊗ σ0 +α2σ0 ⊗ σ3 ⊗ σ3 ⊗ σ0 +α3σ0 ⊗ σ0 ⊗ σ3 ⊗ σ3 +α4σ1 ⊗ σ0 ⊗ σ0 ⊗ σ0 +α5σ0 ⊗ σ1 ⊗ σ0 ⊗ σ0 +α6σ0 ⊗ σ0 ⊗ σ1 ⊗ σ0 +α7σ0 ⊗ σ0 ⊗ σ0 ⊗ σ1 .

11

Page 26: Technische Universit at Munc hen - TUM · List of Notations C Complex number (2) Kronecker product operator (2) H Hamiltonian (4) L n 1D lattice with nsites (8) L m n 2D lattice with

0 1 k-1 k k+1 n-2 n-1

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Figure 2.4: 1D lattice with open boundary conditions under the influenceof an external field. There are n sites, labeled from 0 to n− 1, subject to aperpendicular magnetic field. The interaction between neighbour particlesplus to the external field transforms the particle’s spin. This configurationis the setup for the Ising model.

Evidently, the resulting Hamiltonian H is a Hermitian-Unitary 16 × 16matrix with sparsity index ∼ 70%5 and a well defined pattern around themain diagonal (see Figure 2.5a).

For the interested reader, an award-wining introduction to the Isingmodel [4] is also available.

2.5 Numerical Solution

Once we have established the mathematical model, we can think in the bestnumerical technique to solve the eigenvalue problem associated with theHamiltonian that describes the evolution in time of the quantum systemand find the minimum eigenvalue, which corresponds to the ground state.

Far for being a complete survey on the numerical methods used in quan-tum simulation, the idea behind the following lines is to elaborate on themajor approaches employed by physicists, from the early stages to currentdevelopments, to solve the optimisation problem.

2.5.1 Exact Diagonalisation

Exact diagonalisation is a numerical technique that roots its origin in thewell-known Gaussian elimination algorithm. By the successive applicationof elementary rows-wise operations, the hope is to obtain an explicit expres-sion for the calculation of eigenvalues and eigenvectors, therefore groundstates.

5The sparsity index is one minus the number of non-zero elements divided by the totalnumber of the entries.

12

Page 27: Technische Universit at Munc hen - TUM · List of Notations C Complex number (2) Kronecker product operator (2) H Hamiltonian (4) L n 1D lattice with nsites (8) L m n 2D lattice with

(a) 4-particle Hamiltonian (b) 5-particle Hamiltonian (c) 6-particle Hamiltonian

Figure 2.5: Sparsity pattern observed in three different sized Hamiltonians.Figure 2.5a shows a 16×16 Ising-like Hamiltonian with sparsity index∼ 70%.Figures 2.5b and 2.5c show a 32×32 and 64×64 Ising-like Hamiltonian withsparsity index ∼ 83% and ∼ 90% respectively. The resulting Hamiltonian isHermitian and built upon the linear combination of the Kronecker productbetween Pauli matrices.

To refresh the memory of the distracted reader – not to mention toimprove author’s writing skills –, the eigenvalue problem (2.5) deals withfinding the λ-values that satisfy

Ax = λx , (2.5)

where A is a square matrix, x is a row-vector and λ is the eigenvalue.Although by the application of the Gaussian elimination it is possible

to find all eigenvalues of the matrix A, only the minimum is relevant forthe calculation of ground states. The unexpected feature turns out to beinconvenient due to the computational cost implied in the computation ofunnecessary values.

To begin with, equation 2.5 is taken into a more convenient way, say

(A− λI)x = 0 . (2.6)

Assuming the inverse matrix (A − λI)−1 exists, solving the so-calledcharacteristic polynomial

det (A− λI) = 0 , (2.7)

will end up with the eigenvalues of the matrix A.This naıve approach is useful for small systems only. In Figure 2.6 a

60×60 sparse matrix6 is used for the application of the Gaussian algorithm.6Note that for the simulation of quantum systems described up to now, the size of the

matrix is given by 2p, where p is the number of particles; therefore a 60×60 sparse matrixpresented in this example corresponds to a fictional system.

13

Page 28: Technische Universit at Munc hen - TUM · List of Notations C Complex number (2) Kronecker product operator (2) H Hamiltonian (4) L n 1D lattice with nsites (8) L m n 2D lattice with

(a) Sparse matrix (b) Reduced matrix

Figure 2.6: Sparsity pattern observed in a given matrix is contrasted againstthe one after the application of the Gaussian elimination. It might be thecase that after some reduction operations, new non-zero entries appear. Thisis a collateral effect caused by the Gaussian algorithm.

The idea is to replace the non-zero elements in the lower triangular matrixby zeros through basic arithmetic operations between rows, then throughbackward substitution, find the solution of the related system.

Despite the simplicity of the approach, there are serious performanceissues one can easily foresee. The obvious ones refer to the necessity buildingexponentially sized matrices and the cubic complexity of the eliminationprocedure.

The unexpected inclusion of non-zero entries is another collateral effect.Since the given matrix is sparse by construction, during the successive col-umn reduction – adding zeros in the lower triangular matrix – one mightadd non-zero elements in entries whose previous value was zero. This issueincreases the total procedure’s overheat, making its application a non-viablealternative in the realm of quantum simulation.

2.5.2 Quantum Monte Carlo

Quantum Monte Carlo (QMC) is a whole family of stochastic methods basedon the guidelines provided by the Monte Carlo (MC) methods. The fun-damental idea underlying MC is sampling – random selection of individu-als from a given population –. Usually, the high-dimensionality of certainproblems makes MC the method of choice due to its haphazard nature andalways-increasing accuracy.

MC integration, for instance, is a technique to estimate the area under

14

Page 29: Technische Universit at Munc hen - TUM · List of Notations C Complex number (2) Kronecker product operator (2) H Hamiltonian (4) L n 1D lattice with nsites (8) L m n 2D lattice with

the curve. Althought this particular simple example lacks of the dimension-ality course – the exponential increase of degrees of freedom (DoF) with thesize of the problem –, it shows the concept of sampling perfectly and thecorrelation between number of samples and the accuracy of the stochasticmethod.

Given the unnormalised sinc function [14] defined by

sincx :={

sinxx if x 6= 01 otherwise,

(2.8)

the problem consists in approximate the area under the curve in the closedinterval [0, π], ∫ π

0sincx dx. (2.9)

It is important to note that the integral (2.9) does not have analyticalsolution, hence a numerical method must be employed to find the value ofthe area below the curve. To this end, an off-the-shelf numerical softwareproduces the following result∫ π

0sincx dx ≈ 1.8519, (2.10)

which might be used to verify the correctness of the MC method that willbe applied soon.

The integration domain of problem (2.9) is [0, π] and the values takenby function (2.8) range from 0 to 1. In other words, the area of interest isbounded by a rectangle of width ` = π and height h = 1, therefore one cansafely state that the resulting area must be a value between 0 and π = ` · h.

Not too impressive till now. Let’s take a bunch of grains of sand andthrow them over the rectangle where the function (2.8) lays on (see Figure2.7). Assuming no hurricanes near by and you got a good shot, some grainswill land in the area below the curve whereas the remaining will do so outof the region of interest. Finally, one can count the number of grains thatbelong to each of the two areas and derive a simple expression to solveproblem (2.9), say ∫ π

0sincx dx ≈ pblue

pblue + predπ (2.11)

where pblue and pred are the grains below and above the curve respectively.The relative error for 102 samples is ∼ 10−1 whereas for 104 samples

is ∼ 10−4, showing the intuitive notion that the accuracy of the result isproportional to the number of samples. This fact is the major disadvantageof MC based methods although it can be counteracted by the use of multipleprocesses units, taking advantage of its embarrassingly parallel behavior.

15

Page 30: Technische Universit at Munc hen - TUM · List of Notations C Complex number (2) Kronecker product operator (2) H Hamiltonian (4) L n 1D lattice with nsites (8) L m n 2D lattice with

(a) 102 Samples (b) 103 Samples

(c) 104 Samples (d) 105 Samples

Figure 2.7: Integration via Monte Carlo method. Intuitively, the more sam-ples the better the approximation is. The area below the curve is estimatedby the ratio between the number of blue and the total number of points(blue + red).

16

Page 31: Technische Universit at Munc hen - TUM · List of Notations C Complex number (2) Kronecker product operator (2) H Hamiltonian (4) L n 1D lattice with nsites (8) L m n 2D lattice with

Once understood the concept underlying MC methods, it can be extrap-olated to quantum simulation, what is known as QMC. Here the problem isto find the ground state – eigenvector – for a given system of interacting par-ticles using randomness to generate solutions that, after several iterations,might converge toward the desired state. The application of QMC does notguarantee optimal solutions, however they tend to be cheap and fast.

For a complete review on the application of QMC for many-electronsystems, the interested reader might refer to the work by Foulkes et al. [8].

2.5.3 Density Matrix Renormalisation Group

Density Matrix Renormalisation Group (DMRG) is a numerical techniqueused to calculate ground states in quantum systems. First envisioned byAmerican physicist Steven White [19], it was applied on the solution of1D problems and since then it has been the method of choice among thescientific community due to its high-accuracy and numerous freely-availableimplementations in major programming languages [1] [2] [7].

Albeit DMRG was introduced for the simulation of toy-like problems,remarkable progress has been achieved since its initial conception. In 2004,Verstraete et al. extended the original work by White through the solutionof quantum-many body systems with periodic boundary conditions [18] andtwo and higher dimensions [17]. DMRG relies on the principle of divide etimpera – divide and conquer, briefly D&C –. In other words, the idea isto divide the original problem into smaller ones such that the solution ofthe simplified versions converge towards the optimum i.e., the lowest energystate.

DMRG’s procedure starts by the initialisation of the system’s state. Asweird as it might sound, the best approach consists in the assignation ofnormalised random values for the probabilities associated to each possibleoutcome. In this way, there exists a better chance to obtain the groundstate, avoiding local minima.

In Figure 2.87 a schematic representation of the DMRG algorithm isdepicted. The lattice L10 is divided into two parts. The left- and right-part contain 4 and 5 sites respectively (see Figure 2.8a). The fifth site,which acts as a pivot, does not belong to any of the two sub-blocks and ischosen arbitrarily, favouring the stochastic nature of the entire procedure.Again, by the introduction of probabilistic elements in the algorithm, DMRGcircumvents potential local minima.

The next step is the propagation of the relevant information from eachsub-block to the pivot. Assuming the size of the sub-blocks reside within thetractable zone (e.g., small enough to be solved by traditional means), the

7Source: Wikipedia contributors. “Density matrix renormalization group.” Wikipedia,The Free Encyclopedia. Wikipedia, The Free Encyclopedia, 15 Jul. 2010. Web. 27 Aug.2010.

17

Page 32: Technische Universit at Munc hen - TUM · List of Notations C Complex number (2) Kronecker product operator (2) H Hamiltonian (4) L n 1D lattice with nsites (8) L m n 2D lattice with

(a) Lattice decomposition (b) Sweep directions

Figure 2.8: Lattice decomposition in DMRG method. The original systemis divided into two blocks, the ground state is calculated for each sub-blockand then hte information is propagated to the pivot. Both the starting pivotas the sweep direction are picked at random, incorporating some fuzzinessthat eventually will avoid local minima and lead to the ground state.

objective is to calculate the ground state of left- and right-parts and thenestimate the resulting state for the pivot. In case that the size of the sub-blocks is too big, the standard approach consists in the recursive applicationof the same idea: dividing the block into two sub-blocks by choosing a pivotrandomly and calculating the respective ground states.

In the last step, after solving the system for a given pivot, a sweepingis performed over each site (see Figure 2.8b). One more time, the sweepingdirection is completely arbitrary, it might be from left to right or on theother way around. In any case, the underlying principle is to incorporatesome sort of fuzziness that eventually will take over the local minima andlead to the desired ground state.

Finally for a complete review of the DMRG technique, the proactivereader is strongly advised to follow the work by Schollwock [15].

18

Page 33: Technische Universit at Munc hen - TUM · List of Notations C Complex number (2) Kronecker product operator (2) H Hamiltonian (4) L n 1D lattice with nsites (8) L m n 2D lattice with

Chapter 3

Ground State Calculation

“Do not worry about your problems with mathematics, I assureyou mine are far greater”

Albert Einstein

3.1 Overview

Ground state calculation has never been an easy task, mainly because ofthe exponential size of practical applications and the finite, although alwaysincreasing, computing capabilities. As seen in the previous chapter, thereare several interesting approaches to deal with quantum simulations, fromthe traditional exact solution of the related eigenvalue problem to the moresophisticated stochastic algorithms that take advantage of randomness tocome up with faster and nearly optimal solutions.

The contraction scheme used to calculate the ground state is based onthe ideas of Huckle and Waldherr [11]. It combines the best from two well-known techniques to solve the associated minimisation problem, linearly inthe number of particles. Instead of overwhelming formulae, the propose ofthis chapter is to illustrate, through small examples, the application of theconcepts involved. In section 3.2 a convenient data representation allowscheap calculations of vector- and matrix-vector products. Finally in section3.4, a variational-principle-based numerical method for the solution of thegeneralised eigenvalue problem is presented.

3.2 Data Representation

To calculate the ground state in a quantum system a numerical techniquemust be able to deal with vectors and matrices in higher dimensions. In thissection we elaborate on how to represent long vectors and matrices withoutlosing accuracy and enormous storage requirements.

19

Page 34: Technische Universit at Munc hen - TUM · List of Notations C Complex number (2) Kronecker product operator (2) H Hamiltonian (4) L n 1D lattice with nsites (8) L m n 2D lattice with

3.2.1 State Representation

States are represented by 2p-D arrays, which implies a storage problem assoon as p – the number of particles – is too big. To work around this issue,the Kronecker product representation is used as alternative to efficientlyconstruct larger vectors.

For instance, the state of a 3-particle system is represented by an 8-component array

|ψ〉 =

ψ0

ψ1...ψ6

ψ7

,

where ψi ∈ C and 〈ψ|ψ〉 =∑

i ψ∗i ψi = 1. Alternatively, the same 8-

component array might be represented using only three tensors, with sixelements in total, say

|ψ〉 = |ψ(1)ψ(2)ψ(3)〉= |ψ(1)〉 ⊗ |ψ(2)〉 ⊗ |ψ(3)〉

=

(1)0

ψ(1)1

)⊗

(2)0

ψ(2)1

)⊗

(3)0

ψ(3)1

)

=

ψ

(1)0 ψ

(2)0 ψ

(3)0

ψ(1)0 ψ

(2)0 ψ

(3)1

...ψ

(1)1 ψ

(2)1 ψ

(3)0

ψ(1)1 ψ

(2)1 ψ

(3)1

,

where ψ(m)k ∈ C , m is the number of the vector and k is the array index.

Immediately, one can see the relationship between the elements in theresulting vector and the binary concatenation of the indexes of the precedingcomponents (see Table 3.1). The first component of |ψ〉 is calculated throughthe product of the elements located at position 0, 0, 0 in vectors |ψ(1)〉, |ψ(2)〉,|ψ(3)〉 respectively. The second component corresponds to the product ofelements 0, 0, 1, and so forth. Note that the components related to the leastsignificant bit are contained in |ψ(3)〉, analogously the most significant onesrefer to values in |ψ(1)〉.

In a broader sense, tensor vectors |ψ(m)〉 might have more than twocomponents and does not have to be equally sized, for instance tensor |ψ(1)〉might have four elements whilst tensor |ψ(2)〉 and |ψ(3)〉 eight components

20

Page 35: Technische Universit at Munc hen - TUM · List of Notations C Complex number (2) Kronecker product operator (2) H Hamiltonian (4) L n 1D lattice with nsites (8) L m n 2D lattice with

Table 3.1: Mapping components of final state. The individual components ofthe final state are obtained by the multiplication of the respective elementsof tensor vectors |ψ(m)〉. By using this approach, there is no need to storeall final components explicitly, instead they can be calculated at any time.

|ψ〉 |ψ(1)〉 |ψ(2)〉 |ψ(3)〉0 0 0 01 0 0 12 0 1 03 0 1 14 1 0 05 1 0 16 1 1 07 1 1 1

each. To this end, a new notation comes in to facilitate the representationof long vectors and allow their cheap computation.

Suppose again an 8-component vector represented by the Kroneckerproduct of two tensors with four and two components each

|ψ〉 = |ψ(1)ψ(2)〉= |ψ(1)〉 ⊗ |ψ(2)〉

=

ψ

(1)00

ψ(1)01

ψ(1)10

ψ(1)11

⊗(ψ

(2)0

ψ(2)1

)

=

ψ

(1)00 ψ

(2)0

ψ(1)01 ψ

(2)0

...ψ

(1)11 ψ

(2)0

ψ(1)11 ψ

(2)1

.

Instead of focusing on the components, the idea is to concentrate onthe index sets, or bit positions in the binary representation, that allow thecalculation of the components in the resulting vector |ψ〉

ψ{i2,i1,i0} = ψ(1){i2,i1}ψ

(2){i0} ,

where ik={0,1,2} takes the value of 0 or 1. Note the relationship between thesubscript k and the particle it represents within the quantum system. Asit will be discussed in section 3.3, it is handy to have such representation

21

Page 36: Technische Universit at Munc hen - TUM · List of Notations C Complex number (2) Kronecker product operator (2) H Hamiltonian (4) L n 1D lattice with nsites (8) L m n 2D lattice with

for tensors because it allows the computation of vector- and matrix-vectorproducts without the explicit representation of them.

In general, it is assumed that any quantum state |ψ〉 can be representedby the linear combination of Kronecker products between tensor of differentsize

|ψ〉 =J∑j=1

K⊗k=1

|ψ(k)(j) 〉 , (3.1)

where K ≤ p – number of particles – and the number of addends J < ∞.Note that the number of addends J determines the level of precision in theapproximation of the state |ψ〉.

Equation (3.1) shows the general form one can use to effectively repre-sent larger vectors by means of the tensor Kronecker product. This is anefficient approach and perfectly suited for quantum simulation because of itseasy decomposition that allows the calculation of vector- and matrix-vectorproducts using only the information contained in the index sets.

3.2.2 Hamiltonian Representation

Due to the storage constraints Hamiltonians are never built explicitly, in-stead they are represented in compact form by the linear combination ofKronecker products of small matrices

H =M∑m=1

αmQ(m)0 ⊗ . . .⊗Q(m)

p−1 , (3.2)

where Q(m)k is one of the Pauli matrices, M is the total number of bounds

in the quantum system, and p the number of particles.The method developed in this chapter works with the Hamiltonian given

in Equation (3.2), therefore we will stick to this definition unless otherwisestated. One remarkable feature of the compact form is that it enables thecalculation of the matrix-vector product by addressing the tensor’s index setelements and the Pauli matrix’s subscript k.

For example, assume the 16-component vector given by

|ψ〉 = |ψ(1)ψ(2)〉ψ{i3,i2,i1,i0} = ψ

(1){i2,i0}ψ

(2){i3,i1} ,

has to be multiplied by the Hamiltonian

H =M∑m=1

αmQ(m)0 ⊗ . . .⊗Q(m)

3 ,

22

Page 37: Technische Universit at Munc hen - TUM · List of Notations C Complex number (2) Kronecker product operator (2) H Hamiltonian (4) L n 1D lattice with nsites (8) L m n 2D lattice with

which results in the state

|φ〉 = H|ψ〉

=M∑m=1

αmQ(m)0 ⊗ . . .⊗Q(m)

3 |ψ(1)ψ(2)〉

=

(M∑m=1

αmQ(m)0 ⊗Q(m)

2 |ψ(1)〉

)(M∑m=1

αmQ(m)1 ⊗Q(m)

3 |ψ(2)〉

)|φ〉 = |φ(1)φ(2)〉

φ{i3,i2,i1,i0} = φ(1){i2,i0}φ

(2){i3,i1} .

Naturally, note that the size of the matrices is given the tensor’s numberof components, therefore problems associated with storage can be skippedand the matrix-vector product is realised efficiently.

3.3 Contraction Scheme

The contraction scheme is used to calculate the inner product between twotensor vectors. It relies on the binary index set representation to choosethe multiplicands selectively out of the tensor components, avoiding explicitformulation of the vectors.

For example, assume two 4-component vectors |ψ〉 = |ψ(1)〉 and |φ〉 =|φ(1)〉 ⊗ |φ(2)〉 = |φ(1)φ(2)〉, and the inner product

〈ψ|φ〉 = 〈ψ(1)|φ(1)φ(2)〉

=1∑

i1=0

1∑i0=0

ψ(1)∗{i1,i0}φ

(1){i1}φ

(2){i0} ∴ γ{i1} =

1∑i0=0

ψ(1)∗{i1,i0}φ

(2){i0}

=1∑

i1=0

γ{i1}φ(1){i1} .

Too fast? Let’s try to elaborate on the contraction scheme itself. Itbegins by defining the index sets of the tensors, in this case the indexset for tensors |ψ(1)〉, |φ(1)〉, and |φ(2)〉 are {i1, i0}, {i1}, and {i0} respec-tively. To get a full contraction – or getting a scalar value from the innerproduct–, it is important that the union of index sets in a group of ten-sors (e.g., {i1, i0}

⋃∅ = {i1, i0}) equals the union of its counterpart (e.g.,

{i1}⋃{i0} = {i1, i0}). If so, the result of the contraction scheme is a scalar

that represents the inner product 〈ψ|φ〉. Otherwise, the outcome of thecontraction is another tensor, whose values represent the components of themissing elements in the index set.

23

Page 38: Technische Universit at Munc hen - TUM · List of Notations C Complex number (2) Kronecker product operator (2) H Hamiltonian (4) L n 1D lattice with nsites (8) L m n 2D lattice with

Next step involves the selection of the inner-most index to contract,i0. The tensors involved are |ψ(1)〉 and |φ(2)〉, they are taken apart and thesummation of the conjugate products is calculated and stored in an auxiliarytensor γ{i1}. From the management of the indexes, there are two relevantfacts to bare in mind after the contraction of the first index:

1. The summation index set {i0} is obtained through the intersection ofthe preceding index sets, i.e., {i0} = {i1, i0}

⋂{i0}. If the summation

index set is empty, it means that the given tensors cannot be con-tracted and a new tensor, with common index set elements must bechosen.

2. The contraction index set {i1} is obtained through the symmetric dif-ference of the preceding index sets, i.e., {i1} = {i1, i0}\{i0}

⋃{i0}\{i1, i0}.

If the contraction index set is empty, there might be two possible situ-ations. Either the contraction is done or the two selected tensors havethe same index sets and the result of the contraction is a scalar thatwill be multiplied to the final result.

The contraction scheme is repeated until the inner product shows up.The complexity of the procedure is linear in the number of tensors, nonethe-less, it differs from the direct calculation since explicit storage of the entirevectors is not needed.

3.4 Numerical Ansatz

The calculation of the ground state follows a two-step numerical procedure.Firstly, the Hamiltonian’s compact form (see Equation (3.2)) and the ten-sor representation of the quantum state are reformulated as a minimisationproblem. Secondly, the minimisation problem is solved through a numericalscheme, which is based on the variational principle and is applied iterativelyuntil convergence.

3.4.1 Rayleigh Quotient

The Rayleigh quotient is a numerical scheme used to find eigenvalue approx-imations for Hermitian matrices. It is defined as

R(H, |ψ〉) :=〈ψ|H|ψ〉〈ψ|ψ〉

, (3.3)

where H is complex Hermitian and |ψ〉 is a non-zero vector. Note that in thecontext of quantum simulation H is real, therefore its Hermitian characteris reduced to being symmetric.

24

Page 39: Technische Universit at Munc hen - TUM · List of Notations C Complex number (2) Kronecker product operator (2) H Hamiltonian (4) L n 1D lattice with nsites (8) L m n 2D lattice with

The range of values obtained via the Rayleigh quotient is bounded bythe minimum and maximum eigenvalues

λmin ≤ R(H, |ψ〉) ≤ λmax , (3.4)

for all non-zero |ψ〉 ∈ C 2p. Since the calculation of the ground state is all

about finding the minimum eigenvalue, and considering the structure of theHermitian matrix H, the Rayleigh quotient is a perfectly well-suited schemefor the problem of interest.

In its final form, the minimisation problem reduces to

λmin u min|ψ(1)...ψ(q)〉∈C⊗2p

〈ψ(1) . . . ψ(q)|H|ψ(1) . . . ψ(q)〉〈ψ(1) . . . ψ(q)|ψ(1) . . . ψ(q)〉

(3.5)

where q ≤ p is the number of tensor. As a matter of fact, the smaller thenumber of tensors, the better the approximation of the eigenvalue. If q = 1,the resulting eigenvalue is the exact one, however having a unique vector inthe Rayleigh quotient poses a storage problem that makes its considerationout of any practical application.

3.4.2 Alternating Least Squares

Alternating Least Squares (ALS) is a numerical technique used to solveoverdetermined systems of equations. It is based on the Least Squaresmethod, which primary application area is data fitting, and its practicalapplication is due to the ability to optimise one by one the variables in-volved along the minimisation of the Rayleigh quotient.

To solve minimisation problem (3.5), a number of preliminary algebraictransformation are needed. In fact, the idea is to minimise each state vector|ψ(i)〉 one at a time, say

λ(i)min = min

|ψ(i)〉

〈ψ(L)ψ(i)ψ(R)|H|ψ(L)ψ(i)ψ(R)〉〈ψ(L)ψ(i)ψ(R)|ψ(L)ψ(i)ψ(R)〉

= min|ψ(i)〉

〈ψ(L)ψ(i)ψ(R)|∑M

m=1 αmH(m)L ⊗H(m)

i ⊗H(m)R |ψ(L)ψ(i)ψ(R)〉

〈ψ(L)ψ(i)ψ(R)|ψ(L)ψ(i)ψ(R)〉

= min|ψ(i)〉

∑Mm=1 αm〈ψ(L)|H(m)

L |ψ(L)〉〈ψ(R)|H(m)R |ψ(R)〉〈ψ(i)|H(m)

i |ψ(i)〉〈ψ(L)|ψ(L)〉〈ψ(R)|ψ(R)〉〈ψ(i)|ψ(i)〉

= min|ψ(i)〉

∑Mm=1 αmβm〈ψ(i)|H(m)

i |ψ(i)〉γ〈ψ(i)|ψ(i)〉

= min|ψ(i)〉

〈ψ(i)|∑M

m=1αmβm

γ H(m)i |ψ(i)〉

〈ψ(i)|ψ(i)〉

25

Page 40: Technische Universit at Munc hen - TUM · List of Notations C Complex number (2) Kronecker product operator (2) H Hamiltonian (4) L n 1D lattice with nsites (8) L m n 2D lattice with

where |ψ(L)〉 = |ψ(1) . . . ψ(i−1)〉 and |ψ(R)〉 = |ψ(i+1) . . . ψ(q)〉. Through theprevious manipulation, the original problem is converted into the standardeigenvalue problem

λ(i)min = min

|ψ(i)〉

〈ψ(i)|H(∗)i |ψ(i)〉

〈ψ(i)|ψ(i)〉(3.6)

where H(∗)i =

∑Mm=1

αmβm

γ H(m)i . Keep in mind that there is no need to

build neither huge matrices nor long vectors. For instance, the size of thesquare matrix H(∗)

i is 2 to the power of the number of elements (cardinality)in tensor |ψ(i)〉 index set, making problem (3.6) solvable by any standardeigenvalue algorithm. Additionally, the solution of the standard eigenvalueproblem gives the initial values used along the main procedure.

There is, however, a major caveat to the ALS approach. Although it is agood technique for local optimisation (i.e., solving the minimisation problemone at a time), it lacks of certainty when dealing with global optimisation(i.e., finding the ground state). A useful heuristic to avoid getting stuck inlocal minima consists in the random selection of states as the initial ones.Besides circumventing the locality issue, through the stochastic selection ofthe initial states the hope is to converge faster to the optimal solution.

Another problem of ALS relates to the accuracy of the representation ofthe state |ψ〉. So far it has been assumed the ground state |ψmin〉 is repre-sented by |ψ(1) . . . ψ(q)〉 faithfully, however in practice, this is not the trend.There are families of states that cannot be represented as the Kroneckerproduct between them, they are also known as mixed states and play majorroles in a variety of quantum phenomena, hence their relevance.

To better describe any quantum state, assume a generalised quantumstate

|ψ〉 = |ψ(1) . . . ψ(q)〉+J∑j=1

|φ(1) . . . φ(r)〉 ,

where q, r ≤ p and the parameter J < ∞ determines the precision in therepresentation of the state |ψ〉.

The simplest of such generalisations (e.g., J = 1)

|ψ〉 u |ψ(1) . . . ψ(q)〉+ |φ(1) . . . φ(r)〉 ,

transforms the standard eigenvalue problem (3.6) into its generalised version

26

Page 41: Technische Universit at Munc hen - TUM · List of Notations C Complex number (2) Kronecker product operator (2) H Hamiltonian (4) L n 1D lattice with nsites (8) L m n 2D lattice with

λ(i)min = min

|ψ(i)〉

〈ψ(i)|H(∗)i |ψ(i)〉+ 〈u|ψ(i)〉+ 〈ψ(i)|u〉+ η

〈ψ(i)|ψ(i)〉+ 〈v|ψ(i)〉+ 〈ψ(i)|u〉+ ρ(3.7a)

= min|ψ(i)〉

(〈ψ(i)| 1

)(H(∗)i |u〉〈u| η

)(|ψ(i)〉

1

)(〈ψ(i)| 1

)( I |v〉〈v| ρ

)(|ψ(i)〉

1

) (3.7b)

where

|u〉 = H|φ(1) . . . φ(r)〉η = 〈φ(1) . . . φ(r)|H|φ(1) . . . φ(r)〉|v〉 = 〈ψ(1) . . . ψ(i−1)ψ(i+1) . . . ψ(q)|φ(1) . . . φ(r)〉ρ = 〈φ(1) . . . φ(r)|φ(1) . . . φ(r)〉 .

Note how vector |v〉 is built. It is constructed upon the partial con-traction of two tensor vectors, where vector |ψ(i)〉 is excluded. This uniquefeature is integrated into the proposed contraction scheme and its realisationcomes from the binary index set representation.

With the previous elements in mind, the Tensor Contraction Scheme for2D Problems in Quantum Simulation is ready to act. In the following chap-ter, a number of scenarios will be taken into account to test the strengthsand weaknesses of the contractions, favouring those where the best approx-imations are obtained.

27

Page 42: Technische Universit at Munc hen - TUM · List of Notations C Complex number (2) Kronecker product operator (2) H Hamiltonian (4) L n 1D lattice with nsites (8) L m n 2D lattice with

28

Page 43: Technische Universit at Munc hen - TUM · List of Notations C Complex number (2) Kronecker product operator (2) H Hamiltonian (4) L n 1D lattice with nsites (8) L m n 2D lattice with

Chapter 4

Numerical Experiments

“Mathematics is man’s attempt on understanding nature”

Charles Darwin

4.1 Overview

The objective of the numerical results after simulations is to provide insightsfor the correct understanding of complex phenomena, enabling scientists totest hypothesis and draw conclusions. In the process, a number of conjec-tures has to be proven right, or eventually wrong, to end up with powerfultheorems that generalise the findings carried out along the numerical study.

In the following sections several results argue for the benefits of theproposed method. In section 4.2, the experimental setup and combinationof parameters involved during the quantum simulation is presented. Nextin section 4.3, the results after the execution of the computer programsare summarised graphically. Finally in section 4.4, an analysis on the originand consequences of the errors accounts for the limitations of the contractionschemes.

4.2 Experimental Setup

To verify the properties of the proposed method for ground state calculation,a 12-particle chain of atoms was considered. The chain was affected bya perpendicular magnetic field and only open boundary conditions wereallowed.

The effective Hamiltonian H for the system depicted in Figure 4.1 was a4.096× 4.096 symmetric matrix, with high concentration of non-zero valuesalong the main diagonal and some marginal band-like structures in both theupper and lower triangular areas (see Figure 4.2), making its traditional –full – storage an over demanding and inefficient task.

29

Page 44: Technische Universit at Munc hen - TUM · List of Notations C Complex number (2) Kronecker product operator (2) H Hamiltonian (4) L n 1D lattice with nsites (8) L m n 2D lattice with

0 1 k-1 k k+1 10 11

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Figure 4.1: Setup for numerical experiments. A chain of 12 interactingatoms was affected by an external magnetic field, altering the spin directionand allowing the evolution in time of the entire system.

Figure 4.2: Sparsity pattern of the Hamiltonian H used in numerical ex-periments. The Hamiltonian H for the 12-particle system was a symmetricmatrix that contained 4096 rows and the same number of columns; in total∼ 1.6e7 entries, from which 53248 were non-zero values.

30

Page 45: Technische Universit at Munc hen - TUM · List of Notations C Complex number (2) Kronecker product operator (2) H Hamiltonian (4) L n 1D lattice with nsites (8) L m n 2D lattice with

(a) 6 Tensor blocks

(b) 4 Tensor blocks

(c) 3 Tensor blocks

(d) 2 Tensor blocks

Figure 4.3: Each tensor represents the state of the particles located at thedifferent sites. By grouping them in alternative configurations, variationin the value of the ground state and the common statistics (min, max,average, etc.) was found. The number of blocks determines the size ofthe associated tensors, for instance when considering six blocks, each tensorhave four components; on the other hand, when considering two blocks only,the tensors have 64 components.

Several parameters affected the result directly, among them, number oftensors, index set composition, and number of starting and main iterations.They were investigated to find their contribution in the final result, aimingto optimise their values for future experiments. Firstly, the 12 particleswere grouped into six, four, three, and two sets of tensors (see Figure 4.3) tocompare by which grouping the best solution is achieved in less iterations.To accomplish this task, a sweep from 1 to 30 iterations was performed overthe four groups of tensors.

The second parameter of interest was the index set composition, in par-ticular which indexes belong to which tensor. Take for instance the setupgiven by Figure 4.3d where two tensors are used to calculate the groundstate of the system only. Implicitly, it is assumed the index sets are

ψ{i11,...,i0} = ψ(1){i11,...,i6}ψ

(2){i5,...,i0} ,

however, it is also reasonable to think about non-sequential arrangements1

like

1Non-sequential arrangements are those constituted by non-neighbouring particles.

31

Page 46: Technische Universit at Munc hen - TUM · List of Notations C Complex number (2) Kronecker product operator (2) H Hamiltonian (4) L n 1D lattice with nsites (8) L m n 2D lattice with

ψ{i11,...,i0} = ψ(1){i11,...,i6}ψ

(2){i5,...,i0}

= ψ(1){i11,i9,...,i3,i1}ψ

(2){i10,i8,...,i2,i0}

= ψ(1){i9,i8,i5,i4,i1,i0}ψ

(2){i11,i10,i7,i6,i3,i2}

...

In total there are 66 allowed combinations for this example. In fact,

there exist(nk

)different ways to arrange n indexes by groups of k tensors

with the same number of components. For simplicity, tensors with differentsizes were not considered in the simulations.

Once tested the effect of the number of blocks in the ground state rep-resentation, it was investigated the contribution of the different index setarrangements. In the case of six tensors, for example, four different indexset configurations were evaluated (see Figure 4.4).

Analogously, each of the four different tensors was tested against fourindex set arrangements chosen at random. The idea was to figure out thebest combination among the proposed ones and them compare in the longrun. The index arrangements are summarised in Table 4.1.

32

Page 47: Technische Universit at Munc hen - TUM · List of Notations C Complex number (2) Kronecker product operator (2) H Hamiltonian (4) L n 1D lattice with nsites (8) L m n 2D lattice with

(a) First arrangement (b) Second arrangement

(c) Third arrangement (d) Fourth arrangement

Figure 4.4: Random index set arrangement for six tensors. Each site repre-sents an index element and they are grouped to build 4-component tensors.Note that the fourth arrangement considers periodic boundary conditionsfor the interaction between the index set elements, however, they do notreflect the mutual exchange within the system’s particles necessarily.

33

Page 48: Technische Universit at Munc hen - TUM · List of Notations C Complex number (2) Kronecker product operator (2) H Hamiltonian (4) L n 1D lattice with nsites (8) L m n 2D lattice with

Tab

le4.

1:T

enso

rco

nfigu

rati

ons.

Eac

hse

tco

rres

pond

sto

the

inde

xse

tfo

ra

tens

orin

volv

edal

ong

the

calc

ulat

ion

ofth

egr

ound

stat

e.Fo

rin

stan

ce,

the

tens

or|ψ〉

=|ψ

(1) ψ

(2) 〉

mig

htbe

repr

esen

ted

byth

ein

dex

sets{i

0,...,i

5}

and{i

6,...,i

11}

resp

ecti

vely

,in

othe

rw

ords

,ψ{i

0,...,i

11}

(1){i

0,...,i

5}ψ

(2){i

6,...,i

11}.

Tes

t1

23

4

6T

enso

rs

{i0,i

1}

{i2,i

3}

{i4,i

5}

{i6,i

7}

{i8,i

9}

{i10,i

11}

{i0,i

4}

{i1,i

5}

{i2,i

3}

{i6,i

10}

{i7,i

11}

{i8,i

9}

{i0,i

4}

{i1,i

5}

{i2,i

6}

{i3,i

7}

{i8,i

9}

{i10,i

11}

{i0,i

3}

{i1,i

2}

{i4,i

7}

{i5,i

6}

{i8,i

11}

{i9,i

10}

4T

enso

rs

{i0,i

1,i

2}

{i3,i

4,i

5}

{i6,i

7,i

8}

{i9,i

10,i

11}

{i0,i

4,i

8}

{i1,i

5,i

9}

{i2,i

6,i

10}

{i3,i

7,i

11}

{i0,i

1,i

2}

{i4,i

5,i

6}

{i8,i

9,i

10}

{i3,i

7,i

11}

{i0,i

2,i

3}

{i4,i

6,i

7}

{i8,i

10,i

11}

{i1,i

5,i

9}

3T

enso

rs{i

0,i

1,i

2,i

3}

{i4,i

5,i

6,i

7}

{i8,i

9,i

10,i

11}

{i0,i

1,i

4,i

5}

{i2,i

3,i

6,i

7}

{i8,i

9,i

10,i

11}

{i0,i

1,i

2,i

3}

{i4,i

5,i

8,i

9}

{i6,i

7,i

10,i

11}

{i0,i

3,i

4,i

7}

{i1,i

2,i

5,i

6}

{i8,i

9,i

10,i

11}

2T

enso

rs{i

0,i

1,i

2,i

3,i

4,i

5}

{i6,i

7,i

8,i

9,i

10,i

11}

{i0,i

2,i

4,i

6,i

8,i

10}

{i1,i

3,i

5,i

7,i

9,i

11}

{i0,i

1,i

4,i

5,i

8,i

9}

{i2,i

3,i

6,i

7,i

10,i

11}

{i0,i

3,i

4,i

7,i

8,i

11}

{i1,i

2,i

5,i

6,i

9,i

10}

34

Page 49: Technische Universit at Munc hen - TUM · List of Notations C Complex number (2) Kronecker product operator (2) H Hamiltonian (4) L n 1D lattice with nsites (8) L m n 2D lattice with

Table 4.2: Statistics for six tensors and four arrangements for the indexsets. The best results were obtained for the index set configuration {i0, i1},{i2, i3}, {i4, i5}, {i6, i7}, and {i8, i9}, {i10, i11}.

Arrangement 1 2 3 4Average -14.63 -14.46 -14.52 -14.52Median -14.63 -14.46 -14.53 -14.53Std. Dev. 0.0038 0.0048 0.0133 0.0180Min. -14.63 -14.46 -14.53 -14.53Max. -14.61 -14.43 -14.47 -14.45

Finally, the long run consisted of 100 iterations where the four bestconfigurations were compared. Although a certain number of iteration doesnot provided the solid arguments of an analytical proof, certainly, it settlesa fertile soil to conjecture and to come up with innovative ideas.

4.3 Results

Simulations of the system described in section 4.2 were executed on a per-sonal laptop (see appendix B for further configuration details), the exactsolution was calculated through Matlab’s eigenvalue function. Figure 4.5shows the energy levels (eigenvalue) using four different number of tensors(six, four, three, and, two), each one of them with four different index setarrangements (see Table 4.1 for the entire configuration).

As a general trend, there was a correlation between the number of tensorsand the error in the initial solution, the lesser the number of tensors thecloser the initial guess to the optimal solution. In Tables 4.2, 4.3, 4.4, and4.5 a summary of the main statistics is presented. As expected, the bestresults in terms of the proximity to the optimal value were obtained for thetests with two tensors.

In the long run, after 100 iterations, the best results corresponded tothe combination of two tensors with the index sets {i0, i1, i2, i3, i4, i5}, and{i6, i7, i8, i9, i10, i11}, say

ψ{i11,...,i0} = ψ(1){i0,i1,i2,i3,i4,i5}ψ

(2){i6,i7,i8,i9,i10,i11} ,

which after nine iterations of the ALS method produced -14.90 as the mini-mum eigenvalue. On the other hand, since the exact solution is -14.92, thereis plenty of room for further improvements. Note also, that the contribu-tion of the different index set arrangements was minimal. In fact, no betterresults were obtained by varying the index set constitution.

35

Page 50: Technische Universit at Munc hen - TUM · List of Notations C Complex number (2) Kronecker product operator (2) H Hamiltonian (4) L n 1D lattice with nsites (8) L m n 2D lattice with

(a) Six Tensors (b) Four Tensors

(c) Three Tensors (d) Two Tensors

Figure 4.5: Simulation results considering different blocking and index setarrangements. The lowest horizontal line corresponds to the optimal value.Evidently, all configurations tended to achieve a steady state after few iter-ations, however the best results were due to the use of two tensors.

Table 4.3: Statistics for four tensors and four arrangements for the in-dex sets. The best results were obtained for the index set configuration{i0, i1, i2}, {i3, i4, i5}, {i6, i7, i8}, and {i9, i10, i11}.

Arrangement 1 2 3 4Average -14.69 -14.48 -14.65 -14.55Median -14.69 -14.48 -14.65 -14.57Std. Dev. 0.0022 0.0208 0.0034 0.0279Min. -14.69 -14.48 -14.65 -14.57Max. -14.67 -14.41 -14.63 -14.49

Table 4.4: Statistics for three tensors and four arrangements for the in-dex sets. The best results were obtained for the index set configuration{i0, i1, i2, i3}, {i4, i5, i6, i7}, and {i8, i9, i10, i11}.

Arrangement 1 2 3 4Average -14.77 -14.69 -14.69 -14.66Median -14.77 -14.69 -14.69 -14.66Std. Dev. 0.0076 0.0124 0.0105 0.0082Min. -14.77 -14.69 -14.69 -14.66Max. -14.73 -14.64 -14.65 -14.61

36

Page 51: Technische Universit at Munc hen - TUM · List of Notations C Complex number (2) Kronecker product operator (2) H Hamiltonian (4) L n 1D lattice with nsites (8) L m n 2D lattice with

Table 4.5: Statistics for two tensors and four arrangements for the in-dex sets. The best results were obtained for the index set configuration{i0, i1, i2, i3, i4, i5}, and {i6, i7, i8, i9, i10, i11}.

Arrangement 1 2 3 4Average -14.90 -14.50 -14.63 -13.90Median -14.90 -14.51 -14.63 -13.90Std. Dev. 0.0136 0.0140 0.0144 0.0146Min. -14.90 -14.51 -14.63 -13.91Max. -14.83 -14.44 -14.58 -13.84

Figure 4.6: Energy level after 100 iterations. The long run execution showedthe supremacy of the utilisation of two tensors. On the other hand, the worstresults were due to the usage of six tensors.

Table 4.6: Statistics for ground state calculation using different number oftensors and the best index set configurations. The best results were obtainedfor the index set configuration {i0, i1, i2, i3, i4, i5}, and {i6, i7, i8, i9, i10, i11}.

Blocks 6 4 3 2Average -14.63 -14.69 -14.77 -14.90Median -14.63 -14.69 -14.77 -14.90Std. Dev. 0.0021 0.0012 0.0042 0.0075Min. -14.63 -14.69 -14.77 -14.90Max. -14.61 -14.67 -14.73 -14.83Min. at 38 40 26 9

37

Page 52: Technische Universit at Munc hen - TUM · List of Notations C Complex number (2) Kronecker product operator (2) H Hamiltonian (4) L n 1D lattice with nsites (8) L m n 2D lattice with

4.4 Errors

In Numerical Analysis, error is an implicit ingredient one has to deal within order to follow any numerical recipe for the solution of mathematicalproblems. In a narrower sense, in the ground state calculation using thecontraction scheme there are two major types of numerical errors: roundingand vector representation errors.

Rounding errors are due to the limitation of digital computers in rep-resenting continuous numerical values internally. For example, the infinite-long decimal number 1/3 = 0.3 might be approximated up to certain finitenumber of decimal places, using one of the well-established standard2 waysto perform the round-off. Although present in most of the calculations,rounding errors are disregarded by the automatic cancellation that occursafter the successive occurrence of the themselves [9].

Vector representation errors, on the other hand, play a starring role inthe whole process. They are so critical because, along the minimisationalgorithm, one blindly assumes the ground state can be written faithfully as

|ψ∗〉 = |ψ(1) . . . ψ(q)〉+ |φ(1) . . . φ(r)〉 ,

however, the opposite is truth. Ground states are rarely that simple, usu-ally quantum simulation involves more elaborated states that hardly can bereproduced by two addends. In the ideal case, it would be wonderful tohave more terms in the summation that accounts for the final ground state,nonetheless they come at a price and the researcher must be aware of thecompromise between the efficiency of the overall procedure and accuracy ofthe solution.

Once identified the causes of the errors, it is time to evaluate their effectin the final solution calculation. Althought there is no easy way to know inadvance the minimum eigenvalue for an arbitrary large Hamiltonian, it isfeasible to calculate the ratio between the maximum and minimum eigenval-ues for small systems and to conjecture about its asymptotical behaviour.This ratio is also known as the condition number κ (A), defined by

κ (A) :=∣∣∣∣λmax (A)λmin (A)

∣∣∣∣ , (4.1)

where λmax(A) and λmin(A) are the maximal and minimal eigenvalues of A.The condition number determines how well-posed problem (2.6) really is,

in other words the condition number is a good indicator on how drasticallychange the solution, after slight variations on the problem definition or initialconditions.

2The standard ways to perform the round-off includes: truncation, round up, rounddown, round to −∞, and round to +∞.

38

Page 53: Technische Universit at Munc hen - TUM · List of Notations C Complex number (2) Kronecker product operator (2) H Hamiltonian (4) L n 1D lattice with nsites (8) L m n 2D lattice with

Table 4.7: Evaluation of the condition number κ (A) for selected Hamilto-nians. In these particular examples, They are specified by the number ofparticles that constitute the system of interest, ranging from 6 to 11. Notethe increasing value of the condition number for larger systems, nonetheless,there is an anomaly around its value for a 10-particle system.

Particles 6 7 8 9 10 11κ (A) 114.49 383.46 407.48 803.45 535.62 2.86e3

In Table 4.7 the condition number for selected Hamiltonian is presented.Note the correlation between the number of particles and the conditionnumber itself, the larger the number of particles, the greater the κ (A). Thisis truth for most of the given examples, however, for a 10-particle systemthe value of the ratio is smaller than expected, adding more elements to theconjecture about their relationship. Nonetheless, the values in Table 4.7 arebig enough to safely state that the calculation of the minimum eigenvaluein quantum simulation is an ill-posed problem, hence the variations of thefinal solution after slight modification of the initial conditions.

39

Page 54: Technische Universit at Munc hen - TUM · List of Notations C Complex number (2) Kronecker product operator (2) H Hamiltonian (4) L n 1D lattice with nsites (8) L m n 2D lattice with

40

Page 55: Technische Universit at Munc hen - TUM · List of Notations C Complex number (2) Kronecker product operator (2) H Hamiltonian (4) L n 1D lattice with nsites (8) L m n 2D lattice with

Chapter 5

Conclusions and Outlook

“1050 is a long way from infinity.”

Daniel Shanks

5.1 Overview

Quantum simulation’s final goal is to understand nature at its most fun-damental scale, broadening the spectrum of applications and increasing thecontrol level that, eventually, will lead to unheard scientific developments forthe benefits of humankind. To start the quantum revolution, it is imperativeto provide better tools for the study of the natural phenomena at atomicscale, without sacrificing accuracy and within reasonable time windows.

In the last chapter, several insights product of the quantum simulationsare highlighted. In section 5.2, the major conclusions of the study are pre-sented. Finally in section 5.3, important recommendations for future workare described, establishing the staring point for upcoming improvementsthat can be applied to the contraction schemes.

5.2 Conclusions

In section 1.4 were introduced three challenges that the numerical schemeused in quantum simulation must beat to solve the associated minimisationproblem (1.1) efficiently. In the following paragraphs, they are going to berevisited one by one, evaluating their successful accomplishment.

The first challenge implied the representation of long vectors withoutstoring them explicitly. To solve this issue, it was necessary a two-step pro-cedure. Firstly, the original (unknown) vector was written as the Kroneckerproduct of smaller tensors. Secondly, their components were calculated on-the-fly by using the binary index representation of the smaller tensors. Toadd more accuracy, not only the Kronecker product of tensors but the linear

41

Page 56: Technische Universit at Munc hen - TUM · List of Notations C Complex number (2) Kronecker product operator (2) H Hamiltonian (4) L n 1D lattice with nsites (8) L m n 2D lattice with

combination of them were used in the vector representation, allowing betterapproximations with modest storage requirements.

The second challenge had to do with the calculation of inner productsbased on the tensor product representation. The scalar product is a majorstep within the minimisation process therefore it is vital to figure out anefficient algorithm for its calculation. The contraction scheme made possibleto compute exact inner product between arbitrary long vectors written incompact form – linear combination of Kronecker products –, without addingextra overheat to the general procedure.

The third challenge claimed for the Rayleigh quotient minimisation, tak-ing into account the given vector representation and the storage constraintsthat prohibits the explicit formulation of the problem. The solution to theoptimisation conundrum came from the well-known ALS technique, whichturned out to produce close-to-the-optimal solutions for even small numberof iterations. Additionally, data showed that for larger tensors the initialsolution was closer to the optimal.

Briefly speaking, the main achievement accomplished in the present workwas the approximation of the minimum eigenvalue by the combination oftwo well-known techniques – binary index representation and ALS –, whichunder other circumstances (i.e., explicit formulation) is not tractable. Also,it was shown numerically that best approximation was achieved after fewiterations and the variation in the index set representation did not improvethe results of the scheme.

5.3 Further Improvements

Happily this is not the end, but only a transition. There is plenty of room forfurther improvements that might lead to broader application areas withinthe realm of quantum simulation or even finding better solutions. For in-stance, ALS method should be applied to Hamiltonians given by other quan-tum models (i.e., Heisenberg model, Hubbard model, etc.) to figure outpossible numerical instability. In the same manner, ALS might encounterlocal minima along the iterative minimisation process. To solve the localityproblem, it might be advantageous to apply simultaneous optimisation thateventually can be executed in parallel, hoping shorter execution time andbetter solutions.

Another open issue relates to the use of heterogeneous tensor, or tensorswith different sizes. It might the case that according to the specific quantummodel, the solution given by heterogeneous tensors would be better than theobserved in the homogeneous counterpart.

42

Page 57: Technische Universit at Munc hen - TUM · List of Notations C Complex number (2) Kronecker product operator (2) H Hamiltonian (4) L n 1D lattice with nsites (8) L m n 2D lattice with

Appendix A

Computer Program

“I have not failed. I’ve just found 10,000 ways that won’t work”

Thomas Edison

A.1 Function Specification

The Matlab’s functions described in Table A.1 were specifically developedto implement the Tensor Contraction Schemes for 2D Problems in QuantumSimulation. Further documentation is embedded within the source code, itincludes specification on the input and output parameters and developer’snotes on the codification itself. Additionally, each function file contains ashort example that shows how to use it within Matlab’s console.

A.2 Code Example

Users can take advantage of the scripts developed to simulate Ising-likesystems with large number of particles. There are three simple steps neededto run the simulation:

1. Initialisation: defines of number of particles, Hamiltonian, alpha pa-rameters and tensor composition. It is important that the number ofparticles match the number of items in the construction of the tensorblocks.

2. Initial Guess: calculates the initial solution based on the tensor struc-ture by solving the standard eigenvalue problem (3.6). It was seenexperimentally that the larger the blocks, the closer to the optimalsolution.

3. Minimisation: executes the minimisation of the Rayleigh quotient viaALS, using the generalised version of the eigenvalue problem (3.7).

43

Page 58: Technische Universit at Munc hen - TUM · List of Notations C Complex number (2) Kronecker product operator (2) H Hamiltonian (4) L n 1D lattice with nsites (8) L m n 2D lattice with

Table A.1: Description of the functions developed to implement the TensorContraction Schemes for 2D Problems in Quantum Simulation. Furtherdetails and example of application are provided within the code.

Function Descriptionbuild operator returns one row of the Hamiltoniancompute matten returns the matrix-tensor productconj tensor returns the complex conjugate of a tensorcontract block returns the contraction indexes over two blockscopy except returns a copy of a tensor without a blockdot tensor returns the inner product between two vectorsindex gen returns a list of decimal valuesinit guess calculates the starting solutionmakefis makes the full index set of a tensormake hamiltonian returns the effective Hamiltonianmap hamiltonian returns an Ising-like Hamiltonian cell arrayminals minimises a tensor using ALSmineig returns the minimum eigenvalue and eigenvectornumblocks returns the number of blocks in a tensorshift gen returns a scalar contribution of the index setsimpletest simple test examplesum tensor returns the sum of two equal-index tensorssymmdiff returns the symmetric difference between the setstensor returns a tensor objecttest simulates of a 12-particle system

44

Page 59: Technische Universit at Munc hen - TUM · List of Notations C Complex number (2) Kronecker product operator (2) H Hamiltonian (4) L n 1D lattice with nsites (8) L m n 2D lattice with

The result (minimum eigenvalue) after each iteration is returned, andtaking as starting point for the next one.

The following simple test shows the minimum code to simulate a 4-particle system along 10 iterations. There are three equally sized tensors,each of them contains four indices. Remember that the output correspondsto the minimum eigenvalue obtained every iteration. For a more elaboratedscript, including graphical comparison of the tests, please refer to the filetest.m.

%%%%%%%%%%%%%%%%%%% I n i t i a l i s a t i o n %%%%%%%%%%%%%%%%%%%p = 4 ; % Number o f p a r t i c l e ss i t e r = 10 ; % I t e r a t i o n s s t a r t i n g s o l u t i o nmiter = 10 ; % I t e r a t i o n s main procedure

Hmap = map hamiltonian (p ) ; % Hamiltonian d e f i n i t i o nM = s ize (Hmap, 1 ) ; % Number o f boundsalpha = ones (1 , M) ; % Alpha parameter

ten x (1 ) = tenso r ( [ 0 1 ] ) ;t en x (2 ) = tenso r ( [ 2 3 ] ) ;

%%%%%%%%%%%%%%%%% I n i t a l Guess %%%%%%%%%%%%%%%%%ten x0 = i n i t g u e s s (Hmap, ten x , alpha , s i t e r ) ;

%%%%%%%%%%%%%%%%% Minimisation %%%%%%%%%%%%%%%%%z = minals (Hmap, ten x0 , alpha , miter ) ;disp ( z ) ;

A.3 Licence

The Scripts for Tensor Contraction Schemes for 2D Problems in QuantumSimulation are free software: you can redistribute it and/or modify it underthe terms of the GNU General Public License as published by the FreeSoftware Foundation, either version 3 of the License, or any later version.

45

Page 60: Technische Universit at Munc hen - TUM · List of Notations C Complex number (2) Kronecker product operator (2) H Hamiltonian (4) L n 1D lattice with nsites (8) L m n 2D lattice with

The Scripts for Tensor Contraction Schemes for 2D Problems in Quan-tum Simulation are distributed in the hope that it will be useful, but WITH-OUT ANY WARRANTY; without even the implied warranty of MER-CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See theGNU General Public License for more details.

You should have received a copy of the GNU General Public Licensealong with the Scripts for Tensor Contraction Schemes for 2D Problems inQuantum Simulation. If not, see http://www.gnu.org/licenses/.

46

Page 61: Technische Universit at Munc hen - TUM · List of Notations C Complex number (2) Kronecker product operator (2) H Hamiltonian (4) L n 1D lattice with nsites (8) L m n 2D lattice with

Appendix B

Configuration Management

“Not everything that can be counted counts, and not everythingthat counts can be counted”

Albert Einstein

B.1 Overview

Far from being an exhaustive hardware and software configuration manage-ment, this chapter is intended to provide a minimal guideline that ensuresthe reproducibility of the results obtained in the present work. In sectionB.2, the characteristics of the hardware are presented. Finally in section B.3,the version of the applications, operating system, and the profiling optionsare described.

B.2 Hardware Configuration

Although hardware tends to be a limiting factor in scientific computing,in particular when massive amounts of data are processed, in the presentnumerical experiments only commercial off-the-shelf hardware was involved.Table B.1 sums up the configuration of hardware used for the contractionschemes.

B.3 Software Configuration

It is important to keep the record of the software used along the simulationsto be able to reproduce the results in other machines. Table B.2 shows theversion of the numerical software and the operating system.

Although software per se can make the difference, there are other op-timisation heuristics that might be applied in the implementation of the

47

Page 62: Technische Universit at Munc hen - TUM · List of Notations C Complex number (2) Kronecker product operator (2) H Hamiltonian (4) L n 1D lattice with nsites (8) L m n 2D lattice with

Table B.1: Technical specification of the Hardware used in the numerical ex-periments. The configuration of the equipment corresponds to a commercialoff-the-shelf laptop, any user trying to replicate the results is encouraged touse her own personal computer.

Device SpecificationCPU Intel Core 2 Duo T5800RAM 4 GBHD 320 GBGPU ATI Redeon HD 3470

Table B.2: Version of the software used in the numerical experiments.

Application VersionOperating System MS Windows Vista HomeMatlab R2007a

algorithm. In the following paragraphs several optimisation hints, includingthe way to test the code’s efficiency, are discussed.

B.3.1 Code Optimization

In addition to the numerical methods applied for the efficient simulation ofquantum systems, there are a number of tricks that might be incorporatedwithin the code to produce faster simulations. Albeit no rule of thumb isknown to speedup certain code, the following approaches have been takeninto account during the development phase, aiming to improve the overallperformance.

Array preallocation: before entering to loops, arrays are explicitly de-clared, indicating the number of elements that will be stored. It willtell the compiler how big the data structure is and look for consecutivespaces in memory to save the data, making its retrieval faster.

Vectorisation: instead of using for loops to operate over the array’s com-ponents, it is preferred to use functions that act on the entire arrays.A classical example is the usage of the function sum to add up theelements, in contrast to the utilisation of a loop to traverse the arrayelement-wise.

Referencing wildcards: enable programmers to access multiple elementsin arrays without invoking them directly, for instance, the colon op-erator : selects ranges of array elements faster than referencing themindividually.

48

Page 63: Technische Universit at Munc hen - TUM · List of Notations C Complex number (2) Kronecker product operator (2) H Hamiltonian (4) L n 1D lattice with nsites (8) L m n 2D lattice with

Figure B.1: Profiling sample output for Matlab’s scripts. In the top of thetable the functions with higher requirements of time. Self time correspondsto the time spent by the function itself, without considering the time usedby their child functions.

Other options: there are tons of specific language-oriented shortcuts, whichapplied properly not only reduce the execution time but optimise thestorage resources. Among them, efficient ways to obtain the number ofelements in arrays, find the minimum of a matrix, convert arrays into acolumn vectors, or even include optimised code from other languages.

Finding the best tuning for the code is a demanding task and dependson the specific problem to solve. It might be the case that the optimisa-tion parameters found for a given quantum system do not hold for anotherfamily of problems, therefore tuning process must be restarted and appliedcontinuously. Truly, this is a never ending task.

B.3.2 Profiling

Profiling is a diagnostic tool that helps developers to find out possible bottle-necks in the code. Matlab’s profiling tools reports on the number of calls,total time, and self time for functions; in Figure B.1 a sample of its outputis presented. First column indicates the name of the function analysed, itmight include not only developer’s but built-in functions that eventually arecalled in the scripts. Second and third columns show the number of calls andthe total time spent by the function respectively. Fourth column reports onthe time spent in the functions without the time spent in their child func-tions. It also includes overhead resulting from the process of profiling.

Profiling optimisation involve three steps. Firstly, the scripts are exe-cuted under the surveillance of the profiling tool. Secondly, the files withhigher inner times are identified and optimised, focusing on the hints given

49

Page 64: Technische Universit at Munc hen - TUM · List of Notations C Complex number (2) Kronecker product operator (2) H Hamiltonian (4) L n 1D lattice with nsites (8) L m n 2D lattice with

previously. Finally, the profiling tool is examined again until no further im-provements in the code are possible. Any code is susceptible to be optimisedas much as the developer wishes, however, there is a compromise betweenthe time spent in the code and the real gain. It is up to the researcher toevaluate the resource investment for the optimisation of the code.

50

Page 65: Technische Universit at Munc hen - TUM · List of Notations C Complex number (2) Kronecker product operator (2) H Hamiltonian (4) L n 1D lattice with nsites (8) L m n 2D lattice with

Bibliography

[1] A. Albuquerque, F. Alet, P. Corboz, P. Dayal, A. Feiguin, S. Fuchs,L. Gamper, E. Gull, S. Gurtler, and A. Honecker. The alps project re-lease 1.3: Open-source software for strongly correlated systems. Journalof Magnetism and Magnetic Materials, 310(2):1187–1193, March 2007.

[2] G. Alvarez. The density matrix renormalization group for strongly cor-related electron systems: A generic implementation. Computer PhysicsCommunications, 180(9):1572 – 1578, 2009.

[3] Neil Ashby. Relativity and the global positioning system. PhysicsToday, 55(5):41–47, 2002.

[4] Barry A. Cipra. An introduction to the ising model. Am. Math.Monthly, 94(10):937–959, 1987.

[5] Rene Dugas. A History of Mechanics (Dover Classics of Science andMathematics). Dover Publications, June 1988.

[6] A. Einstein. Uber das relativitatsprinzip und die aus demselben gezoge-nen folgerungen. Jahrbuch der Radioaktivitat und Elektronik, 4:411–462,1908.

[7] R. Fazio, S. Montangero, G. De Chiara, D. Rossini, M. Rizzi, andD. Bleh. Parallel open well-adapting dmrg enhanced research withpower. On-line. http://www.qti.sns.it.

[8] W. M. C. Foulkes, L. Mitas, R. J. Needs, and G. Rajagopal. Quantummonte carlo simulations of solids. Reviews of Modern Physics, 73(1):33–83, Jan 2001.

[9] David Goldberg. What every computer scientist should know aboutfloating-point arithmetic. ACM Comput. Surv., 23(1):5–48, March1991.

[10] Werner Heisenberg. The Physical Principles of the Quantum Theory.Dover Publications, March 2003.

51

Page 66: Technische Universit at Munc hen - TUM · List of Notations C Complex number (2) Kronecker product operator (2) H Hamiltonian (4) L n 1D lattice with nsites (8) L m n 2D lattice with

[11] Thomas Huckle and Konrad Waldherr. Unifying large-scale tensorapproximations—concepts and algorithms, 2010. in progress.

[12] Joel E. Moore. The birth of topological insulators. Nature,464(7286):194–198, March 2010.

[13] Michael A. Nielsen and Isaac L. Chuang. Quantum Computation andQuantum Information. Cambridge University Press, 1 edition, October2000.

[14] Frank W. J. Olver, Daniel W. Lozier, Ronald F. Boisvert, andCharles W. Clark, editors. NIST Handbook of Mathematical Functions.Cambridge University Press, 1 har/cdr edition, May 2010.

[15] U. Schollwock. The density-matrix renormalization group. Rev. Mod.Phys., 77(1):259–315, Apr 2005.

[16] C. H. Tseng, S. Somaroo, Y. Sharf, E. Knill, R. Laflamme, T. F. Havel,and D. G. Cory. Quantum simulation of a three-body-interaction hamil-tonian on an nmr quantum computer. Phys. Rev. A, 61(1):012302, Dec1999.

[17] F. Verstraete and J. I. Cirac. Renormalization algorithms for quantum-many body systems in two and higher dimensions, 2004.

[18] F. Verstraete, D. Porras, and J. I. Cirac. Density matrix renormaliza-tion group and periodic boundary conditions: A quantum informationperspective. Physical Review Letters, 93(22):227205+, Nov 2004.

[19] Steven R. White. Density matrix formulation for quantum renormal-ization groups. Phys. Rev. Lett., 69(19):2863–2866, Nov 1992.

[20] Wikipedia. Bloch sphere — wikipedia, the free encyclopedia, 2010.[Online; accessed 18-August-2010].

[21] Wikipedia. Introduction to general relativity — wikipedia, the freeencyclopedia, 2010. [Online; accessed 28-June-2010].

52

Page 67: Technische Universit at Munc hen - TUM · List of Notations C Complex number (2) Kronecker product operator (2) H Hamiltonian (4) L n 1D lattice with nsites (8) L m n 2D lattice with

Index

ALS, 25Array Preallocation, 48

Bloch Sphere, 9Bra-Ket Notation, 2

Characteristic Polynomial, 12Condition Number, 38Contraction

Full, 23Partial, 23Scheme, 23

Dimensionality Course, 14Dirac Notation, 2Divide and Conquer, 17DMRG, 17

Eigenvalue ProblemGeneralised, 25Standard, 25

ErrorRounding, 38Vector Representation, 38

Exact Diagonalisation, 12

Ferromagnetism, 11Function

sinc, 14

Gaussian Elimination, 12

Hamiltonian, 4

IndexArrangement, 29Contraction, 23Set, 19

Summation, 23Ising Model, 11

Lattice, 8Least Squares, 25

MatrixHermitian, 9Normal, 38Pauli, 9Unitary, 9

MC, 14Monte Carlo Methods, 14

Open Boundary Conditions, 8Optimisation

Global, 25Local, 25

Periodic Boundary Conditions, 8Phase Transition, 9Profiling, 49

QMC, 14Quantum

Dynamics, 7Mechanics, 1Monte Carlo, 14Simulation, 1Superposition, 1

Rayleigh Quotient, 24Referencing Wildcards, 48

Sampling, 14Self Time, 48Spin, 9State

53

Page 68: Technische Universit at Munc hen - TUM · List of Notations C Complex number (2) Kronecker product operator (2) H Hamiltonian (4) L n 1D lattice with nsites (8) L m n 2D lattice with

Degenerate, 3Ground, 3Mixed, 25Pure, 9Quantum, 2

Statistical Physics, 7

Uncertainty Principle, 1

Vectorisation, 48

54