Page 1

An approximate diagonalization method for large scale Hamiltonians

Mohammad H. Amin,1,2Anatoly Yu. Smirnov,1Neil G. Dickson,1and Marshall Drew-Brook1

1D-Wave Systems Inc., 100-4401 Still Creek Drive, Burnaby, British Columbia, Canada V5C 6G9

2Department of Physics, Simon Fraser University, Burnaby, British Columbia, Canada V5A 1S6

An approximate diagonalization method is proposed that combines exact diagonalization and

perturbation expansion to calculate low energy eigenvalues and eigenfunctions of a Hamiltonian.

The method involves deriving an effective Hamiltonian for each eigenvalue to be calculated, using

perturbation expansion, and extracting the eigenvalue from the diagonalization of the effective

Hamiltonian. The size of the effective Hamiltonian can be significantly smaller than that of the

original Hamiltonian, hence the diagonalization can be done much faster. We compare the results of

our method with those obtained using exact diagonalization and quantum Monte Carlo calculation

for random problem instances with up to 128 qubits.

I.INTRODUCTION

Diagonalization of large Hermitian matrices is a diffi-

cult problem in linear algebra, with applications in a va-

riety of disciplines. In quantum mechanics, for example,

the energy levels of a quantum system are obtained by

diagonalization of the system’s Hamiltonian. Knowing

those energy levels is necessary for describing the behav-

ior of the quantum system, e.g., the evolution of a quan-

tum computer consisting of N quantum bits (qubits).

Calculating the exact energy spectrum of a Hamiltonian

with usual numerical computation methods is possible

only for up to N ≈ 20 qubits. For larger systems, the

size of the Hilbert space (2N) becomes too large for the

current level of available computer memory and speed.

Although it is extremely difficult to calculate the exact

spectrum of a multi-qubit system for large N, there are

ways to calculate an approximate spectrum that shows

important features of the exact spectrum reliably over

a range of parameters. These methods include Density

Matrix Renormalization [1–4], Lanczos [5], and Quantum

Monte Carlo calculations [6–9]. Perturbation theory is

also an approximate method, that is applicable when the

system’s Hamiltonian is close to a simpler Hamiltonian,

called the unperturbed Hamiltonian, for which the eigen-

values and eigenfunctions are known or easy to calculate.

For example, the unperturbed Hamiltonian can be diag-

onal in some known basis and the perturbation Hamilto-

nian can have small off diagonal elements in such a basis.

One can perform perturbation expansion in powers of a

small parameter, characterizing the off-diagonal terms of

the Hamiltonian, to find approximate solutions for the

eigenvalues and eigenfunctions of the total Hamiltonian.

A true perturbation expansion provides a Taylor ex-

pansion of the energy levels in powers of a small param-

eter.However, such expansion can become extremely

complicated when there are energy level degeneracies in

the spectrum of the unperturbed Hamiltonian. More-

over, the perturbation expansion can quickly break down

if the energy separations of the unperturbed states are

small or when there are anticrossings between the eigen-

states in the spectrum. Here, we combine perturba-

tion expansion with exact diagonalization techniques to

achieve an effective method for approximate diagonaliza-

tion. The idea is to separate a subspace, e.g., low en-

ergy states of the unperturbed Hamiltonian, from other

(high energy) states in the Hilbert space. If the unper-

turbed Hamiltonian is diagonal, then it might be easy

to find its lowest energy states using the structure of

the problem. Starting from the original Hamiltonian,

we derive an effective Hamiltonian in the subspace using

perturbation expansion. Perturbation theory brings into

consideration, in the expansion of each term of the ef-

fective Hamiltonian, the relevant states that are outside

the subspace. If the unperturbed states in the subspace

are non-degenerate, then there won’t be a unique effec-

tive Hamiltonian that can provide perturbed eigenvalues

after the diagonalization. Instead, there will be an effec-

tive Hamiltonian for each non-degenerate unperturbed

