Quantum ESPRESSO 4.3 用户手册

更新时间:2023-04-30 17:48:01 阅读量: 综合文库 文档下载

说明:文章内容仅供预览,部分内容可能不全。下载后的文档,内容与下面显示的完全一致。下载之前请确认下面内容是否您想要的,是否完整无缺。

User’s Guide for Quantum ESPRESSO

(version4.3)

Contents

1Introduction3

1.1What can Quantum ESPRESSO do (5)

1.2People (6)

1.3Contacts (9)

1.3.1Guidelines for posting to the mailing list (9)

1.4Terms of use (10)

2Installation10

2.1Download (10)

2.2Prerequisites (11)

2.3configure (12)

2.3.1Manual con?guration (14)

2.4Libraries (14)

2.4.1If optimized libraries are not found (15)

2.5Compilation (16)

2.6Running examples (19)

2.7Installation tricks and problems (20)

2.7.1All architectures (20)

2.7.2Cray XT machines (21)

2.7.3IBM AIX (21)

2.7.4IBM BlueGene (21)

2.7.5Linux PC (21)

2.7.6Linux PC clusters with MPI (24)

2.7.7Intel Mac OS X (25)

2.7.8SGI,Alpha (26)

1

3Parallelism27

3.1Understanding Parallelism (27)

3.2Running on parallel machines (27)

3.3Parallelization levels (28)

3.3.1Understanding parallel I/O (30)

3.4Tricks and problems (31)

4Using Quantum ESPRESSO33

4.1Input data (33)

4.2Data?les (34)

4.3Format of arrays containing charge density,potential,etc (34)

4.4Pseudopotential?les (35)

5Using PWscf35

5.1Electronic structure calculations (36)

5.2Optimization and dynamics (37)

5.3Direct interface with CASINO (38)

6NEB calculations40 7Phonon calculations42

7.1Single-q calculation (42)

7.2Calculation of interatomic force constants in real space (43)

7.3Calculation of electron-phonon interaction coe?cients (43)

7.4Distributed Phonon calculations (44)

8Post-processing44

8.1Plotting selected quantities (44)

8.2Band structure,Fermi surface (45)

8.3Projection over atomic states,DOS (45)

8.4Wannier functions (45)

8.5Other tools (46)

9Using CP46

9.1Reaching the electronic ground state (48)

9.2Relax the system (48)

9.3CP dynamics (50)

9.4Advanced usage (52)

9.4.1Self-interaction Correction (52)

9.4.2ensemble-DFT (53)

9.4.3Free-energy surface calculations (55)

9.4.4Treatment of USPPs (55)

10Performances56

10.1Execution time (56)

10.2Memory requirements (57)

10.3File space requirements (58)

10.4Parallelization issues (58)

2

11Troubleshooting59

11.1pw.x problems (59)

11.2Compilation problems with PLUMED (66)

11.3Compilation problems with YAMBO (67)

11.4PostProc (67)

11.5ph.x errors (68)

12Frequently Asked Questions(F AQ)69

12.1General (69)

12.2Installation (69)

12.3Pseudopotentials (70)

12.4Input data (71)

12.5Parallel execution (72)

12.6Frequent errors during execution (72)

12.7Self Consistency (73)

12.8Phonons (75)

1Introduction

This guide covers the installation and usage of Quantum ESPRESSO(opEn-Source Package

for Research in Electronic Structure,Simulation,and Optimization),version4.3.

The Quantum ESPRESSO distribution contains the following core packages for the cal-culation of electronic-structure properties within Density-Functional Theory(DFT),using a Plane-Wave(PW)basis set and pseudopotentials(PP):

?PWscf(Plane-Wave Self-Consistent Field).

?CP(Car-Parrinello).

It also includes the following more specialized packages:

?NEB:energy barriers and reaction pathways through the Nudged Elastic Band method.

?PHonon:phonons with Density-Functional Perturbation Theory.

?PostProc:various utilities for data postprocessing.

?PWcond:ballistic conductance(people.sissa.it/~smogunov/PWCOND/pwcond).

?GIPAW(Gauge-Independent Projector Augmented Waves):EPR g-tensor and NMR chem-

ical shifts(aa6749543c1ec5da50e2706a).

?XSPECTRA:K-edge X-ray adsorption spectra.

?vdW:(experimental)dynamic polarizability.

?GWW:(experimental)GW calculation using Wannier functions(aa6749543c1ec5da50e2706a/).

?TD-DFPT:calculations of spectra using Time-Dependent Density-Functional Perturbation

Theory(see TDDFPT/README for a list of reference papers).

3

The following auxiliary codes are included as well:

?PWgui:a Graphical User Interface,producing input data?les for PWscf.

?atomic:a program for atomic calculations and generation of pseudopotentials.

?QHA:utilities for the calculation of projected density of states(PDOS)and of the free energy in the Quasi-Harmonic Approximation(to be used in conjunction with PHonon).

?PlotPhon:phonon dispersion plotting utility(to be used in conjunction with PHonon).

A copy of required external libraries are included:

?iotk:an Input-Output ToolKit.

?BLAS and LAPACK

Finally,several additional packages that exploit data produced by Quantum ESPRESSO or patch some Quantum ESPRESSO routines can be installed as plug-ins:

?Wannier90:maximally localized Wannier functions(aa6749543c1ec5da50e2706a/),writ-ten by A.Mosto?,J.Yates,Y.-S Lee.

?WanT:quantum transport properties with Wannier functions

(aa6749543c1ec5da50e2706a),originally written by A.Ferretti,A Calzolari and M.Buongiorno Nardelli.

?YAMBO:electronic excitations within Many-Body Perturbation Theory:GW and Bethe-Salpeter equation(aa6749543c1ec5da50e2706a),originally written by A.Marini.

?PLUMED:calculation of free-energy surface through metadynamics

M.Bonomi et al,aa6749543c1ec5da50e2706am.180,1961(2009)

(merlino.mi.infm.it/~plumed/PLUMED).

This guide documents PWscf,NEB,CP,PHonon,PostProc.The remaining packages have sepa-rate documentation.

