Content uploaded by Jinlong Yang

Author content

All content in this area was uploaded by Jinlong Yang

Content may be subject to copyright.

arXiv:cond-mat/0605047v1 [cond-mat.mtrl-sci] 2 May 2006

Linear scaling calculation of maximally-localized Wannier functions with atomic basis

set

H. J. Xiang, Zhenyu Li, W. Z. Liang, Jinlong Yang,∗J. G. Hou, and Qingshi Zhu

Hefei National Laboratory for Physical Sciences at Microscale,

University of Science and Technology of China, Hefei, Anhui 230026, People’s Republic of China

(Dated: February 6, 2008)

We have developed a linear scaling algorithm for calculating maximally-localized Wannier func-

tions (MLWFs) using atomic orbital basis. An O(N) ground state calculation is carried out to get the

density matrix (DM). Through a projection of the DM onto atomic orbitals and a subsequent O(N)

orthogonalization, we obtain initial orthogonal localized orbitals. These orbitals can be maximally

localized in linear scaling by simple Jacobi sweeps. Our O(N) method is validated by applying it to

water molecule and wurtzite ZnO. The linear scaling behavior of the new method is demonstrated

by computing the MLWFs of boron nitride nanotubes.

I. INTRODUCTION

Wannier function1is a powerful tool in the study of

the chemical bonding, dielectric properties, excited elec-

tronic states, electron transport, and many body corre-

lations in materials. In particular, the modern theory

of bulk polarization relates the vector sum of the cen-

ters of the Wannier functions to the macroscopic po-

larization of a crystalline insulator.2However, the in-

trinsic nonuniqueness in the Wannier function deﬁnition,

and the diﬃculty in deﬁning their centers within a peri-

odic cell calculation, limited their practical use. Fortu-

nately, an elegant method has been recently proposed

by Marzari and Vanderbilt to obtain a unique set of

maximally-localized Wannier functions (MLWFs).3By

transforming the occupied electronic manifold into a set

of MLWFs, it becomes possible to obtain an enhanced

understanding of chemical bonding properties and elec-

tric polarization via an analysis of the MLWFs. Beside

the above points, the MLWFs are now also being used

as a very accurate minimal basis for a variety of algo-

rithmic or theoretical developments, with recent appli-

cations ranging from linear-scaling approaches4to the

construction of eﬀective Hamiltonians for the study of

ballistic transport,5strongly-correlated electrons,6self-

interaction corrections, metal-insulator transitions,7and

photonic lattices.8

In the seminal work of Marzari and Vanderbilt, ﬁrst

a ground state calculation was carried out to obtain the

occupied delocalized canonical orbitals, then a sequence

of unitary transformations were performed to obtain ML-

WFs which minimize the spread function.3Using the ex-

ponential representation for the unitary transformation,

Berghold et al.9derived an iterative scheme to obtain

MLWFs in large supercells of arbitrary symmetry. Also

a simple Jacobi orbital rotation scheme was found to be

remarkably eﬃcient.9A simultaneous diagonalization al-

gorithm similar to the Jacobi diagonalization method,

was used by Gygi et al. to compute MLWFs.10 Zicovich-

Wilson et al. proposed a Wannier-Boys scheme to obtain

well localized Wannier functions in linear combination of

atomic orbital periodic calculations.11 However, all meth-

ods mentioned above for calculating MLWFs are nearly

O(N3) scaling (N is the number of electrons), which pro-

hibits their applications to large systems containing hun-

dreds or thousands of atoms. The unfavorable scaling

comes from two steps in these methods: The conventional

methods for getting ground state wavefunctions is O(N3)

or O(N2lnN), and the localization step in the above local-

ization algorithms is also O(N3). Usually, the traditional

ground state calculation will cost more than the local-

ization step. However, for large systems the computing

amount of the localization step is also time-consuming.

In this work, we propose a simple order-N algorithm for

eﬀectively calculating MLWFs. The demanding ground

state calculation is circumvented by using O(N) den-

sity matrix puriﬁcation methods. After adopting O(N)

method for the ground state calculation, the conventional

O(N3) localization step will become time-dominant for

large systems. To obtain MLWFs in linear scaling, we

ﬁrst get initial localized orbitals from the density matrix,

then an O(N) localization method which uses the Jacobi

rotation scheme is utilized to maximally localize the or-

bitals. The linear scaling behavior of the new method is

demonstrated by computing the MLWFs of boron nitride

(BN) nanotubes.

This paper is organized as follows: In Sec. II, we

present our new O(N) method for calculating MLWFs.

In Sec. III, we describe the details of the implementa-

tion and perform some test calculations to illustrate the

rightness, robustness, and linear-scaling behavior of our

methods. We discuss some possible extensions and gen-

eralizations of our method in Sec. IV. Finally, our con-

cluding remarks are given in Sec. V.

II. THEORY

A. Maximally-Localized Wannier Functions

The Wannier functions are deﬁned in terms of a uni-

tary transformation of the occupied Bloch orbitals. How-

ever, they are not uniquely deﬁned, due to the arbitrary

freedom in the phases of the Bloch orbitals. Marzari and

2

Vanderbilt3resolve this indeterminacy by minimizing the

total spread function of the Wannier functions wn(r)

S=X

n

(hr2in− hri2

n),(1)

where hrin=hwn|r|wni, and hr2in=hwn|r2|wni.

Here since we aim at large systems, the Γ-point-only

sampling of the Brillouin zone (BZ) is used throughout

this work. The method of calculating MLWFs for su-

percells of general symmetry is proposed by Silvestrelli

et al..12 For the sake of simplicity, considering the case

of a simple-cubic supercell of side L, it can be proved

that minimizing the total spread Sis equivalent to the

problem of maximizing the functional

Ω = X

n

(|Xnn|2+|Ynn |2+|Znn|2),(2)

where Xmn =hwm|e−i2π

Lx|wniand similar deﬁnitions

for Ymn and Zmn apply. The coordinate xnof the nth

Wannier-function center (WFC) is computed using the

formula

xn=−L

2πImlnhwn|e−i2π

Lx|wni,(3)

with similar deﬁnitions for ynand zn.

B. Our O(N) method for calculating MLWFs

Our new O(N) method consists of four O(N) steps:

ﬁrst we obtain the density matrix, secondly we ﬁnd

out a set of linear independent nonorthogonal orbitals

which span the occupied manifold, thirdly, a modi-

ﬁed L¨owdin orthogonalization is used to orthogonalize

these nonorthogonal orbitals, ﬁnally, the Jacobi rotation

scheme is utilized to maximally localize the orbitals.

In principles, any localized orbitals or density ma-

trix based linear scaling methods can be used to ob-

tain initial localized orbitals in linear scaling.13 Here we

use the O(N) trace-correcting density matrix puriﬁcation

(TC2)14 method to get the density matrix since it is very

simple, robust, and eﬃcient. The use of some other linear

scaling methods based on localized orbitals will be dis-

cussed in Sec. IV. Here, the essence of the TC2 method

is brieﬂy outlined. In the begining, the Hamiltonian H

represented in the orthogonal basis is normalized to an

initial matrix ρ0with all its eigenvalues mapped onto

[0,1]: ρ0= (ǫmaxI−H)/(ǫmax −ǫmin ), where ǫmin and

ǫmax are lowest and highest eigenvalues of H, respec-

tively. Then we correct the trace of the density matrix

while purifying it using the following iteration:

ρn+1(ρn) = ρ2

n, T r(ρn)≥Ne/2

2ρn−ρ2

n, T r(ρn)< Ne/2,(4)

where Neis the total number of electrons in a close-shell

system.

Given an atomic orbital, one can project out its occu-

pied component using the density matrix operator ˆ

P:

Φα=|ˆ

P φαi=X

β

(PS)β,α |φβi,(5)

