Self-Consistent Energy Calculations with QE
The calculations handled by pw.x include seven types, specified in the input file with calculation:
-
'scf': Self-consistent field (SCF) calculation, solving the differential-integral Kohn-Sham equations iteratively. Convergence is achieved when the change in charge density is small enough, resulting in self-consistent charge. -
'nscf': Non-self-consistent calculation, usually performed on a denser k-space grid for integrations like DOS. Uses self-consistent charge and computes properties for additional k-points. -
'bands': Another non-self-consistent calculation where k-points follow specific paths in 3D k-space. -
'relax': A series of SCF calculations for ionic relaxation based on Hellman-Feynman forces, optimizing atomic coordinates to minimize forces while keeping the cell fixed. -
'vc-relax': Similar to relax but allows the cell to vary based on stress calculations. -
'md': Molecular dynamics simulation, treating the ion-electron interaction as a potential for ionic motion and solving the classical equations of motion for ions. -
'vc-md': Molecular dynamics with cell variation.
Input File
In QE input files, there are NAMELISTS and INPUT_CARDS.
PWscf requires three mandatory NAMELISTS:
-
&CONTROL: Specifies the calculation flow. -
&SYSTEM: Describes the system. -
&ELECTRONS: Defines the algorithm for solving the Kohn-Sham equations.
Two additional NAMELISTS, &IONS and &CELLS, are needed for specific calculations.
The three mandatory INPUT_CARDS in PWscf are ATOMIC_SPECIES, ATOMIC_POSITIONS, and K_POINTS. Other information may be required depending on the calculation.
Example: Self-Consistent Calculation for Silicon (pw.scf.silicon.in)
&CONTROL
calculation='scf', # Self-consistent field calculation
prefix='silicon', # Prefix for output files
pseudo_dir='./pseudo/', # Directory for pseudopotentials
outdir='./out/', # Directory for output files
/
&SYSTEM
ibrav=2, # Bravais lattice type (FCC)
celldm(1)=10.2625, # Lattice constant (in Bohr, 1 Bohr = 0.529 Å)
nat=2, # Number of atoms
ntyp=1, # Number of atomic types
ecutwfc=60.0, # Wavefunction cutoff energy (in Ry, 1 Ry = 13.606 eV)
ecutrho=720.0, # Charge density cutoff energy
/
&ELECTRONS
mixing_beta=0.7, # Mixing ratio for charge density (default 0.7)
conv_thr=1d-8, # Convergence threshold for SCF (default 1d-6)
/
ATOMIC_SPECIES
Si 28.0855 Si.pbe-rrkj.UPF # Pseudopotential
ATOMIC_POSITIONS (alat) # Atomic positions (alat = lattice parameter)
Si 0.00 0.00 0.00
Si 0.25 0.25 0.25
K_POINTS automatic # Automatic k-point grid
4 4 4 1 1 1
-
ibrav: Values from 1–14 correspond to the 14 Bravais lattices; 0 for free lattice. -
ecutwfc: Suggested value depends on the pseudopotential used. -
ecutrho: Related toecutwfc:- For NC pseudopotentials, this is 4×
ecutwfc. - For US pseudopotentials, this is 8–12×
ecutwfc. - For PAW pseudopotentials, this is 4×
ecutwfc.
- For NC pseudopotentials, this is 4×
- File saved as
pw.scf.silicon.in. - Suggested settings:
occupations='smearing', smearing='gaussian', degauss=1d-9for Gaussian smearing.
Refer to the PWscf User Manual for a detailed explanation.
Execution
mpirun -np 4 pw.x -inp pw.scf.silicon.in > pw.scf.silicon.out
Output File
Check the output file pw.scf.silicon.out for convergence details:
grep -e 'total energy' -e estimate pw.scf.silicon.out
Example:
Self-consistent Calculation
iteration # 1 ecut= 16.00 Ry beta= 0.70
Davidson diagonalization with overlap
ethr = 1.00E-02, avg # of iterations = 2.0
Threshold (ethr) on eigenvalues was too large:
Diagonalizing with lowered threshold
Davidson diagonalization with overlap
ethr = 6.93E-04, avg # of iterations = 1.0
total cpu time spent up to now is 0.3 secs
total energy = -15.83539933 Ry
estimated scf accuracy < 0.06071141 Ry
iteration # 2 ecut= 16.00 Ry beta= 0.70
Davidson diagonalization with overlap
ethr = 7.59E-04, avg # of iterations = 1.0
total cpu time spent up to now is 0.4 secs
total energy = -15.83851631 Ry
estimated scf accuracy < 0.00218630 Ry
iteration # 3 ecut= 16.00 Ry beta= 0.70
Davidson diagonalization with overlap
ethr = 2.73E-05, avg # of iterations = 2.3
total cpu time spent up to now is 0.4 secs
total energy = -15.83897965 Ry
estimated scf accuracy < 0.00007075 Ry
iteration # 4 ecut= 16.00 Ry beta= 0.70
Davidson diagonalization with overlap
ethr = 8.84E-07, avg # of iterations = 2.6
total cpu time spent up to now is 0.4 secs
total energy = -15.83900178 Ry
estimated scf accuracy < 0.00000211 Ry
iteration # 5 ecut= 16.00 Ry beta= 0.70
Davidson diagonalization with overlap
ethr = 2.64E-08, avg # of iterations = 3.6
total cpu time spent up to now is 0.4 secs
total energy = -15.83900299 Ry
estimated scf accuracy < 0.00000012 Ry
iteration # 6 ecut= 16.00 Ry beta= 0.70
Davidson diagonalization with overlap
ethr = 1.46E-09, avg # of iterations = 2.7
total cpu time spent up to now is 0.4 secs
End of self-consistent calculation
Important notes:
- The total energy depends on the selected pseudopotential.
- Convergence is achieved in 6 iterations.
! total energy = -15.83900302 Ry
estimated scf accuracy < 3.2E-10 Ry
The total energy is the sum of the following terms:
one-electron contribution = 4.79863652 Ry
hartree contribution = 1.07565897 Ry
xc contribution = -4.81353993 Ry
ewald contribution = -16.89975858 Ry
convergence has been achieved in 6 iterations
Tips
- Reduce
mixing_betafor oscillating convergence. - Increase cutoff energies (
ecutwfc,ecutrho). - Use recommended pseudopotentials.
- Suggested
conv_thrvalues:- Energy and eigenvalues (SCF): 1.0d-7 Ry.
- Forces (relax): 1.0e-8 Ry.
- Stress (vc-relax): 1.0d-9 Ry.
Additional Details
- Exchange-correlation used in the calculation:
Exchange-correlation= SLA PZ NOGX NOGC
- Total plane waves used (e.g., 1067):
sticks: dense smooth PW G-vecs: dense smooth PW
Sum 433 433 139 5961 5961 1067
- Number of Kohn-Sham states:
number of electrons = 8.00
number of Kohn-Sham states= 8
Enjoy Reading This Article?
Here are some more articles you might like to read next: