Note
Go to the end to download the full example code.
Flow for QHA calculations v-ZSISA-QHA
See [Phys. Rev. B 110, 014103](https://doi.org/10.1103/PhysRevB.110.014103)
Downloading repository from: https://github.com/PseudoDojo/ONCVPSP-PBEsol-PDv0.4/archive/refs/heads/master.zip ...
Installing ONCVPSP-PBEsol-SR-PDv0.4 in: /home/runner/.abinit/pseudos/ONCVPSP-PBEsol-SR-PDv0.4
0.00iB [00:00, ?iB/s]
787kiB [00:00, 7.58MiB/s]
1.62MiB [00:00, 7.57MiB/s]
2.40MiB [00:00, 7.23MiB/s]
3.15MiB [00:00, 7.01MiB/s]
3.87MiB [00:00, 6.98MiB/s]
4.59MiB [00:00, 6.81MiB/s]
5.39MiB [00:00, 7.04MiB/s]
6.21MiB [00:00, 6.95MiB/s]
6.94MiB [00:00, 6.95MiB/s]
7.67MiB [00:01, 6.83MiB/s]
8.42MiB [00:01, 6.66MiB/s]
9.23MiB [00:01, 6.67MiB/s]
10.1MiB [00:01, 7.02MiB/s]
10.9MiB [00:01, 6.95MiB/s]
11.6MiB [00:01, 6.77MiB/s]
12.4MiB [00:01, 6.73MiB/s]
13.2MiB [00:01, 6.66MiB/s]
14.0MiB [00:02, 6.60MiB/s]
14.9MiB [00:02, 6.61MiB/s]
15.8MiB [00:02, 6.77MiB/s]
16.6MiB [00:02, 6.89MiB/s]
17.4MiB [00:02, 6.96MiB/s]
18.2MiB [00:02, 6.90MiB/s]
19.0MiB [00:02, 6.91MiB/s]
19.9MiB [00:02, 7.08MiB/s]
20.6MiB [00:03, 6.64MiB/s]
21.5MiB [00:03, 6.98MiB/s]
22.3MiB [00:03, 7.11MiB/s]
23.1MiB [00:03, 6.80MiB/s]
23.9MiB [00:03, 7.22MiB/s]
24.7MiB [00:03, 7.25MiB/s]
25.5MiB [00:03, 7.13MiB/s]
26.3MiB [00:03, 6.98MiB/s]
27.1MiB [00:03, 6.74MiB/s]
27.9MiB [00:04, 6.85MiB/s]
28.7MiB [00:04, 6.97MiB/s]
29.5MiB [00:04, 7.01MiB/s]
30.3MiB [00:04, 7.01MiB/s]
31.1MiB [00:04, 7.04MiB/s]
31.9MiB [00:04, 7.13MiB/s]
32.7MiB [00:04, 7.06MiB/s]
33.5MiB [00:04, 7.09MiB/s]
34.5MiB [00:04, 7.30MiB/s]
35.4MiB [00:05, 6.98MiB/s]
36.3MiB [00:05, 7.40MiB/s]
37.1MiB [00:05, 7.38MiB/s]
37.8MiB [00:05, 7.01MiB/s]
38.6MiB [00:05, 6.05MiB/s]
39.8MiB [00:05, 7.12MiB/s]
40.6MiB [00:05, 7.39MiB/s]
41.4MiB [00:05, 7.29MiB/s]
41.6MiB [00:05, 6.99MiB/s]
Validating md5 checksums of ONCVPSP-PBEsol-SR-PDv0.4...
Checksum test: OK
Installation completed successfully in 7.15 [s]
scf_input
##############################################
#### SECTION: basic
##############################################
ecut 18.0
nband 4
nstep 100
tolvrs 1e-08
ngkpt 2 2 2
kptopt 1
nshiftk 1
shiftk 0 0 0
##############################################
#### SECTION: files
##############################################
indata_prefix "indata/in"
tmpdata_prefix "tmpdata/tmp"
outdata_prefix "outdata/out"
pseudos "/home/runner/.abinit/pseudos/ONCVPSP-PBEsol-SR-PDv0.4/Si/Si.psp8"
##############################################
#### SECTION: gstate
##############################################
nline 10
nbdbuf 0
##############################################
#### SECTION: rlx
##############################################
ecutsm 1.0
##############################################
#### STRUCTURE
##############################################
natom 2
ntypat 1
typat 1 1
znucl 14
xred
0.0000000000 0.0000000000 0.0000000000
0.2500000000 0.2500000000 0.2500000000
acell 1.0 1.0 1.0
rprim
6.3285005287 0.0000000000 3.6537614838
2.1095001762 5.9665675181 3.6537614838
0.0000000000 0.0000000000 7.3075229676
#<JSON>
#{
# "pseudos": [
# {
# "@module": "pymatgen.io.abinit.pseudos",
# "@class": "NcAbinitPseudo",
# "basename": "Si.psp8",
# "type": "NcAbinitPseudo",
# "symbol": "Si",
# "Z": 14,
# "Z_val": 4.0,
# "l_max": 2,
# "md5": "926731724df1b06af70b3ef370bdc1e4",
# "filepath": "/home/runner/.abinit/pseudos/ONCVPSP-PBEsol-SR-PDv0.4/Si/Si.psp8"
# }
# ]
#}
#</JSON>
import sys
import os
import abipy.abilab as abilab
import abipy.data as abidata
from abipy import flowtk
from abipy.flowtk.vzsisa import VzsisaFlow
def build_flow(options):
"""
Create a `VzsisaFlow`.
"""
# Working directory (default is the name of the script with '.py' removed and "run_" replaced by "flow_")
if not options.workdir:
__file__ = os.path.join(os.getcwd(), "run_qha_vzsisa.py")
options.workdir = os.path.basename(__file__).replace(".py", "").replace("run_", "flow_")
# Initialize structure from cif file.
structure = abilab.Structure.from_file(abidata.cif_file("si.cif"))
# Get NC pseudos from pseudodojo.
from abipy.flowtk.psrepos import get_oncvpsp_pseudos
pseudos = get_oncvpsp_pseudos(xc_name="PBEsol", version="0.4")
# Select k-mesh for electrons and q-mesh for phonons.
ngkpt = [2, 2, 2]; ngqpt = [1, 1, 1]
#ngkpt = [4, 4, 4]; ngqpt = [4, 4, 4]
with_becs = False
with_quad = False
#with_quad = not structure.has_zero_dynamical_quadrupoles
#bo_vol_scales = [0.96, 0.98, 1.0, 1.02, 1.04, 1.06]
#ph_vol_scales = [0.98, 1.0, 1.02, 1.04, 1.06] # EinfVib4(D)
bo_vol_scales = [0.96, 0.98, 1, 1.02, 1.04] # EinfVib4(S)
ph_vol_scales = [1, 1.02, 1.04] # EinfVib2(D)
scf_input = abilab.AbinitInput(structure, pseudos)
# Set other important variables
# All the other DFPT runs will inherit these parameters.
scf_input.set_vars(
nband=scf_input.num_valence_electrons // 2,
nline=10,
nbdbuf=0,
nstep=100,
ecutsm=1.0,
tolvrs=1.0e-8, # SCF stopping criterion (modify default)
#tolvrs=1.0e-18, # SCF stopping criterion (modify default)
)
scf_input.set_kmesh(ngkpt=ngkpt, shiftk=[0, 0, 0])
print("scf_input\n", scf_input)
return VzsisaFlow.from_scf_input(options.workdir, scf_input, bo_vol_scales, ph_vol_scales, ngqpt,
with_becs, with_quad, edos_ngkpt=None)
# This block generates the thumbnails in the Abipy gallery.
# You can safely REMOVE this part if you are using this script for production runs.
if os.getenv("READTHEDOCS", False):
__name__ = None
import tempfile
options = flowtk.build_flow_main_parser().parse_args(["-w", tempfile.mkdtemp()])
build_flow(options).graphviz_imshow()
@flowtk.flow_main
def main(options):
"""
This is our main function that will be invoked by the script.
flow_main is a decorator implementing the command line interface.
Command line args are stored in `options`.
"""
return build_flow(options)
if __name__ == "__main__":
sys.exit(main())
Total running time of the script: (0 minutes 7.357 seconds)