Download presentation
Presentation is loading. Please wait.
Published byGabriella Assunção Galindo Modified over 6 years ago
1
PWscf, FPMD and CP (Democritos Package) Tutorial
Carlo Cavazzoni (High Performance Computing Group) CINECA 16/11/2018
2
Outline ab-initio simulations introduction
PWSCF and Democritos package Installation Functionality Simple examples 16/11/2018
3
The scope of computer simulation
Measure theories. Solve equations which could not be solved otherwise. “Get numbers out of theories” much in the same way as experiments “get numbers out of a natural process” Do virtual experiments where experimental conditions can be controlled down to the atomic scale in ways which would not be possible in the lab
4
The Born-Oppenheimer approximation (M>>m)
Ab initio simulations The Born-Oppenheimer approximation (M>>m)
5
Density functional theory
Kohn-Sham Hamiltonian
6
Kohn-Sham equations from functional minimization
Helmann & Feynman Kohn & Sham
7
The tricks of the trade Expanding the Kohn-Sham orbitals into a suitable basis set turns DFT into a multi-variate minimization problem, and the KS equation into a non-linear matrix eigenvalue problem The use of pseudo-potentials allows to ignore chemically inert core states and to use plane waves (the name of the game!)
8
The tricks of the trade (II)
Plane waves are orthogonal and the matrix elements are usually easy to calculate; the effective completeness of the basis is easy to check Plane-waves allow to calculate efficiently matrix-vector products and to solve the Poisson equation using FFT’s Supercells for treating finite (or semi-infinite) systems Iterative diagonalization vs. global minimization
9
The tricks of the trade (III)
Summing over occupied states: special-point and Gaussian-smearing techniques Non-linear extrapolation for SCF acceleration and density prediction in MD Choice of fictitious masses in CP dynamics
10
Which algorithm shall I use?
Electronic structure: SCF diagonalization vs. energy minimization Geometry optimization: standard DFT Lattice vibrations, static response functions: DF perturbation theory Dynamics: Car-Parrinello vs. Born-Oppenheimer Slow kinetics and rare events: path sampling vs. Parrinello-Laio metadynamics Optical properties, excited states: Time-dependent DFT & many-body perturbation theory
11
PWSCF and Democritos (www.democritos.it)
(DEmocritos MOdeling Center for Research in aTOmistic Simulatios) Democritos is a National Simulation Center of the Italian Istituto Nazionale per la Fisica della Materia (INFM). Hosted by SISSA in Trieste PWSCF is promoted, maintained and developed by Democritos CINECA is a Partner of Democritos. 16/11/2018
12
Democritos and Scientific Software
GOAL: Development of software for next generation parallel computers (N>10000 processors) Production of high-quality software package for atomistic simulations based on density-functional theory (DFT), plane wave (PW) and pseudopotentials (PP) 16/11/2018
13
PWSCF is also part of a merge effort of pre-existing scientific software
PWscf package: electronic structure, structural optimization, molecular dynamics, vibrational and dielectric properties. Developed by S. Baroni, S. de Gironcoli, A. Dal Corso (SISSA, Trieste), P. Giannozzi (Scuola Normale, Pisa) and others. See for more information and downloads. CP code: Car-Parrinello variable-cell molecular dynamics. Developed by A. Pasquarello (IRRMA, Lausanne), K. Laasonen (Oulu), A. Trave (UCBerkeley), R. Car (Princeton), P. Giannozzi and others. Based on the original code written by R. Car and A. Pasquarello. Download CP (initial public release) FPMD code: Car-Parrinello variable-cell molecular dynamics. Developed by C. Cavazzoni (CINECA, Bologna), S. Scandolo (ICTP, Trieste), G. Chiarotti (SISSA, Trieste), P. Focher, G. Ballabio and others. Based on the original code written by R. Car and M. Parrinello. Download FPMD (initial public release) GNU License 16/11/2018
14
Present Package Status
The Package is developed in Fortran90 The codes in the Package share: installation most parts of the basic code input format PP format a graphical GUI is being developed output format (CP/FPMD fully compatible/restartable) 16/11/2018
15
Basic Data Type Charge density 3D arrays Wave functions 1D arrays
Real space Charge density 3D arrays Wave functions 1D arrays Reciprocal space 16/11/2018
16
Reciprocal Space Representation
Wave Functions To truncate the infinite sum Charge Density To retain the same accurancy as the wave function 16/11/2018
17
DFT Functional 16/11/2018
18
FFTs Reciprocal Space FFT Real Space |G|2/2< Ecut |G|2/2< 4Ecut
16/11/2018
19
Parallelization Reciprocal Space distribution
PWSCF parallelize also over K-points 16/11/2018
20
Parallelization FFT algorithm
16/11/2018
21
SP4, optimization issues
use essl use non-blocking communications use mass modify strides to reduce TLB misses use block-algorithm whenever possible ATLAS strategy 16/11/2018
22
Case study: matrix transposition
do ib = 1, nb ioff = (ib-1) * bsiz do jb = 1, mb joff = (jb-1) * bsiz do j = 1, bsiz do i = 1, bsiz buf(i,j) = x(i+ioff, j+joff) enddo do i = 1, j-1 bswp = buf(i,j) buf(i,j) = buf(j,i) buf(j,i) = bswp do i=1,bsiz do j=1,bsiz y(j+joff, i+ioff) = buf(j,i) do i=1,n do j=1,m y(j,i) = x(i,j) enddo block-algorithm bsiz = block size nb = n / bsiz mb = n / bsiz more code for reminder: MOD(n / bsiz) /= 0 OR MOD(m / bsiz) /= 0 16/11/2018
23
Block algorithm for matrix transposition
80 70 60 50 Mips 40 30 20 10 20 40 60 80 100 120 block dimension 16/11/2018
24
CP code Verlet dynamics with mass preconditioning
Developed by A. Pasquarello (IRRMA, Lausanne), K. Laasonen (Oulu), A. Trave (UCBerkeley), R. Car (Princeton), P. Giannozzi and others. Based on the original code written by R. Car and A. Pasquarello. Verlet dynamics with mass preconditioning Temperature control: Nose’ thermostat, velocity rescaling Metallic systems: Nose’ thermostat for both electrons and ions electronic and ionic minimization via damped dynamics Modified kinetic functional for costant-pressure calculations “grid box” for fast treatment of augmentation terms in Ultrasoft PP’s Nudget Elastic Band (NEB) scheme for transition paths and energy barriers Limitations: no k-points no fancier minimization chemes no constraints 16/11/2018
25
FPMD code Verlet dynamics with mass preconditioning
Developed by C. Cavazzoni (CINECA, Bologna), S. Scandolo (ICTP, Trieste), G. Chiarotti (SISSA, Trieste), P. Focher, G. Ballabio and others. Based on the original code written by R. Car and M. Parrinello. Verlet dynamics with mass preconditioning Temperature control: Nose’ thermostat, velocity rescaling Metallic systems: Nose’ thermostat for both electrons and ions Various electronic and ionic minimization schemes Modified kinetic functional for costant-pressure calculations Macroscopic polarization via Berry Phase Nudget Elastic Band (NEB) scheme for transition paths and energy barriers Constrained dynamics Limitations: no Ultrasoft PP’s 16/11/2018
26
PWSCF code Self-consistent ground-state energy and Kohn-Sham orbitals
Developed by S. Baroni, S. de Gironcoli, A. Dal Corso (SISSA, Trieste), P. Giannozzi (Scuola Normale, Pisa) and others. Self-consistent ground-state energy and Kohn-Sham orbitals Structural optimization Molecular dynamics on the ground-state Born-Oppenheimer surface Variable-cell molecular dynamics Phonon frequencies and eigenvectors at a generic wave vector Effective charges and dielectric tensors Electron-phonon interaction coefficients for metals Third-order anharmonic phonon lifetimes Macroscopic polarization via Berry Phase Nudget Elastic Band (NEB) scheme for transition paths and energy barriers Limitations: no Car-Parrinello dynamics very limited constrained minimization and dynamics 16/11/2018
27
Access the anonymous CVS of the Democritos PW-PP-DFT Package
anonymous CVS contains the whole package, with all the codes (tcsh/csh): setenv CVS_RSH ssh setenv CVSROOT (sh/bash): export CVS_RSH=ssh export Then: cvs login (password: cvsanon). For the first code download: cvs co O-sesame Open-Sesame: Open-Source Scalable Electronic Structure and Atomistic Modeling Environment 16/11/2018
28
Installation ./configure make target 16/11/2018
where target is one of the following: pw basic code for scf, structure optimization, MD fpmd FPMD code for Car-Parrinello MD cp CP code: CP MD with ultrasoft pseudopotentials ph phonon code pp postprocessing programs gamma Gamma-only version of phonon code nc non collinear magnetic version of pw code pwcond ballistic conductance d third-order derivatives tools misc tools for data analysis upf utilities for pseudopotential conversion pwall same as "make pw ph pp gamma nc pwcond d3 tools" all same as "make pwall fpmd cp upf" links creates links to executables in bin/ clean remove executables and objects veryclean revert distribution to the original status tar create a tarball of the source tree tar-gui create a tarball of the GUI sources 16/11/2018
29
Installation (DEMO) how to configure configure? 16/11/2018
30
Directories tree I/II include Modules clib flib upftools CPV FPMD PW
includes files Modules clib flib upftools common modules, subroutine and tools CPV FPMD PW main codes directories D3 PH PP pw post-processing codes 16/11/2018
31
Directories tree II/II
pwdocs cpdocs documentation pseudo pseudopotential library install preconfigured installation parameter files cp_examples pw_examples run examples 16/11/2018
32
Input files PWscf, CP and FPMD share the same input files format
All codes read input parameters from standard input Codes read from files PP data, all codes read the same PP files In directory upftools there are conversion tools for PP formats (there is one also for CPMD) 16/11/2018
33
Standard Input Layout The standard input is divided in two main section the first contains fortran namelists the seconds contains optional input “CARDS” all input parameter are described in cpdocs and pwdocs file. all input parameter for all codes are contained in file Modules/input_parameters.f90 16/11/2018
34
layout namelists cards the namelist order is fixed, but within a
&CONTROL control_parameter_1, control_parameter_2, / &SYSTEM sistem_parameter_1, sistem_parameter_2, &ELECTRONS electrons_parameter_1, electrons_parameter_2, &IONS ions_parameter_1, ions_parameter_2, &CELL cell_parameter_1, cell_parameter_2, ‘ATOMIC_SPECIES’ label_1 mass_1 pseudo_file_1 label_2 mass_2 pseudo_file_2 ..... ‘ATOMIC_POSITIONS’ label_1 px_1 py_1 pz_1 label_2 px_2 py_2 pz_2 the namelist order is fixed, but within a namelist the parameter sequence is irrelevant namelists card order is irrelevant, but within a card the parameter layout is fixed cards 16/11/2018
35
Input Namelists &CONTROL input variables that control the flux of teh calculation and the amount of I/O on disk and on the screen &SYSTEM input variables that specify the system under study &ELECTRONS input variables that control the algorithms used to reach the self-consistent solution of KS equations for the electrons, and the electrons dynamics (for CP and FPMD) &IONS input variables that control ionic motion in molecular dynamics run or structural relaxation &CELL input variables that control cell-shape evolution in a variable-cell MD run or structural relaxation 16/11/2018
36
Input Cards ATOMIC_SPECIES name, mass and pseudopotential used for each atomic species present in the system ATOMIC_POSITIONS type and coordinate of each atom in the unit cell K_POINTS coordinate and weights of the k-points used for BZ integration CELL_PARAMETERS … OCCUPATIONS … CLINBING_IMAGES … 16/11/2018
37
Silicon Band Structure (www.cineca.it/~acv0/Public/PWSCF_Tutorial.tgz)
Select the appropriate unit cell Input the atomic coordinate Choose the pseudopotentials Determine k-point sampling Select the size of the basis set (Ecut) 16/11/2018
38
Select the appropriate unit cell
ibrav bravais lattice celldm(.) cell parameters celldm(1) = a, celldm(2) = b/a, celldm(3) = c/a celldm(4) = cos(bc) celldm(5) = cos(ac) celldm(6) = cos(ab) ibrav structure celldm(2)-celldm(6) "free", see above not used cubic P (sc) not used cubic F (fcc) not used cubic I (bcc) not used Hexagonal and Trigonal P celldm(3)=c/a Trigonal R celldm(4)=cos(aalpha) Tetragonal P (st) celldm(3)=c/a Tetragonal I (bct) celldm(3)=c/a Orthorhombic P celldm(2)=b/a, celldm(3)=c/a Orthorhombic base-centered(bco) celldm(2)=b/a, Orthorhombic face-centered celldm(2)=b/a, Orthorhombic body-centered celldm(2)=b/a, Monoclinic P celldm(2)=b/a, celldm(3)=c/a, celldm(4)=cos(ab) Monoclinic base-centered celldm(2)=b/a Triclinic P celldm(2)= b/a, celldm(3)= c/a, celldm(4)= cos(bc), celldm(5)= cos(ac), celldm(6)= cos(ab) 16/11/2018
39
Unit cell ibrav = 2, cubic fcc ibrav = 1, simple cubic 16/11/2018
40
Unit cell (supercells)
ibrav = 1, simple cubic (crystal with defects) ibrav = 6, tetragonal (surfaces) 16/11/2018
41
Silicon Crystal unit cell
&control prefix='silicon', pseudo_dir = '$PSEUDO_DIR/', outdir='$TMP_DIR/' / &system ibrav= 2, celldm(1) =10.20, nat= 2, ntyp= 1, ecutwfc =12.0, &electrons empty namelist, keep default values for Self-Consistent Field iterations 16/11/2018
42
Atomic Positions ATOMIC_POSITION (units)
units: if units is not specified, unit of “celldm(1)” is assumed units = bohr position in Bohr radius units = angstrom position in Angstrom units = crystal position in crystal coord. ATOMIC_SPECIES Si Si.vbc.UPF ATOMIC_POSITIONS Si Si 16/11/2018
43
K-points set Automatic User specified K_POINTS (automatic) 2 2 2 1 1 1
k-points grid grid off-set K_POINTS 2 User specified number of k-points k-points weight k-points coordinate (crystal coord.) start with coarse grid, then try finer ones to check convergence 16/11/2018
44
Input for Silicon Crystal SCF calculation
&control prefix='silicon', pseudo_dir = '$PSEUDO_DIR/', outdir='$TMP_DIR/' / &system ibrav= 2, celldm(1) =10.20, nat= 2, ntyp= 1, ecutwfc =12.0, &electrons ATOMIC_SPECIES Si Si.vbc.UPF ATOMIC_POSITIONS Si Si K_POINTS 2 pw.x < inputfile 16/11/2018
45
Non SCF calculation To compute band structure, we need the value of
eigenvectors on all k-point of the bands. If the computation is converged with respect to the k-points grid, we do not need to repeat the SCF calculation on all k-points of the bands, but we can diagonalize the Hamiltonian using the SCF Kohn-Sham potential. 16/11/2018
46
Input for Non SCF calculation
&control calculation='nscf' pseudo_dir = '$PSEUDO_DIR/', outdir='$TMP_DIR/', prefix='silicon' / &system ibrav= 2, celldm(1) =10.20, nat= 2, ntyp= 1, ecutwfc =12.0, nbnd = 8, &electrons ATOMIC_SPECIES Si Si.vbc.UPF ATOMIC_POSITIONS Si Si K_POINTS … 16/11/2018
47
K-points set along high symmetry lines
# band structure calculation along delta, sigma and lambda lines K_POINTS 36 16/11/2018
48
Post Processing bands.x < inputfile
&inputpp prefix = 'silicon' outdir = '$TMP_DIR/' filband = 'sibands.dat' / bands.x < inputfile prints the bands to graphical files sibands.dat sibands.xmgr sibands.ps 6.3369 plotband.x < inputfile 16/11/2018
49
the silicon bands! 16/11/2018
50
How to find equilibrium lattice parameters
different scf computation, changing cut-off and lattice parameter 16/11/2018
51
Plot Charge Density 1) 2) 3)
# post-processing for charge density cat > si.pp_rho.in << EOF &inputpp prefix = 'silicon' outdir = '$TMP_DIR/' filplot = 'sicharge' plot_num= 0 / EOF ./pp.x < si.pp_rho.in > si.pp_rho.out 1) # chdens cat > si.chdens.in << EOF &input nfile = 1 filepp(1) = 'sicharge' weight(1) = 1.0 iflag = 2 plot_out = 1 output_format = 2 fileout = 'si.rho.dat' e1(1) =1.0, e1(2)=1.0, e1(3) = 0.0, e2(1) =0.0, e2(2)=0.0, e2(3) = 1.0, nx=56, ny=40 / EOF ./chdens.x < si.chdens.in > si.chdens.out 2) cat > si.plotrho.in << EOF si.rho.dat si.rho.ps n EOF ./plotrho.x < si.plotrho.in > si.plotrho.out 3) 16/11/2018
52
Charge Density 16/11/2018
53
MD - Molecular Dynamics
Stop accumulate statistics (RDF, Energies, MSD, ecc..) Initial configuration calculate forces update atomic positions 16/11/2018
54
DFT - Solution of the KS equation.
trial n(r) build VKS solve [-1/22+VKS]i = ii |nnew-nold|<nthr ? groud state calculate nnew(r) = ∑fi|i|2 nold = nnew yes no 16/11/2018
55
AIMD ab-Initio Molecular Dynamics Born-Oppenheimer MD
Stop accumulate statistics Initial configuration Solve the DFTproblem Egs[{RI}] update atomic positions calculate forces FI=∂Egs[{RI}] /∂RI 16/11/2018
56
CPMD Car-Parrinello Molecular Dynamics
Stop accumulate statistics Initial configuration Solve the DFTproblem Egs[{RI}, {i}] update wave functions i ionic forces FI = - ∂Etot[{RI}] / ∂RI update atomic positions RI electronic forces F i = - ∂Etot[{RI}, {i}] / ∂i* 16/11/2018
57
Car-Parrinello Lagrangian
(deformable cell extension) Density Functionl Energy Diagonal in Fourier space Diagonal in Real space Computationally it is convenient to calculate quantities in the space where they are diagonal 16/11/2018
58
Equations of motion Electrons treated as classical scalar fields, follow adiabatically the ions remaining close to the ground state. Ions in scaled coordinates, move along the Born Oppenheimer surface Cell shape is driven by the imbalance of internal stress and external pressure p. 16/11/2018
59
CINECA/Democritos CP Code
FORM NLRH Pseudopotential Form factors RHOOFR (r) = |(r)|2 VOFRHO PRESS V(R, ) = VrDFT(R, (r)) + VGDFT(R, (G)) FORCE Forces on the electrons: F ORTHO Orthogonalize wave functions: 16/11/2018
60
A CP simulation require usually many RUNs and JOBs
Minimize the Electronic degrees of freedom ( d.o.f. ) Minimize the ionic d.o.f. Randomize ionic d.o.f. Re-minimize Electronic d.o.f Move Electronic and Ionic d.o.f. using Verlet to integrate the equations of motion Change temperature using thermostat Accumulate statistics for few picoseconds of simulated time ( – time steps ) 16/11/2018
61
Electronic Minimization I/II
&CONTROL title = ' Water Molecule ', calculation = 'cp', restart_mode = 'from_scratch', prefix = 'h2o_mol‘ nstep = 50, dt = 5.0d0, etot_conv_thr = 1.d-9, ekin_conv_thr = 1.d-4, / &SYSTEM ibrav = 1, celldm(1) = 10.0, nat = 3, ntyp = 2, nbnd = 4, nelec = 8, ecutwfc = 70.0, xc_type = 'BLYP' CP time step (in a.u.) number of CP step convergence threshold, effective only for minimization Simulation Cell (in a.u.) number of bands, and electrons number of atom, and species Energy cut-off, in Rydberg Exchange and correlation functional 16/11/2018
62
Electronic Minimization II/II
&ELECTRONS emass = 400.d0, emass_cutoff = 2.5d0, orthogonalization = 'ortho', electron_dynamics = 'sd', / &IONS ion_dynamics = 'none', ATOMIC_SPECIES O 16.0d0 O.BLYP.UPF 4 H 1.00d0 H.fpmd.UPF 4 ATOMIC_POSITIONS (bohr) O H H Fictitious electron mass (a.u.) m parameter in CP dynamic orthogonalization algorithm ‘ortho’ or 'Gram-Schmidt' PW Energy cut-off (in Rydberg) for Fourier Acceleration electron dynamics sd -> steepest descend cg -> conjugate gradient damp -> damped verlet -> Verlet Label Mass (uma) PP ion dynamics none -> kept fixed sd -> steepest descend cg -> conjugate gradient damp -> damped verlet -> Verlet Label x y z 16/11/2018
63
CP – Dynamics I/II verlet should be used for ions and electrons
&CONTROL title = ' Water Molecule ', calculation = 'cp', restart_mode = ‘restart', nstep = 50, dt = 5.0d0, prefix = 'h2o_mol' / &SYSTEM ibrav = 1, celldm(1) = 10.0, nat = 3, ntyp = 2, nbnd = 4, nelec = 8, ecutwfc = 70.0, xc_type = 'BLYP' &ELECTRONS emass = 400.d0, emass_cutoff = 2.5d0, orthogonalization = 'ortho', electron_dynamics = ‘verlet', electron_velocities = ‘zero’ verlet should be used for ions and electrons &IONS ion_dynamics = ‘verlet', ion_velocities = ‘zero’ / ATOMIC_SPECIES O 16.0d0 O.BLYP.UPF 4 H 1.00d0 H.fpmd.UPF 4 ATOMIC_POSITIONS (bohr) O H H in the very first run of dynamics velocities should be set to zero 16/11/2018
64
CP – Dynamics II/II ( thermostat )
&CONTROL title = ' Water Molecule ', calculation = 'cp', restart_mode = ‘restart', nstep = 50, dt = 5.0d0, prefix = 'h2o_mol' / &SYSTEM ibrav = 1, celldm(1) = 10.0, nat = 3, ntyp = 2, nbnd = 4, nelec = 8, ecutwfc = 70.0, xc_type = 'BLYP' &ELECTRONS emass = 400.d0, emass_cutoff = 2.5d0, orthogonalization = 'ortho', electron_dynamics = ‘verlet', Termostat temperature and frequency tempw ( Kelvin ) fnosep ( THz ) &IONS ion_dynamics = ‘verlet', ion_temperature = ‘nose’ tempw = 300, fnosep = 70.0 / ATOMIC_SPECIES O 16.0d0 O.BLYP.UPF 4 H 1.00d0 H.fpmd.UPF 4 ATOMIC_POSITIONS (bohr) O H H 16/11/2018
65
Parrinello-Rahman Dynamics
&CONTROL title = ' Water Molecule ', calculation = ‘vc-cp', restart_mode = ‘restart', nstep = 50, dt = 5.0d0, prefix = 'h2o_mol' / &SYSTEM ibrav = 1, celldm(1) = 10.0, nat = 3, ntyp = 2, nbnd = 4, nelec = 8, ecutwfc = 70.0, xc_type = 'BLYP' &ELECTRONS emass = 400.d0, emass_cutoff = 2.5d0, orthogonalization = 'ortho', electron_dynamics = ‘verlet', change the calculation type (variable cell cp) &IONS ion_dynamics = ‘verlet', / &CELL cell_dynamics = ‘pr’, press = 0.0 ATOMIC_SPECIES O 16.0d0 O.BLYP.UPF 4 H 1.00d0 H.fpmd.UPF 4 ATOMIC_POSITIONS (bohr) O H H Add the CELL namelists, with cell dynamics: pr -> parrinello rahman sd -> steepest descent damp -> damped external pressure (Kbar) 16/11/2018
66
high pressure – high temperature water phase diagram
C.Cavazzoni, G.L. Chiarotti, S.Scandolo, E.Tosatti, M.Bernasconi, and M. Parrinello “Superprotonic and metallic states of water and ammonia at giant planet conditions”, Science.283, 44 (1999). 16/11/2018
67
ionic trajectory at finite temperature
H trajectories in the superionic phase 16/11/2018
68
Run on SP4 - Water128 16/11/2018
69
Run on SP4 - Water32 16/11/2018
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.