The Quantum ESPRESSO codes work on many di?erent types of Unix machines,in-cluding parallel machines using both OpenMP and MPI(Message Passing Interface).Running Quantum ESPRESSO on Mac OS X and MS-Windows is also possible:see section2.2.

Further documentation,beyond what is provided in this guide,can be found in:

?the pw forum mailing list(pw forum@aa6749543c1ec5da50e2706a).You can subscribe to this list,browse and search its archives(links in aa6749543c1ec5da50e2706a/contacts.php).

See section1.3,“Contacts”,for more info.

?the Doc/directory of the Quantum ESPRESSO distribution,containing a detailed description of input data for most codes in?les INPUT*.txt and INPUT*,plus and a few additional pdf documents

?the Quantum ESPRESSO web site:

aa6749543c1ec5da50e2706a;

4

?the Quantum ESPRESSO Wiki:

aa6749543c1ec5da50e2706a/wiki/index.php/Main Page.

People who want to contribute to Quantum ESPRESSO should read the Developer Manual: Doc/developer man.pdf.

This guide does not explain the basic Unix concepts(shell,execution path,directories etc.) and utilities needed to run Quantum ESPRESSO;it does not explain either solid state physics and its computational methods.If you want to learn the latter,you should read a good textbook,such as e.g.the book by Richard Martin:Electronic Structure:Basic Theory and Practical Methods,Cambridge University Press(2004).See also the“Learn”section in the Quantum ESPRESSO web site;the“Reference Papers”section in the Wiki.

All trademarks mentioned in this guide belong to their respective owners.

1.1What can Quantum ESPRESSO do

PWscf can currently perform the following kinds of calculations:

?ground-state energy and one-electron(Kohn-Sham)orbitals;

?atomic forces,stresses,and structural optimization;

?molecular dynamics on the ground-state Born-Oppenheimer surface,also with variable cell;

?macroscopic polarization and?nite electric?elds via the modern theory of polarization (Berry Phases).

?the modern theory of polarization(Berry Phases).

?free-energy surface calculation at?xed cell through meta-dynamics,if patched with PLUMED.

All of the above works for both insulators and metals,in any crystal structure,for many exchange-correlation(XC)functionals(including spin polarization,DFT+U,nonlocal VdW functionas,hybrid functionals),for norm-conserving(Hamann-Schluter-Chiang)PPs(NCPPs) in separable form or Ultrasoft(Vanderbilt)PPs(USPPs)or Projector Augmented Waves(PAW) method.Non-collinear magnetism and spin-orbit interactions are also implemented.An imple-mentation of?nite electric?elds with a sawtooth potential in a supercell is also available.

NEB calculates reaction pathways and energy barriers using the Nudged Elastic Band(NEB) and Fourier String Method Dynamics(SMD)methods.Note that these calculations are no longer performed by the pw.x executable of PWscf.Also note that NEB with Car-Parrinello Molecular Dynamics is currently not implemented.

PHonon can perform the following types of calculations:

?phonon frequencies and eigenvectors at a generic wave vector,using Density-Functional Perturbation Theory;

?e?ective charges and dielectric tensors;

?electron-phonon interaction coe?cients for metals;

5

?interatomic force constants in real space;

?third-order anharmonic phonon lifetimes;

?Infrared and Raman(nonresonant)cross section.

PHonon can be used whenever PWscf can be used,with the exceptions of DFT+U,nonlocal VdW and hybrid aa6749543c1ec5da50e2706aPP and PAW are not implemented for higher-order response calculations.See the header of?le PH/phonon.f90for a complete and updated list of what PHonon can and cannot do.Calculations,in the Quasi-Harmonic approximations,of the vibra-tional free energy can be performed using the QHA package.

PostProc can perform the following types of calculations:

?Scanning Tunneling Microscopy(STM)images;

?plots of Electron Localization Functions(ELF);

?Density of States(DOS)and Projected DOS(PDOS);

?L¨o wdin charges;

?planar and spherical averages;

plus interfacing with a number of graphical utilities and with external codes.

CP can perform Car-Parrinello molecular dynamics,including variable-cell dynamics,and free-energy surface calculation at?xed cell through meta-dynamics,if patched with PLUMED.

1.2People

In the following,the cited a?liation is either the current one or the one where the last known contribution was done.

The maintenance and further development of the Quantum ESPRESSO distribution is promoted by the DEMOCRITOS National Simulation Center of IOM-CNR under the coor-dination of Paolo Giannozzi(Univ.Udine,Italy)and Layla Martin-Samos(Democritos)with the strong support of the CINECA National Supercomputing Center in Bologna under the responsibility of Carlo Cavazzoni.

The PWscf package(which included PHonon and PostProc in earlier releases)was origi-nally developed by Stefano Baroni,Stefano de Gironcoli,Andrea Dal Corso(SISSA),Paolo Giannozzi,and many others.We quote in particular:

?Matteo Cococcioni(Univ.Minnesota)for DFT+U implementation;

?David Vanderbilt’s group at Rutgers for Berry’s phase calculations;

?Ralph Gebauer(ICTP,Trieste)and Adriano Mosca Conte(SISSA,Trieste)for noncolinear magnetism;

?Andrea Dal Corso for spin-orbit interactions;

?Carlo Sbraccia(Princeton)for NEB,Strings method,for improvements to structural optimization and to many other parts;

6

?Paolo Umari(Democritos)for?nite electric?elds;

?Renata Wentzcovitch and collaborators(Univ.Minnesota)for variable-cell molecular dynamics;

?Lorenzo Paulatto(Univ.Paris VI)for PAW implementation,built upon previous work by Guido Fratesi(aa6749543c1ec5da50e2706aano Bicocca)and Riccardo Mazzarello(ETHZ-USI Lugano);

?Ismaila Dabo(INRIA,Palaiseau)for electrostatics with free boundary conditions;

?Norbert Nemec and Mike Towler(U.Cambridge)for interface with CASINO.

For PHonon,we mention in particular:

?Michele Lazzeri(Univ.Paris VI)for the2n+1code and Raman cross section calculation with2nd-order response;