state. Since the calculation involves exact diagonaliza-

tion of these effective Hamiltonians, the final results are

not true Taylor expansions in powers of the small param-

eter, as in usual perturbation expansion. Yet, perturba-

tion plays an important role in the derivation of these

effective Hamiltonians.

II. THE FORMALISM

To derive the effective Hamiltonians, we adopt the pro-

jection operator approach to perturbation theory as dis-

cussed by Yao and Shi [10]. Consider the Hamiltonian

H = H0+ V , in which H0is the unperturbed Hamilto-

nian and V is the perturbation Hamiltonian. The aim of

the perturbation theory is to find the eigenvalues Enand

eigenvectors |n? of H, with

(H0+ V )|n? = En|n?,

assuming that the eigenvalues E(0)

|n(0)? of H0are known.

Consider subspace S in the Hilbert space of H0, con-

sisting of NSvectors |k(0)?. The subspace S can include

both degenerate and non-degenerate eigenstates of H0.

We introduce projection operators

?

(1)

n

and eigenvectors

P =

k∈S

|k(0)??k(0)|,

¯P = 1 − P.(2)

arXiv:1202.2817v1 [quant-ph] 13 Feb 2012

Page 2

2

Since H0, P, and¯P are diagonal in |k(0)? basis, we have

[P,H0] = [¯P,H0] = 0, (3)

Let |k? denote an eigenstate of H that we are trying to

calculate. We write |k? = |k?P+|k?¯ P, where |k?P≡ P|k?

and |k?¯ P≡¯P|k?. We multiply both sides of (1), written

for the eigenstate |k?, by P and¯P, respectively, to get

E(0)

k|k?P+ PV (|k?P+ |k?¯ P) = Ek|k?P,

H0|k?¯ P+¯PV (|k?P+ |k?¯ P) = Ek|k?¯ P,(4)

which can be rewritten as

(Ek− E(0)

(Ek− H0−¯PV¯P)|k?¯ P=¯PV P|k?P.

Here, we have used P2= P and¯P2=¯P. Solving the

second equation for |k?¯ P, we get

|k?¯ P= (Ek− H0−¯PV¯P)−1¯PV P|k?P

k

− PV P)|k?P= PV¯P|k?¯ P,

(5)

(6)

Substituting (6) into the first equation in (5), we find

? H(k)|k?P= Ek|k?P, (7)

where? H is an NS×NSmatrix defined by

? H(k) ≡ E(0)

with I being the NS×NSunity matrix.

So far, Eq. (7) is exact. What it means is that Ekis

an eigenvalue and |k?P is an eigenvector of? H(k) in S.

Ekand |k?P, but no information about other eigenvalues

of H is obtained. Notice that Ekappears in both (8) and

(7), therefore it has to be calculated self-consistently. As

we shall see, perturbation theory can help to calculate

Ek, order by order.

If? H is independent of k, then all the perturbed eigen-

agonalization. For a k-dependent? H, on the other hand,

ing, while all other eigenvalues do not correspond to the

correct eigenenergies of the spectrum of H. In that case,

to calculate each Ek, one has to calculate its correspond-

ing? H(k), diagonalize it, and select the right eigenvalue

this way will not be orthogonal to each other. This indeed

should be the case because only the original eigenstates

|k? in the full Hilbert space are supposed to be orthog-

onal to each other, hence the projected states |k?P may

not be orthogonal.

As mentioned earlier,? H(k) is a function of Ek, which

kI + PV P

+ PV¯P(Ek− H0−¯PV¯P)−1¯PV P,(8)

Therefore, formally by diagonalizing? H(k), one can find

values and eigenvectors in S can be found in a single di-

only one of the eigenvalues, i.e., Ek, has physical mean-

that corresponds to Ek. Note that the states |k?P found

itself has to be calculated via diagonalization of? H(k).

The calculation becomes tractable using perturbation ex-