where Sis the overlap matrix, φαand φβdenote the

atomic basis orbitals, Pdenotes the density matrix in

the atomic orbital basis. By applying the density ma-

trix operator on Nbatomic basis orbitals, we can get Nb

localized orbitals Φα, among which only Nocc (the num-

ber of occupied states) localized orbitals are linear inde-

pendent. One must select out Nocc linear independent

localized orbitals among these localized orbitals Φαbe-

fore performing localization steps. We have implemented

two algorithms to achieve this goal. One of the algo-

rithms is similar to that proposed by Maslen et al.,15

who used Cholesky decompositions for detecting the lin-

ear dependence. We note that in this method the total

demanding for the construction of all the overlap matri-

ces is O(N) since the nonorthogonal orbitals are localized.

Furthermore, the total computing amount for performing

all Cholesky decompositions is almost the same as that

for performing a sparse Cholesky decomposition with the

matrix dimension Nocc due to the nature of the Cholesky

decomposition. In the second algorithm, we select these

atomic basis orbitals to be projected according to the

physical intuition. For example, in BN nanotubes, there

are one 2s and three 2p basis orbitals for each B and N

atoms when using pseudopotentials. Since some electrons

will transfer from B to N atoms, we can get Nocc linear

independent localized orbitals by just projecting the den-

sity matrix on all atomic basis orbitals of N atoms in de-

spite of the large covalency in these systems. For systems

where the bonding properties are known, the algorithm

is found to be very eﬃcient and the resulting orbitals are

very sparse. In cases where the second algorithm doesn’t

apply, we will resort to the ﬁrst algorithm.

Since MLWFs are orthogonal to each other, the Nocc

linear independent nonorthogonal localized orbitals must

be orthogonalized. It is well known that the orthogonal-

ized orbitals produced by the L¨owdin orthogonalization

are closest to initial nonorthogonal orbitals in the sense

of least squares. To obtain orthogonal localized orbitals

in linear scaling, we carry out a modiﬁed L¨owdin orthog-

onalization adopted by Stephan and Drabold.16 In this

approach, we perform repeated ﬁrst-order L¨owdin itera-

tions

Φ′

α= Φα−1

2X

β(6=α)

ΦβhΦα|Φβi.(6)

The functions after every orthonormalization cycle have

to be renormalized. Typically, we can obtain well orthog-

onal localized orbitals in about ﬁve O(N) orthonormal-

ization cycles.

Now we will discuss how to maximally localize these

orthogonal orbitals to get MLWFs in linear scaling. Our

target is maximizing Ω to obtain MLWFs in linear scal-

ing. The key point for the successful O(N) localization

3

step is that these orbitals are localized in the whole lo-

calization procedure. We use the simple Jacobi rotation

method to maximize Ω since it doesn’t require O(N3) di-

agonalization in contrast to the unitary transformation

method.9This method is a traditional method in quan-

tum chemistry for computing localized molecular orbitals

ﬁrst introduced by Edmiston and Ruedenberg.27 The ba-

sic idea of the method is to tackle the problem of max-

imizing Ω by carrying out several Jacobi sweeps. In a

traditional Jacobi sweep, we perform Nocc(Nocc −1)/2

consecutive two-by-two rotations among all pairs of or-

bitals. The elementary step consists of a plane rotation

where two orbitals are rotated through an angle and all

other orbitals are ﬁxed. In our O(N) method, due to the

localization of the orbitals, the computing amount of an

orbital ratation is O(N). Moreover, each orbital overlaps

with only O(1) orbitals, thus the number of the Jacobi

rotations in a Jacobi sweep is of order N. Assuming the

number of the Jacobi sweeps doesn’t change (It is really

the case for systems with similar characters), the total

computing amount is O(N).

(c)

(b)

(a)

(d)

N

B

FIG. 1: (Color online) (a), (b), (c), and (d) show the four ML-

WFs around a nitrogen atom of BN(5,5) nanotubes. These