?Andrea Dal Corso for USPP,noncollinear,spin-orbit extensions to PHonon.

For PostProc,we mention:

?Andrea Benassi(SISSA)for the epsilon utility;

?Dmitry Korotin(Inst.Met.Phys.Ekaterinburg)for the wannier ham utility.

The CP package is based on the original code written by Roberto Car and Michele Parrinello. CP was developed by Alfredo Pasquarello(IRRMA,Lausanne),Kari Laasonen(Oulu),Andrea Trave,Roberto Car(Princeton),Nicola Marzari(Univ.Oxford),Paolo Giannozzi,and others. FPMD,later merged with CP,was developed by Carlo Cavazzoni,Gerardo Ballabio(CINECA), Sandro Scandolo(ICTP),Guido Chiarotti(SISSA),Paolo Focher,and others.We quote in particular:

?Manu Sharma(Princeton)and Yudong Wu(Princeton)for maximally localized Wannier functions and dynamics with Wannier functions;

?Paolo Umari(Democritos)for?nite electric?elds and conjugate gradients;

?Paolo Umari and Ismaila Dabo for ensemble-DFT;

?Xiaofei Wang(Princeton)for META-GGA;

?The Autopilot feature was implemented by Targacept,Inc.

Other packages in Quantum ESPRESSO:

?PWcond was written by Alexander Smogunov(SISSA)and Andrea Dal Corso.For an introduction,see people.sissa.it/~smogunov/PWCOND/pwcond

?GIPAW(aa6749543c1ec5da50e2706a)was written by Davide Ceresoli(MIT),Ari Seitsonen (Univ.Zurich),Uwe Gerstmann,Francesco Mauri(Univ.Paris VI).

?PWgui was written by Anton Kokalj(IJS Ljubljana)and is based on his GUIB concept (www-k3.ijs.si/kokalj/guib/).

7

?atomic was written by Andrea Dal Corso and it is the result of many additions to the original code by Paolo Giannozzi and others.Lorenzo Paulatto wrote the PAW extension.

?iotk(s3.infm.it/iotk)was written by Giovanni Bussi(SISSA).

?XSPECTRA was written by Matteo Calandra(Univ.Paris VI)and collaborators.

?VdW was contributed by Huy-Viet Nguyen(SISSA).

?GWW was written by Paolo Umari and Geo?rey Stenuit(Democritos).

?QHA amd PlotPhon were contributed by Eyvaz Isaev(Moscow Steel and Alloy Inst.and Linkoping and Uppsala Univ.).

?TD-DFPT written by Stefano Baroni(SISSA),Ralph Gebauer(ICTP),Baris Malcioglu, Dario Rocca,Brent Walker.

Other relevant contributions to Quantum ESPRESSO:

?Brian Kolb and Timo Thonhauser(Wake Forest University)implemented the vdW-DF and vdW-DF2functionals,with support from Riccardo Sabatini and Stefano de Gironcoli (SISSA and DEMOCRITOS);

?Andrea Ferretti(MIT)contributed the qexml and sumpdos utility,helped with?le formats and with various problems;

?Hannu-Pekka Komsa(CSEA/Lausanne)contributed the HSE functional;

?Dispersions interaction in the framework of DFT-D were contributed by Daniel Forrer (Padua Univ.)and Michele Pavone(Naples Univ.Federico II);

?Filippo Spiga(aa6749543c1ec5da50e2706aano Bicocca)contributed the mixed MPI-OpenMP paralleliza-tion;

?The initial BlueGene porting was done by Costas Bekas and Alessandro Curioni(IBM Zurich);

?Gerardo Ballabio wrote the?rst configure for Quantum ESPRESSO

?Audrius Alkauskas(IRRMA),Uli Aschauer(Princeton),Simon Binnie(Univ.College London),Guido Fratesi,Axel Kohlmeyer(UPenn),Konstantin Kudin(Princeton),Sergey Lisenkov(Univ.Arkansas),Nicolas Mounet(MIT),William Parker(Ohio State Univ), Guido Roma(CEA),Gabriele Sclauzero(SISSA),Sylvie Stucki(IRRMA),Pascal Thibaudeau (CEA),Vittorio Zecca,Federico Zipoli(Princeton)answered questions on the mailing list, found bugs,helped in porting to new architectures,wrote some code.

An alphabetical list of further contributors includes:Dario Alf`e,Alain Allouche,Francesco Antoniella,Francesca Baletto,Mauro Boero,Nicola Bonini,Claudia Bungaro,Paolo Cazzato, Gabriele Cipriani,Jiayu Dai,Cesar Da Silva,Alberto Debernardi,Gernot Deinzer,Yves Ferro, Martin Hilgeman,Yosuke Kanai,Nicolas Lacorne,Stephane Lefranc,Kurt Maeder,Andrea Marini,Pasquale Pavone,Mickael Profeta,Kurt Stokbro,Paul Tangney,Antonio Tilocca,Jaro Tobik,Malgorzata Wierzbowska,Silviu Zilberman,and let us apologize to everybody we have forgotten.

This guide was mostly written by Paolo Giannozzi.Gerardo Ballabio and Carlo Cavazzoni wrote the section on CP.Mike Towler wrote the PWscf to CASINO subsection.

8

1.3Contacts

The web site for Quantum ESPRESSO is aa6749543c1ec5da50e2706a/.Releases and patches can be downloaded from this site or following the links contained in it.The main entry point for developers is the QE-forge web site:aa6749543c1ec5da50e2706a/.

The recommended place where to ask questions about installation and usage of Quantum ESPRESSO,and to report bugs,is the pw forum mailing list:pw forum@aa6749543c1ec5da50e2706a.Here you can receive news about Quantum ESPRESSO and obtain help from the developers and from knowledgeable users.Please read the guidelines for posting,section1.3.1!

You have to be subscribed in order to post to the pw forum list.NOTA BENE:only messages that appear to come from the registered user’s e-mail address,in its exact form,will be accepted.Messages”waiting for moderator approval”are automatically deleted with no further processing(sorry,too much spam).In case of trouble,carefully check that your return e-mail is the correct one(i.e.the one you used to subscribe).

Since pw forum averages~10message a day,an alternative low-tra?c mailing list,

pw users@aa6749543c1ec5da50e2706a,is provided for those interested only in Quantum ESPRESSO-related news,such as e.g.announcements of new versions,tutorials,etc..You can subscribe(but not post)to this list from the Quantum ESPRESSO web site(“Contacts”section).

If you need to contact the developers for speci?c questions about coding,proposals,o?ers of help,etc.,send a message to the developers’mailing list:user q-e-developers,address aa6749543c1ec5da50e2706a.

1.3.1Guidelines for posting to the mailing list

Life for subscribers of pw forum will be easier if everybody complies with the following guide-lines:

?Before posting,please:browse or search the archives–links are available in the”Contacts”

page of the Quantum ESPRESSO web site:

aa6749543c1ec5da50e2706a/contacts.php.Most questions are asked over and over again.Also:make an attempt to search the available documentation,notably the FAQs and the User Guide.The answer to most questions is already there.

?Sign your post with your name and a?liation.

?Choose a meaningful subject.Do not use”reply”to start a new thread:it will confuse the ordering of messages into threads that most mailers can do.In particular,do not use ”reply”to a Digest!!!

?Be short:no need to send128copies of the same error message just because you this is what came out of your128-processor run.No need to send the entire compilation log for

a single error appearing at the end.

?Avoid excessive or irrelevant quoting of previous messages.Your message must be imme-diately visible and easily readable,not hidden into a sea of quoted text.

?Remember that even experts cannot guess where a problem lies in the absence of su?cient information.

?Remember that the mailing list is a voluntary endeavour:nobody is entitled to an answer, even less to an immediate answer.

9

?Finally,please note that the mailing list is not a replacement for your own work,nor is it a replacement for your thesis director’s work.

1.4Terms of use

Quantum ESPRESSO is free software,released under the GNU General Public License. See aa6749543c1ec5da50e2706a/licenses/old-licenses/gpl-2.0.txt,or the?le License in the distribution).

We shall greatly appreciate if scienti?c work done using this code will contain an explicit acknowledgment and the following reference:

P.Giannozzi,S.Baroni,N.Bonini,M.Calandra,R.Car,C.Cavazzoni,D.Ceresoli,

G.L.Chiarotti,M.Cococcioni,I.Dabo,A.Dal Corso,S.Fabris,G.Fratesi,S.de

Gironcoli,R.Gebauer,U.Gerstmann,C.Gougoussis,A.Kokalj,aa6749543c1ec5da50e2706azzeri,L.

Martin-Samos,N.Marzari,F.Mauri,R.Mazzarello,S.Paolini,A.Pasquarello,

L.Paulatto, C.Sbraccia,S.Scandolo,G.Sclauzero, A.P.Seitsonen, A.Smo-

gunov,P.Umari,R.M.Wentzcovitch,J.Phys.:Condens.Matter21,395502(2009),

aa6749543c1ec5da50e2706a/abs/0906.2569

Note the form Quantum ESPRESSO for textual citations of the code.Pseudopotentials should be cited as(for instance)

[]We used the pseudopotentials C.pbe-rrjkus.UPF and O.pbe-vbc.UPF from

aa6749543c1ec5da50e2706a.

2Installation

2.1Download

Presently,Quantum ESPRESSO is only distributed in source form;some precompiled exe-cutables(binary?les)are provided only for PWgui.Stable releases of the Quantum ESPRESSO source package(current version is4.3)can be downloaded from this URL:

aa6749543c1ec5da50e2706a/download.php.

Uncompress and unpack the core distribution using the command:

tar zxvf espresso-X.Y.Z.tar.gz

(a hyphen before”zxvf”is optional)where X.Y.Z stands for the version number.If your version of tar doesn’t recognize the”z”?ag:

gunzip-c espresso-X.Y.Z.tar.gz|tar xvf-

A directory espresso-X.Y.Z/will be created.Given the size of the complete distribution,you may need to download more packages and to unpack them following the same procedure(they will unpack into the same directory).

Plug-ins such as YAMBO or PLUMED should instead be downloaded into subdirectory archive but NOT UNPACKED OR UNCOMPRESSED:command make will take care of this during installation.

Occasionally,patches for the current version,?xing some errors and bugs,may be distributed as a”di?”?le.In order to install a patch(for instance):

10

cd espresso-X.Y.Z/

patch-p1

If more than one patch is present,they should be applied in the correct order.

Daily snapshots of the development version can be downloaded from the developers’site aa6749543c1ec5da50e2706a:follow the link”Quantum ESPRESSO”,then”SCM”.Beware:the develop-ment version is,well,under development:use at your own risk!The bravest may access the development version via anonymous CVS(Concurrent Version System):see the Developer Manual(Doc/developer man.pdf),section”Using CVS”.

The Quantum ESPRESSO distribution contains several directories.Some of them are common to all packages:

Modules/source?les for modules that are common to all programs

include/?les*.h included by fortran and C source?les

clib/external libraries written in C

flib/external libraries written in Fortran

extlibs/archive of external libraries LAPACK,BLAS and iotk

install/installation scripts and utilities

pseudo/pseudopotential?les used by examples

upftools/converters to uni?ed pseudopotential format(UPF)

examples/sample input and output?les

Doc/general documentation

archive/contains plug-ins in.tar.gz form

while others are speci?c to a single package:

PW/PWscf:source?les for scf calculations(pw.x)

pwtools/PWscf:source?les for miscellaneous analysis programs

tests/PWscf:automated tests

NEB/PWneb:source?les for NEB calculations(neb.x)

PP/PostProc:source?les for post-processing of pw.x data?le

PH/PHonon:source?les for phonon calculations(ph.x)and analysis

Gamma/PHonon:source?les for Gamma-only phonon calculation(phcg.x)

D3/PHonon:source?les for third-order derivative calculations(d3.x)

PWCOND/PWcond:source?les for conductance calculations(pwcond.x)

vdW/VdW:source?les for molecular polarizability calculation at?nite frequency CPV/CP:source?les for Car-Parrinello code(cp.x)

atomic/atomic:source?les for the pseudopotential generation package(ld1.x) atomic doc/Documentation,tests and examples for atomic

GUI/PWGui:Graphical User Interface

2.2Prerequisites

To install Quantum ESPRESSO from source,you need?rst of all a minimal Unix envi-ronment:basically,a command shell(e.g.,bash or tcsh)and the utilities make,awk,sed. MS-Windows users need to have Cygwin(a UNIX environment which runs under Windows) installed:see aa6749543c1ec5da50e2706a/.Note that the scripts contained in the distribution assume that the local language is set to the standard,i.e.”C”;other settings may break them. Use export LC ALL=C(sh/bash)or setenv LC ALL C(csh/tcsh)to prevent any problem when running scripts(including installation scripts).

11

Second,you need C and Fortran-95compilers.For parallel execution,you will also need

MPI libraries and a“parallel”(i.e.MPI-aware)compiler.For massively parallel machines,or

for simple multicore parallelization,an OpenMP-aware compiler and libraries are also required.

Big machines with specialized hardware(e.g.IBM SP,CRAY,etc)typically have a Fortran-

95compiler with MPI and OpenMP libraries bundled with the software.Workstations or “commodity”machines,using PC hardware,may or may not have the needed software.If not,you need either to buy a commercial product(e.g Portland)or to install an open-source compiler like gfortran or g95.Note that several commercial compilers are available free of charge under some license for academic or personal usage(e.g.Intel,Sun).

2.3configure

To install the Quantum ESPRESSO source package,run the configure script.This is ac-tually a wrapper to the true configure,located in the install/subdirectory.configure will

(try to)detect compilers and libraries available on your machine,and set up things accordingly. Presently it is expected to work on most Linux32-and64-bit PCs(all Intel and AMD CPUs)

and PC clusters,SGI Altix,IBM SP machines,NEC SX,Cray XT machines,Mac OS X,

MS-Windows PCs.It may work with some assistance also on other architectures(see below).

Instructions for the impatient:

cd espresso-X.Y.Z/

./configure

make all

Symlinks to executable programs will be placed in the bin/subdirectory.Note that both C

and Fortran compilers must be in your execution path,as speci?ed in the PATH environment variable.

Additional instructions for special machines:

./configure ARCH=crayxt4r for CRAY XT machines

./configure ARCH=necsx for NEC SX machines

./configure ARCH=ppc64-mn PowerPC Linux+xlf(Marenostrum)

./configure ARCH=ppc64-bg IBM BG/P(BlueGene)

configure Generates the following?les:

install/make.sys compilation rules and?ags(used by Makefile)

install/configure.msg a report of the con?guration run(not needed for compilation)

install/config.log detailed log of the con?guration run(may be needed for debugging) include/fft defs.h de?nes fortran variable for C pointer(used only by FFTW)

include/c defs.h de?nes C to fortran calling convention

and a few more de?nitions used by C?les

NOTA BENE:unlike previous versions,configure no longer runs the makedeps.sh shell script

that updates dependencies.If you modify the sources,run./install/makedeps.sh or type make depend to update?les make.depend in the various subdirectories.

You should always be able to compile the Quantum ESPRESSO suite of programs without having to edit any of the generated?les.However you may have to tune configure by specifying appropriate environment variables and/or command-line aa6749543c1ec5da50e2706aually the tricky part is to

get external libraries recognized and used:see Sec.2.4for details and hints.

Environment variables may be set in any of these ways:

12

export VARIABLE=value;./configure#sh,bash,ksh

setenv VARIABLE value;./configure#csh,tcsh

./configure VARIABLE=value#any shell

Some environment variables that are relevant to configure are:

ARCH label identifying the machine type(see below)

F90,F77,CC names of Fortran95,Fortran77,and C compilers

MPIF90name of parallel Fortran95compiler(using MPI)

CPP source?le preprocessor(defaults to$CC-E)

LD linker(defaults to$MPIF90)

(C,F,F90,CPP,LD)FLAGS compilation/preprocessor/loader?ags

LIBDIRS extra directories where to search for libraries

For example,the following command line:

./configure MPIF90=mpf90FFLAGS="-O2-assume byterecl"\

CC=gcc CFLAGS=-O3LDFLAGS=-static

instructs configure to use mpf90as Fortran95compiler with?ags-O2-assume byterecl, gcc as C compiler with?ags-O3,and to link with?ag-static.Note that the value of FFLAGS must be quoted,because it contains spaces.NOTA BENE:do not pass compiler names with the leading path included.F90=f90xyz is ok,F90=/path/to/f90xyz is not.Do not use environmental variables with configure unless they are needed!try configure with no options as a?rst step.

If your machine type is unknown to configure,you may use the ARCH variable to suggest an architecture among supported ones.Some large parallel machines using a front-end(e.g. Cray XT)will actually need it,or else configure will correctly recognize the front-end but not the specialized compilation environment of those machines.In some cases,cross-compilation requires to specify the target machine with the--host option.This feature has not been ex-tensively tested,but we had at least one successful report(compilation for NEC SX6on a PC). Currently supported architectures are:

ia32Intel32-bit machines(x86)running Linux

ia64Intel64-bit(Itanium)running Linux

x8664Intel and AMD64-bit running Linux-see note below

aix IBM AIX machines

solaris PC’s running SUN-Solaris

sparc Sun SPARC machines

crayxt4Cray XT4/5machines

macppc Apple PowerPC machines running Mac OS X

mac686Apple Intel machines running Mac OS X

cygwin MS-Windows PCs with Cygwin

necsx NEC SX-6and SX-8machines

ppc64Linux PowerPC machines,64bits

ppc64-mn as above,with IBM xlf compiler

ppc64-bg IBM BlueGene

Note:x8664replaces amd64since v.4.1.Cray Unicos machines,SGI machines with MIPS architecture,HP-Compaq Alphas are no longer supported since v.4.3.Finally,configure rec-ognizes the following command-line options:

13

--enable-parallel compile for parallel execution if possible(default:yes)

--enable-openmp compile for openmp execution if possible(default:no)

--enable-shared use shared libraries if available(default:yes)

--disable-wrappers disable C to fortran wrapper check(default:enabled)

--enable-signals enable signal trapping(default:disabled)

and the following optional packages:

--with-internal-blas compile with internal BLAS(default:no)

--with-internal-lapack compile with internal LAPACK(default:no)

--with-scalapack use ScaLAPACK if available(default:yes)

--enable-exx compile enabling the use of hybrid functionals(exact-exchange) If you want to modify the configure script(advanced users only!),see the Developer Manual.

2.3.1Manual con?guration

If configure stops before the end,and you don’t?nd a way to?x it,you have to write working make.sys,include/fft defs.h and include/c defs.h?les.For the latter two?les,follow the explanations in include/defs.h.README.

If configure has run till the end,you should need only to edit make.sys.A few templates (each for a di?erent machine type)are provided in the install/directory:they have names of the form Make.system,where system is a string identifying the architecture and compiler.The template used by configure is also found there as make.sys.in and contains explanations of the meaning of the various variables.The di?cult part will be to locate libraries.Note that you will need to select appropriate preprocessing?ags in conjunction with the desired or available libraries(e.g.you need to add-D FFTW)to DFLAGS if you want to link internal FFTW).For a correct choice of preprocessing?ags,refer to the documentation in include/defs.h.README.

NOTA BENE:If you change any settings(e.g.preprocessing,compilation?ags)after a previous(successful or failed)compilation,you must run make clean before recompiling,unless you know exactly which routines are a?ected by the changed settings and how to force their recompilation.

2.4Libraries

Quantum ESPRESSO makes use of the following external libraries:

?BLAS(aa6749543c1ec5da50e2706a/blas/)and

?LAPACK(aa6749543c1ec5da50e2706a/lapack/)for linear algebra

?FFTW(aa6749543c1ec5da50e2706a/)for Fast Fourier Transforms

A copy of the needed routines is provided with the distribution.However,when available, optimized vendor-speci?c libraries should be used:this often yields huge performance gains. BLAS and LAPACK Quantum ESPRESSO can use the following architecture-speci?c replacements for BLAS and LAPACK:

MKL for Intel Linux PCs

ACML for AMD Linux PCs

14

ESSL for IBM machines

SCSL for SGI Altix

SUNperf for Sun

If none of these is available,we suggest that you use the optimized ATLAS library:see aa6749543c1ec5da50e2706a/.Note that ATLAS is not a complete replacement for LAPACK:it contains all of the BLAS,plus the LU code,plus the full storage Cholesky code. Follow the instructions in the ATLAS distributions to produce a full LAPACK replacement.

Sergei Lisenkov reported success and good performances with optimized BLAS by Kazushige Goto.They can be freely downloaded,but not redistributed.See the”GotoBLAS2”item at aa6749543c1ec5da50e2706a/tacc-projects/.

FFT Quantum ESPRESSO has an internal copy of an old FFTW version,and it can use the following vendor-speci?c FFT libraries:

IBM ESSL

SGI SCSL

SUN sunperf

NEC ASL

AMD ACML

configure will?rst search for vendor-speci?c FFT libraries;if none is found,it will search for an external FFTW v.3library;if none is found,it will fall back to the internal copy of FFTW.

If you have recent versions(v.10or later)of MKL installed,you may use the FFTW3 interface provided with MKL.This can be directly linked in MKL distributed with v.12of the Intel compiler.In earlier versions,only sources are distributed:you have to compile them and ta modify?le make.sys accordingly(MKL must be linked after the FFTW-MKL interface).

MPI libraries MPI libraries are usually needed for parallel execution(unless you are happy with OpenMP multicore parallelization).In well-con?gured machines,configure should?nd the appropriate parallel compiler for you,and this should?nd the appropriate libraries.Since often this doesn’t happen,especially on PC clusters,see Sec.2.7.6.

Other libraries Quantum ESPRESSO can use the MASS vector math library from IBM, if available(only on AIX).

2.4.1If optimized libraries are not found

The configure script attempts to?nd optimized libraries,but may fail if they have been in-stalled in non-standard places.You should examine the?nal value of BLAS LIBS,LAPACK LIBS, FFT LIBS,MPI LIBS(if needed),MASS LIBS(IBM only),either in the output of configure or in the generated make.sys,to check whether it found all the libraries that you intend to use.

If some library was not found,you can specify a list of directories to search in the envi-ronment variable LIBDIRS,and rerun configure;directories in the list must be separated by spaces.For example:

./configure LIBDIRS="/opt/intel/mkl70/lib/32/usr/lib/math"

15

If this still fails,you may set some or all of the*LIBS variables manually and retry.For example:

./configure BLAS_LIBS="-L/usr/lib/math-lf77blas-latlas_sse"

Beware that in this case,configure will blindly accept the speci?ed value,and won’t do any extra search.

2.5Compilation

There are a few adjustable parameters in Modules/parameters.f90.The present values will work for most cases.All other variables are dynamically allocated:you do not need to recompile your code for a di?erent system.

At your option,you may compile the complete Quantum ESPRESSO suite of programs (with make all),or only some speci?c programs.

make with no arguments yields a list of valid compilation targets.Here is a list:

?make pw produces PW/pw.x

pw.x calculates electronic structure,structural optimization,molecular dynamics.

?make neb produces the following codes in NEB/for NEB calculations:

–neb.x:calculates reaction barriers and pathways using NEB.

–path int.x:used by utility path int.sh that generates,starting from a path(a set

of images),a new one with a di?erent number of images.The initial and?nal points

of the new path can di?er from those in the original one.

?make ph produces the following codes in PH/for phonon calculations:

–ph.x:Calculates phonon frequencies and displacement patterns,dielectric tensors,

e?ective charges(uses data produced by pw.x).

–dynmat.x:applies various kinds of Acoustic Sum Rule(ASR),calculates LO-TO

splitting at q=0in insulators,IR and Raman cross sections(if the coe?cients have

been properly calculated),from the dynamical matrix produced by ph.x

–q2r.x:calculates Interatomic Force Constants(IFC)in real space from dynamical

matrices produced by ph.x on a regular q-grid

–matdyn.x:produces phonon frequencies at a generic wave vector using the IFC?le

calculated by q2r.x;may also calculate phonon DOS,the electron-phonon coe?cient

λ,the functionα2F(ω)

–lambda.x:also calculatesλandα2F(ω),plus T c for superconductivity using the

McMillan formula

?make d3produces D3/d3.x:calculates anharmonic phonon lifetimes(third-order deriva-tives of the energy),using data produced by pw.x and ph.x(USPP and PAW not sup-ported).

?make gamma produces Gamma/phcg.x:a version of ph.x that calculates phonons at q=0 using conjugate-gradient minimization of the density functional expanded to second-order.

Only theΓ(k=0)point is used for Brillouin zone integration.It is faster and takes less memory than ph.x,but does not support USPP and PAW.

16

?make pp produces several codes for data postprocessing,in PP/(see list below).

?make tools produces several utility programs in pwtools/(see list below).

?make pwcond produces PWCOND/pwcond.x for ballistic conductance calculations.

?make pwall produces all of the above.

?make ld1produces code atomic/ld1.x for pseudopotential generation(see speci?c doc-umentation in atomic doc/).

?make upf produces utilities for pseudopotential conversion in directory upftools/.

?make cp produces the Car-Parrinello code CPV/cp.x and the postprocessing code CPV/cppp.x.

?make all produces all of the above.

?make plumed uncompress and move/rename PLUMED,patches PW,CPV and clib routines and compiles PW and CPV.

?make w90uncompress and move/rename wannier90,copy an apropriates make.sys and produces W90/wannier90.x.

?make want uncompress and move/rename want,run want’s con?gure and produces all want executables in WANT/bin

?make yambo uncompress and move/rename yambo,run yambo’s con?gure and produces all yambo executables in YAMBO/bin.

For the setup of the GUI,refer to the PWgui-X.Y.Z/INSTALL?le,where X.Y.Z stands for the version number of the GUI(should be the same as the general version number).If you are using the CVS sources,see the GUI/README?le instead.

The codes for data postprocessing in PP/are:

?pp.x extracts the speci?ed data from?les produced by pw.x,prepares data for plotting by writing them into formats that can be read by several plotting programs.

?bands.x extracts and reorders eigenvalues from?les produced by pw.x for band structure plotting

?projwfc.x calculates projections of wavefunction over atomic orbitals,performs L¨o wdin population analysis and calculates projected density of states.These can be summed using auxiliary code sumpdos.x.

?plotrho.x produces PostScript2-d contour plots

?plotband.x reads the output of bands.x,produces PostScript plots of the band structure ?average.x calculates planar averages of quantities produced by pp.x(potentials,charge, magnetization densities,...)

?dos.x calculates electronic Density of States(DOS)

?epsilon.x calculates RPA frequency-dependent complex dielectric function

17

?pw2wannier.x:interface with Wannier90package

?wannier ham.x:generate a model Hamiltonian in Wannier functions basis

?pmw.x generates Poor Man’s Wannier functions,to be used in DFT+U calculations Note about Bader’s analysis:on aa6749543c1ec5da50e2706a/bader/one can?nd a soft-ware that performs Bader’s analysis starting from charge on a regular grid.The required ”cube”format can be produced by Quantum ESPRESSO using pp.x(info by aa6749543c1ec5da50e2706apenna who has successfully used this technique,but adds:“Problems occur with polar X-H bonds or in all cases where the zero-?ux of density comes too close to atoms described with pseudo-potentials”).This code should perform decomposition into Voronoi polyhedra as well,in place of obsolete code voronoy.x(removed from distribution since v.4.2).

The utility programs in pwtools/are:

?dist.x calculates distances and angles between atoms in a cell,taking into account periodicity

?ev.x?ts energy-vs-volume data to an equation of state

?kpoints.x produces lists of k-points

?pwi2xsf.sh,pwo2xsf.sh process respectively input and output?les(not data?les!)for pw.x and produce an XSF-formatted?le suitable for plotting with XCrySDen,a powerful crystalline and molecular structure visualization program(aa6749543c1ec5da50e2706a/).

BEWARE:the pwi2xsf.sh shell script requires the pwi2xsf.x executables to be located somewhere in your PATH.

?band plot.x:undocumented and possibly obsolete

?bs.awk,mv.awk are scripts that process the output of pw.x(not data?les!).Usage: awk-f bs.awkmyfile.bs

awk-f mv.awkmyfile.mv

The?les so produced are suitable for use with xbs,a very simple X-windows utility to display molecules,available at:

aa6749543c1ec5da50e2706a/cca/software/X-WINDOW/xbsa/README.shtml

?kvecs FS.x,bands FS.x:utilities for Fermi Surface plotting using XCrySDen

Other utilities VdW/contains the sources for the calculation of the?nite(imaginary)fre-quency molecular polarizability using the approximated Thomas-Fermi+von Weiz¨a cker scheme, contributed by H.-V.Nguyen(Sissa and Hanoi University).Compile with make vdw,executa-bles in VdW/vdw.x,no documentation yet,but an example in examples/example34.

18

2.6Running examples

As a?nal check that compilation was successful,you may want to run some or all of the examples.You should?rst of all ensure that you have downloaded and correctly unpacked the package containing examples(since v.4.1in a separate package):

tar-zxvf/path/to/package/espresso-X.Y.Z-examples.tar.gz

will unpack several subdirectories into espresso-X.Y.Z/.There are two di?erent types of examples:

?automated tests(in directories tests/and cptests/).Quick and exhaustive,but not meant to be realistic,implemented only for pw.x and cp.x.

?examples(in directory examples/).Cover many more programs and features of the Quantum ESPRESSO distribution,but they require manual inspection of the results.

Let us?rst consider the tests.Automated tests for pw.x are in directory tests/.File tests/README contains a list of what is tested.To run tests,follow the directions in the header if?le check pw.x.j,edit variables PARA PREFIX,PARA POSTFIX if needed(see below). Same for cp.x,this time in directory cptests/.

Let us now consider examples.A list of examples and of what each example does is contained in examples/README.For details,see the README?le in each example’s directory.If you?nd that any relevant feature isn’t being tested,please contact us(or even better,write and send us a new example yourself!).

To run the examples,you should follow this procedure:

1.Go to the examples/directory and edit the environment variables?le,setting the

following variables as needed:

BIN DIR:directory where executables reside

PSEUDO DIR:directory where pseudopotential?les reside

TMP DIR:directory to be used as temporary storage area

The default values of BIN DIR and PSEUDO DIR should be?ne,unless you have in-stalled things in nonstandard places.TMP DIR must be a directory where you have read and write access to,with enough available space to host the temporary?les produced by the example runs,and possibly o?ering high I/O performance(i.e.,don’t use an NFS-mounted directory).NOTA BENE:do not use a directory containing other data,the examples wil clean it!

2.If you have compiled the parallel version of Quantum ESPRESSO(this is the default

if parallel libraries are detected),you will usually have to specify a driver program(such as mpirun or mpiexec)and the number of processors:see Sec.3.2for details.In order to do that,edit again the environment variables?le and set the PARA PREFIX and PARA POSTFIX variables as needed.Parallel executables will be run by a command like this:

$PARA_PREFIX pw.x$PARA_POSTFIXfile.out

For example,if the command line is like this(as for an IBM SP):

19

poe pw.x-procs4file.out

you should set PARA PREFIX=”poe”,PARA POSTFIX=”-procs4”.Furthermore,if your machine does not support interactive use,you must run the commands speci?ed below through the batch queuing system installed on that machine.Ask your system administrator for instructions.

3.To run a single example,go to the corresponding directory(e.g.example/example01)

and execute:

./run_example

This will create a subdirectory results,containing the input and output?les generated by the calculation.Some examples take only a few seconds to run,while others may require several minutes depending on your system.To run all the examples in one go,execute:

./run_all_examples

from the examples directory.On a single-processor machine,this typically takes a few hours.The make clean script cleans the examples tree,by removing all the results sub-directories.However,if additional subdirectories have been created,they aren’t deleted.

4.In each example’s directory,the reference/subdirectory contains veri?ed output?les,

that you can check your results against.They were generated on a Linux PC using the Intel compiler.On di?erent architectures the precise numbers could be slightly di?erent, in particular if di?erent FFT dimensions are automatically selected.For this reason,a plain di?of your results against the reference data doesn’t work,or at least,it requires human inspection of the results.

2.7Installation tricks and problems

2.7.1All architectures

Working Fortran-95and C compilers are needed in order to compile Quantum ESPRESSO. Most“Fortran-90”compilers actually implement the Fortran-95standard,but older versions may not be Fortran-95compliant.Moreover,C and Fortran compilers must be in your PATH. If configure says that you have no working compiler,well,you have no working compiler,at least not in your PATH,and not among those recognized by configure.

If you get Compiler Internal Error’or similar messages:your compiler version is buggy. Try to lower the optimization level,or to remove optimization just for the routine that has problems.If it doesn’t work,or if you experience weird problems at run time,try to install patches for your version of the compiler(most vendors release at least a few patches for free), or to upgrade to a more recent compiler version.

If you get error messages at the loading phase that look like?le XYZ.o:unknown/not recognized/invalid/wrong?le type/?le format/module version,one of the following things have happened:

1.you have leftover object?les from a compilation with another compiler:run make clean

and recompile.

20

2.make did not stop at the?rst compilation error(it may happen in some software con-

?gurations).Remove the?le*.o that triggers the error message,recompile,look for a compilation error.

If many symbols are missing in the loading phase:you did not specify the location of all needed libraries(LAPACK,BLAS,FFTW,machine-speci?c optimized libraries),in the needed order. If only symbols from clib/are missing,verify that you have the correct C-to-Fortran bindings, de?ned in include/c defs.h.Note that Quantum ESPRESSO is self-contained(with the exception of MPI libraries for parallel compilation):if system libraries are missing,the problem is in your compiler/library combination or in their usage,not in Quantum ESPRESSO.

If you get mysterious errors in the provided tests and examples:your compiler,or your mathematical libraries,or MPI libraries,or a combination thereof,is very likely buggy.Al-though the presence of subtle bugs in Quantum ESPRESSO that are not revealed during the testing phase can never be ruled out,it is very unlikely that this happens on the provided tests and examples.

2.7.2Cray XT machines

Use./configure ARCH=crayxt4or else configure will not recognize the Cray-speci?c software environment.Older Cray machines:T3D,T3E,X1,are no longer supported.

2.7.3IBM AIX

On IBM machines with ESSL libraries installed,there is a potential con?ict between a few LAPACK routines that are also part of ESSL,but with a di?erent calling sequence.The appearance of run-time errors like ON ENTRY TO ZHPEV PARAMETER NUMBER1HAD AN ILLEGAL VALUE is a signal that you are calling the bad routine.If you have de?ned -D ESSL you should load ESSL before LAPACK:see variable LAPACK LIBS in make.sys. 2.7.4IBM BlueGene

The current configure is tested and works only on the machine at J¨u lich.For other sites,you should try something like

./configure ARCH=ppc64-bg BLAS_LIBS=aa6749543c1ec5da50e2706aPACK_LIBS=...\

SCALAPACK_DIR=...BLACS_DIR=..."

where the various*LIBS and*DIR”suggest”where the various libraries are located.

2.7.5Linux PC

Both AMD and Intel CPUs,32-bit and64-bit,are supported and work,either in32-bit emu-lation and in64-bit mode.64-bit executables can address a much larger memory space than 32-bit executable,but there is no gain in speed.Beware:the default integer type for64-bit machine is typically32-bit long.You should be able to use64-bit integers as well,but it will not give you any advantage and you may run into trouble.

Currently the following compilers are supported by configure:Intel(ifort),Portland (pgf90),g95,gfortran,Pathscale(pathf95),Sun Studio(sunf95),AMD Open64(openf95). The ordering approximately re?ects the quality of support.Both Intel MKL and AMD acml

21

本文来源:https://www.bwwdw.com/article/m5ce.html

Top