pansion. Consider the expansion

(Ek− H0−¯PV¯P)−1= (E(0)

∞

?

where, δEk= Ek− E(0)

? H(k) ≡ E(0)

j=0

k

− H0−¯PV¯P + δEk)−1

?j

=

j=0

?

(E(0)

k−H0)−1(¯PV¯P−δEk)

(E(0)

k−H0)−1,

k. Substituting into (8), we get

kI + PV P + PV¯P ×

(9)

∞

?

?

(E(0)

k−H0)−1(¯PV¯P−δEk)

?j

(E(0)

k−H0)−1¯PV P.

Writing δEk= E(1)

denote the order of perturbation, one can calculate? H

operator¯P(E(0)

k

− H0)−1¯P is not singular and is given

by

k

+ E(2)

k

+ ..., where the superscripts

order by order. Because of the projection operator¯P, the

¯P(E(0)

k

− H0)−1¯P =

?

n/ ∈S

|n(0)??n(0)|

E(0)

k

− E(0)

n

.(10)

We now derive analytical formulas for all the elements

of? H(k) up to the forth order perturbation. Defining

perturbed states in S, and assuming that V has only

off-diagonal elements in the chosen basis so that E(1)

?k(0)|V |k(0)? = 0, we find

? H(0)

? H(2)

? H(3)

? H(4)

where, E(0)

n

and

Vαβ≡?α(0)|V |β(0)?, where |α(0)? and |β(0)? denote un-

k

=

αβ(k) = E(0)

? H(1)

kδαβ,

αβ(k) = Vαβ,

αβ(k) =

?

?

?

n/ ∈S

VαnVnβ

E(0)

kn

VαnVnmVmβ

E(0)

, (11)

αβ(k) =

n,m/ ∈S

knE(0)

VαnVnmVmpVpβ

E(0)

km

,

αβ(k) =

n,m,p/ ∈S

knE(0)

kmE(0)

kp

− E(2)

k

?

n/ ∈S

VαnVnβ

[E(0)

kn]2,

kn=E(0)

k−E(0)

E(2)

k

=? H(2)

kk(k) =

?

n/ ∈S

VknVnk

E(0)

kn

.(12)

Notice that for each added order of perturbation, a factor

of the form Vnm/E(0)

The small parameter of the expansion, therefore, should

be k-dependent and have the form:

kmis added to the expansion terms.

λk∼ min

n,m/ ∈S[Vnm/E(0)

km]. (13)

In our numerical calculations, we found the best agree-

ment with exact diagonalization when expanding the di-

agonal elements to the forth order of perturbation, but

Page 3

3

the off-diagonal elements to the second order.

can be understood if one considers only two levels, i.e.,

NS= 2. By diagonalizing the 2×2 reduced Hamiltonian

corresponding to the two levels, if the diagonal elements

are not the same, a second order off-diagonal element

contributes a forth order term to the final eigenvalues, as

it gets squared. Therefore to be consistent in the order of

perturbation, one should expand the off-diagonal terms

to the second order.

Notice that all the energy differences in the denomi-

nators are of the form E(0)

kmand therefore depend on the

unperturbed energy E(0)

k

of state |k(0)?. As a result the

calculated? H is k dependent, unless all the states in S

rection will still have k-dependence through the second

term in the last equation of (11)). As we mentioned be-

fore, one cannot obtain all eigenstates by a single diag-

onalization of? H(k). Instead, one has to calculate? H(k)

task then is to select, among all the eigenvalues of? H(k),

the perturbation of |k(0)?. If the perturbed levels do not

cross each other, then Ekwill be the k-th eigenvalue after

the diagonalization. In cases when the perturbed states

do cross each other, the situation becomes more compli-

cated. One can use the overlap of the new eigenfunctions

with the old ones to identify which two correspond to

each other.

The accuracy of the calculations depends on the small

parameter of the perturbation expansion, λk. To have

an estimate of λk using (13), let Emin represent the

lowest energy level outside the subspace S, therefore

|Ekm|m/ ∈S≥ Emin−E(0)

for the small parameter: λk≤ max(Vnm)/(Emin−E(0)

Perturbation expansion, thus becomes more accurate for

the lowest energy states for which E(0)

the accuracy of the calculations increases by increasing

Emin, i.e., increasing NS. In principle, there is no limit to

the accuracy and therefore no fixed radius of convergence

as in the usual perturbation theory. By taking NS→ N,

one can achieve 100% accuracy and an unlimited radius

of convergence. In practice, however, NSis limited by the

limitation of the computation time and available mem-

ory. By keeping NS small, the diagonalization can be

done very quickly, but at the price of less accurate re-

sults. Quite naturally, for NS< N, small features of the

spectrum that depend on the contribution of the higher

energy states, beyond S and the states included pertur-

batively, cannot be reproduced.

This

are degenerate (even in that case, the forth order cor-

for each unperturbed eigenstate |k(0)?. The important

the right eigenvalue Ekthat corresponds to state |k?, i.e.,

k. This provides an upper bound

k).

k

is smallest. Also,

III.COMPARISON WITH EXACT

DIAGONALIZATION AND QUANTUM

MONTE-CARLO SIMULATION

To test our approximate diagonalization method, we

study several Hamiltonians with different sizes and com-

0 0.2 0.4 0.60.81

0

1

2

3

4

5

6

7

8

s

Energies (GHz)

ε

∆

FIG. 1: Hamiltonian parameters ∆ and E as a function of

normalized time s.

pare our results with those of the exact diagonalization

and quantum Monte Carlo simulation. The Hamiltonian

we consider is an Ising Hamiltonian in a transverse field

of the form

?

HP =

i

H(s) = −1

2∆(s)

?

i

σx

i+1

2E(s)HP, (14)

hiσz

i+

?

i<j

Jijσz

iσz

j, (15)

where, s ∈ [0,1], hi and Jij are dimensionless param-

eters that can be adjusted, and ∆(s) and E(s) are en-

ergy scales plotted in Fig. 1. Hamiltonian (14) was stud-

ied in Ref. 14 to investigate the scaling performance of

an adiabatic quantum computation (AQC) [11] proces-

sor based on realistic Hamiltonian parameters. In that

case, s = t/tf represents normalized time, where tf is

the total evolution time. It is known [11] that in AQC,

the minimum energy gap between the lowest two energy

levels during the evolution determines the time of the

computation. Therefore it is important to diagonalize

the Hamiltonian (14) to calculate the minimum energy

gap. Details of the AQC processor considered in this

study are described in other publications [12, 13]. Here,

we only focus on the diagonalization of the Hamiltonians.

In Ref. 14, a number of random Ising instances were

generated and the size of the minimum gap in the spec-

trum of their Hamiltonians was calculated using QMC

simulation. With QMC simulation, one can calculate

the energy gap between the lowest two energy levels us-

ing the method discussed in [9, 14]. The instances used in

Ref. 14 were generated by choosing hiuniform randomly

from the set {-1/3,1/3} and a structured set of nonzero

Jij values to be either -1, or uniform randomly from {-

1/3,1/3}. The connectivity of the graph considered was

motivated by a realistic quantum annealing processor as

described in [13, 14]. Here, we use the same set of prob-

lems and compare our results with the QMC results of

Ref. 14.

First, we need to find the unperturbed eigenstates and

eigenvalues of Hpfor the instances studied. Since Hpis

Page 4

4

0.4 0.50.60.7 0.80.91

0

2

4

6

8

s

E−E0 (GHz)

N=8

0.4 0.50.6 0.70.8 0.91

1

2

3

4

5

6

7

8

s

E−E0 (GHz)

N=16

FIG. 2: Spectra of 8-qubit (a) and 16-qubit (b) random Ising

Hamiltonians with transverse fields, relative to the ground

state energy E0. Solid thin lines represent the approximate

diagonalization results and dashed lines represent exact diag-

onalization results. Circles show the results of the quantum

Monte Carlo simulations.

already diagonal, it is only needed to determine the states

with the lowest energy to form S. For that to be feasi-

ble up to 128 qubits, we use the structure of the graph of

nonzero couplings between the qubits. We use a dynamic

programming method that is a variation on the bucket

elimination algorithm [15]. We select an order in which to

“eliminate” the qubits, i.e. to solve for the optimal value

of a qubit conditional on the values of all qubits coupled

to it that have not yet been eliminated. After eliminat-

ing all qubits, the lowest energy state is simply retrieved

by tracing back from the optimal value of the qubit that

was eliminated last. To find the NSlow energy states, we

keep track of the energy increase from choosing the sub-

optimal value of each qubit being eliminated, and while

tracing back through the elimination, the lowest energy

NS partial states encountered so far are kept, instead

of just the optimal partial state. With this approach,

the ability to find these unperturbed states is primar-

ily limited by the largest number of qubits that need to

be simultaneously considered during the elimination (the

treewidth of the graph), instead of the total number of

qubits. For the instances considered, the treewidth was

up to 16.

0.40.50.6 0.70.80.91

0

6

1

2

3

4

5

6

s

gap (GHz)

N=32

0.40.5 0.6 0.70.80.91

0

6

1

2

3

4

5

s

gap (GHz)

N=48

0.4 0.50.6 0.70.8 0.91

0

6

1

2

3

4

5

s

gap (GHz)

N=72

0.40.5 0.60.70.8 0.91

0

6

1

2

3

4

5

s

gap (GHz)

N=96

0.4 0.5 0.6 0.70.80.91

0

1

2

3

4

5

s

gap (GHz)

N=128

FIG. 3: Approximate energy gap (solid lines) of example ran-

dom Ising instances compared with results from Monte Carlo

simulations (circles). From top to bottom N=32,48,72,96, and

128.

We choose the unperturbed and perturbation Hamil-

tonians in the following way:

H0=1

2E(s)HP,V = −1

2∆(s)

?

i

σx

i. (16)

The small parameter in the perturbation expansion,

therefore, is proportional to ∆(s)/E(s). In our calcu-

lations we kept NS∼ 2000−6000 in the subspace S. We

choose NSin such a way that all the degenerate states in

Page 5

5

the topmost energy level are included in the subspace S.

A simplifying observation, for the calculation of (11), is

that V only contains terms with operators of the form σx

which flips the state of qubit i in the σz

V , therefore, only one bit flip from the original state is

allowed. Consequently, in the calculation of the matrix

elements of effective Hamiltonians? H(k), using (11), only

participate in the sums. This significantly restricts the

states |m?, |n?, or |p? that are summed over in (11). The

states outside S were found by flipping qubits away from

states in S, as required by the perturbation expansion.

We have examined many instances and compared the

calculated approximate eigenvalues with the QMC simu-

lation results of Ref. [14] and also, for small size instances,

with the exact diagonalization results. Here, however, we

only report a few sample instances. Figure 2(a) and (b)

show the calculated spectra for of 8-qubit and 16-qubit

sample problems, respectively. Due to the small num-

ber of qubits, the exact diagonalization was possible for

these instances. The figures show excellent agreement

between the exact (dashed lines) and approximate (solid

lines) diagonalization methods over a wide range of the

normalized time s. Even complicated details of the exact

spectra are nicely reproduced by the approximate diago-

nalization. As expected, some of the higher energy curves

deviate from the exact diagonalization values at small s,

where the perturbation expansion starts to fail. By in-

creasing NS, one can increase the validity range of the

calculation at the expense of a longer computation time.

The QMC results (symbols) for the above two instances

are also plotted in the same figures. As can be seen, QMC

agrees very well with the two other methods for s<

For larger values of s, QMC simulation fails to give re-

liable results due to the small tunneling amplitudes. As

we shall see below, the same pattern continues for larger

scale problems.

For problems with N > 16, it is not feasible to perform

exact diagonalization as the size of the Hamiltonian be-

comes exponentially large. As a consequence, we only

compare our results with those calculated using QMC

simulations. Figure 3 shows the calculated gap between

the lowest two energy levels, for N from 32 to 128. For

most instances the approximate diagonalization results

i

ibasis. For each

states with at most two bit flips from states |α? and |β?

∼0.7.

agree with QMC calculations for 0.4<

fore, QMC fails to give the correct spectral gap for large

s. Also, for the NS values chosen, the perturbation ex-

pansion becomes less reliable for s<

accuracy can always be enhanced by increasing NS. In-

teresting examples are N = 48 and 128 for which there

are anticrossings in the spectrum. The position of the

anticrossing and the shape of the energy levels close to

it are more or less consistent between the two methods

of calculation. The size of the minimum gap at the an-

ticrossing point, however, can depend on states outside

the subspace S that are not included in the perturbation

calculation. Therefore, the minimum gap size cannot be

reliably predicted unless a very large number of states

are included in S, or alternatively, the perturbation is

expanded to high orders.

∼s<

∼0.7. As be-

∼0.4, although the

IV.CONCLUSIONS

We have developed an approximate diagonalization

method for calculating low energy eigenvalues and eigen-

functions of a large scale Hamiltonian. The method is

based on derivation of a series of effective Hamiltonians,

in a subspace consisting of low energy states of an unper-

turbed Hamiltonian, using perturbation expansion. For

each eigenvalue to be calculated, an effective Hamilto-

nian is calculated and diagonalized separately. We have

applied our method to find the energy eigenvalues of ran-

dom Ising Hamiltonians in a transverse field. Our results

agree very well with the exact diagonalization for 8 and

16 qubit Hamiltonians, and with quantum Monte Carlo

simulations for up to 128 qubits. The approximate di-

agonalization method, however, is extremely faster than

both of the above methods.

Acknowledgment

We thank Elena Smirnova and Elena Tolkacheva for

critically reading the manuscript and providing valuable

comments.

[1] S. R. White, Phys. Rev. B 48, 10345 (1993).

[2] S. Liang and H. Pang, Phys. Rev. B, 49, 9214 (1994).

[3] M. Exler, J. Schnack, Phys. Rev. B 67, 094440 (2003).

[4] U. Schollw¨ ock, Rev. Mod. Phys. 77, 259 (2005).

[5] C. Lanczos, J. Res. Nat. Bur. Stand. 45, 255 (1950).

[6] A. W. Sandvik, J. Kurkijarvi, Phys. Rev. B 43, 5950

(1991).

[7] A. W. Sandvik, Phys. Rev. B 59, R14157 (1999).

[8] L. Engelhardt, M. Luban, Phys. Rev. B 73, 054430

(2006).

[9] A. P. Young, S. Knysh, and V. N. Smelyanskiy, Phys.

Rev. Lett. 104, 020502 (2010).

[10] D. Yao and J. Shi, Am. J. Phys. 63, 278 (2000).

[11] E. Farhi et al., Science, 292, 472 (2001).

[12] R. Harris et al., Phys. Rev. B 82, 024511 (2010).

[13] M.W. Johnson et al., Nature 473, 194 (2011).

[14] K. Karimi, N.G. Dickson, F. Hamze, M.H.S. Amin, M.

Drew-Brook, F.A. Chudak, P.I. Bunyk, W.G. Macready,

G. Rose, eprint arXiv:1006.4147.

[15] K. Kask, R. Dechter, J. Larrosa and F. Cozman, “Bucket-

Tree Elimination for Automated Reasoning”, ICS Tech-

nical Report R92.