MLWFs are calculated using the supercell containing 200

atoms with the DZP basis set.

III. IMPLEMENTATION AND RESULTS

A. Implementation

Our newly developed method has been implemented

in SIESTA,17 a standard Kohn-Sham density-functional

program using norm-conserving pseudopotentials and nu-

merical atomic orbitals as basis sets. In SIESTA, peri-

odic boundary conditions are employed to simulate both

isolated and periodic systems. The details about the im-

plementation of the TC2 method can be found in Ref.

[18].

B. Validity and performance of the method

All our calculations reported in this work are done in

the local density approximation (LDA).19 Unless oth-

erwise stated, the double-ζplus polarization functions

(DZP) basis set is used in the calculations. First we

calculate the MLWFs (i.e., Boys orbitals20 ) of a water

molecule. It is well known that there are four MLWFs

for a H2O molecule: two covalent O-H σbonds and two

lone-pair orbitals. The distance between the centroids

of these four MLWFs and the position of the oxygen ion

is 0.52, 0.52, 0.30, and 0.30 ˚

A respectively. The results

agree well with those reported by Berghold et al..9As a

second check of the validity of our method, we calculate

the piezoelectric constant of bulk ZnO. Both the Berry

phase method2and our new O(N) method are used to

calculate piezoelectric constant e33 of bulk wurtzite ZnO.

In our O(N) calculation, we use a 6 ×6×2 ZnO supercell

since we use the Γ-only sampling. The results from these

two methods agree very well: The computed values are

1.29 and 1.30 C/m2, respectively. And both results ac-

cord with others’ result21 (1.28 C/m2) computed through

the density functional perturbation theory.21

Then we test our method by applying it to calculate

the MLWFs of BN(5,5) armchair nanotubes. Fig. 1 shows

four MLWFs of BN(5,5) nanotubes computed using the

supercell containing 200 atoms. We can clearly see that

the three MLWFs in Fig. 1(a)-(c) are B-N σbonds.

Among these MLWFs, the MLWF in Fig. 1(a) has ex-

actly the same character as that shown in Fig. 1(c) due

to the mirror plane symmetry in armchair BN nanotubes.

0 200 400 600 800 1000

Number of atoms

0

500

1000

1500

2000

2500

CPU time (s)

O(N) method with SZ basis

O(N) method with DZP basis

Traditional method with SZ basis

FIG. 2: (Color online) Total CPU time for calculating ML-

WFs of BN(5,5) nanotubes using the linear scaling method or

the traditional Jacobi rotation method which doesn’t take ad-

vantage of the localization property of the orbitals. In case of

the new O(N) method, both SZ and DZP basis sets are used.

The calculations using the traditional method are performed

using the SZ basis set. All calculations were carried out on a

1.5 GHz Itanium 2 CPU workstation running RedHat Linux

Advanced Server V2.1.

4

The other MLWF in Fig. 1(d) is a πorbital, which al-

most centers at a nitrogen atom. It is interesting that

in BN nanotubes MLWFs preserve σ−πseparation. We

will return to this point later. To see the eﬃciency of

our new O(N) method, we perform a series of calcula-

tions using the linear scaling method or the traditional

Jacobi rotation method which doesn’t take advantage of

the localization property of the orbitals. Two diﬀerent

basis sets (single-ζ(SZ), DZP) are employed in the cal-

culations using the new O(N) method, and only the SZ

basis set is used for the traditional method. The CPU

time is shown in Fig. 2. We clearly see the perfect linear

scaling behavior of our new method. And the traditional

method displays a nearly O(N3) scaling as expected. The

computing saving of our method with respect to the tra-

ditional method is dramatically large, especially when

the size of systems exceeds 400 atoms. In addition, we

note that the ratio between the time for calculating ML-

WFs using DZP basis and that using SZ basis is smaller

than the case for the ground state calculation.18

IV. DISCUSSION

We have also implemented the method for obtaining

MLWFs from the localized orbitals produced by the O(N)

Mauri-Ordej´on (MO)23,24 or KMG25 methods. In case

of the MO method, the number of localized orbitals is

equal to the number of occupied states, and all localized

orbitals produced by the O(N) MO method are linear

independent. Thus the pro jection step is unnecessary.

However, in the KMG energy functional, the number of

localized orbitals is larger than the number of occupied

states. In this case, we ﬁrst get the density matrix using

Equation (87) in the paper written by Soler et al..17 Once

the density matrix is available, the steps to get MLWFs

are the same as those described in Sec. II.

In our implementation, numerical localized atomic or-

bitals are used as basis sets. Other localized basis such

as Gaussian orbitals or real space methods26 can also

be used. However, the use of non-local plane-wave basis

which was commonly adopted in previous calculations of

MLWFs will not result in linear scaling behavior.

Our previous discussions mainly focus on MLWFs in

periodic systems. We should note that our method could

also be adopted to obtain Boys20 localized orbitals of

isolated molecular systems with or without using peri-

odic boundary conditions. In this case, one can directly

minimize the spread function instead maximize the func-

tional Ω. Besides Boys orbitals, Edmiston-Ruedenberg

(ER)27,28 and Pipek-Mezey (PM)29 localized orbitals are

also popular among chemists. The beneﬁt of these local-

ized orbitals is that, unlike Boys orbitals, ER and PM

orbitals always preserve σ−πseparation. Our method

can be used to get PM orbitals in linear scaling. How-

ever, due to the long range character of the operator 1/r,

our method is unable to reduce signiﬁcantly the comput-

ing amount in the calculation of ER orbitals. We notice

that an eﬃcient method which reduces the scaling from

O(N5) to O(N2)-O(N3) has been proposed by Subotnik

et al..30

Although we only discuss spin-restricted systems up

to now, combined with the spin-unrestricted linear scal-

ing electronic structure theory,18 our O(N) method can

be straightforwardly applied to insulating magnetic sys-

tems. This method can be used to study the large multi-

ferroic (simultaneously (ferro)magnetic and ferroelectric)

materials.

V. CONCLUSIONS

To summarize, a linear scaling algorithm for calculat-

ing MLWFs has been proposed for the ﬁrst time. The nu-

merical atomic orbital basis instead of commonly adopted

plane wave sets is used. First we perform a linear scal-

ing ground state calculation using the TC2 puriﬁcation

method. From the density matrix, we get the initial

non-orthogonal localized orbitals. Through a modiﬁed

L¨owdin orthogonalization, we obtain the initial orthog-

onal localized orbitals. Due to the localization property

of these initial orbitals, the computing requirement of

the subsequent Jacobi sweeps for getting MLWFs is also

linear scaling. Our results for water molecule and bulk

wurtzite ZnO agree well with others’ results. The O(N)

behavior of the proposed method is clearly demonstrated

by computing the MLWFs of BN nanotubes. Our O(N)

method provides a very eﬃcient way for obtaining ML-

WFs which have many possible applications.

This work is partially supported by the National Nat-

ural Science Foundation of China (50121202, 20533030,

10474087), by the USTC-HP HPC project, and by the

SCCAS and Shanghai Supercomputer Center.

∗Corresponding author. E-mail: jlyang@ustc.edu.cn

1G. H. Wannier, Phys. Rev. 52, 191 (1937).

2R. D. King-Smith and D. Vanderbilt, Phys. Rev. B 47,

1651 (1993); R. Resta, Rev. Mod. Phys. 66, 899 (1994).

3N. Marzari and D. Vanderbilt, Phys. Rev. B 56, 12847

(1997).

4A. J. Williamson, R. Q. Hood, and J. C. Grossman, Phys.

Rev. Lett. 87, 246406 (2001).

5A. Calzolari, N. Marzari, I. Souza, and M. B. Nardelli,

Phys. Rev. B 69, 035108 (2004).

6W. Ku, H. Rosner, W. E. Pickett, and R. T. Scalettar,

Phys. Rev. Lett. 89, 167204 (2002); I. Schnell, G. Czy-

choll, and R. C. Albers, Phys. Rev. B 65, 075103(2002);

K. Nakamura, R. Arita, Y. Yoshimoto, S. Tsuneyuki,

cond-mat/0510425.

7E. Pavarini, S. Biermann, A. Poteryaev, A. I. Lichtenstein,

5

A. Georges, and O. K. Andersen, Phys. Rev. Lett. 92,

176403 (2004).

8D. M. Whittaker and M. P. Croucher, Phys. Rev. B, 67,

085204 (2003).

9G. Berghold, C. J. Mundy, A. H. Romero, J. Hutter, and

M. Parrinello, Phys. Rev. B 61, 10040 (2000).

10 F. Gygi, J.-L. Fattebert, and E. Schwegler, Comput. Phys.

Commun. 155, 1 (2003).

11 C. M. Zicovich-Wilson, R. Dovesi, and V. R. Saunders, J.

Chem. Phys. 115, 9708 (2001).

12 P. L. Silvestrelli, N. Marzari, D. Vanderbilt, and M. Par-

rinello, Solid State Commun. 107, 7 (1998); P. L. Sil-

vestrelli, Phys. Rev. B 59, 9703 (1999).

13 S. Goedecker, Rev. Mod. Phys. 71, 1085 (1999); S. Y. Wu

and C. S. Jayanthi, Phys. Rep. 358, 1 (2002).

14 A. M. N. Niklasson, Phys. Rev. B 66, 155115 (2002).

15 P. E. Maslen, C. Ochsenfeld, C. A. White, M. S. Lee, and

M. Head-Gordon, J. Phys. Chem. A 102, 2215 (1998).

16 U. Stephan and D. A. Drabold, Phys. Rev. B 57, 6391

(1998).

17 J. M. Soler, E. Artacho, J. D. Gale, A. Garc´ıa, J. Junquera,

P. Ordej´on, and D. S´anchez-Portal, J. Phys.: Condens.

Matter 14, 2745 (2002).

18 H. J. Xiang, W. Z. Liang, J. L. Yang, J. G. Hou, and Q.

S. Zhu, J. Chem. Phys. 123, 124105 (2005).

19 D. M. Ceperley and B. J. Alder, Phys. Rev. Lett. 45,

566(1980); J. P. Perdew and A. Zunger, Phys. Rev. B 23,

5048 (1981).

20 S. F. Boys, Rev. Mod. Phys. 32, 296 (1960).

21 X. Wu, D. Vanderbilt, and D. R. Hamann, Phys. Rev. B

72, 035105 (2005).

22 S. Baroni, S. de Gironcoli, A. Dal Corso, and P. Giannozzi,

Rev. Mod. Phys. 73, 515 (2001).

23 F. Mauri and G. Galli, Phys. Rev. B 47, 9973 (1993); ibid,

50, 4316 (1994).

24 P. Ordej´on, D. A. Drabold, R. M. Martin, and M. P. Grum-

bach, Phys. Rev. B 51, 1456(1995).

25 J. Kim, F. Mauri, and G. Galli, Phys. Rev. B 52, 1640

(1995).

26 J. R. Chelikowsky, N. Troullier, and Y. Saad, Phys. Rev.

Lett. 72, 1240 (1994).

27 C. Edmiston and K. Ruedenberg, Rev. Mod. Phys. 35, 457

(1963).

28 D. A. Kleier, T. A. Halgren, J. H. Hall, Jr., and W. N.

Lipscomb, J. Chem. Phys. 61, 3905 (1974).

29 J. Pipek and P. G. Mezey, J. Chem. Phys. 90, 4916 (1989).

30 J. E. Subotnik, Y. Shao, W. Z. Liang, and M. Head-

Gordon, J. Chem. Phys. 121, 9220 (2004).