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-PBE-PDv0.4/archive/refs/heads/master.zip ...
Installing ONCVPSP-PBE-SR-PDv0.4 in: /home/runner/.abinit/pseudos/ONCVPSP-PBE-SR-PDv0.4
0.00iB [00:00, ?iB/s]
778kiB [00:00, 7.25MiB/s]
1.55MiB [00:00, 3.93MiB/s]
2.83MiB [00:00, 6.57MiB/s]
3.70MiB [00:00, 5.51MiB/s]
5.21MiB [00:00, 6.71MiB/s]
6.18MiB [00:00, 7.28MiB/s]
7.00MiB [00:01, 7.39MiB/s]
7.86MiB [00:01, 6.13MiB/s]
8.56MiB [00:01, 6.21MiB/s]
9.76MiB [00:01, 7.17MiB/s]
10.6MiB [00:01, 6.84MiB/s]
11.3MiB [00:01, 6.83MiB/s]
12.1MiB [00:01, 6.63MiB/s]
12.8MiB [00:02, 5.83MiB/s]
13.6MiB [00:02, 6.01MiB/s]
14.5MiB [00:02, 5.93MiB/s]
15.8MiB [00:02, 7.27MiB/s]
16.6MiB [00:02, 7.44MiB/s]
17.4MiB [00:02, 6.90MiB/s]
18.1MiB [00:02, 6.54MiB/s]
19.0MiB [00:02, 7.01MiB/s]
19.8MiB [00:03, 6.91MiB/s]
20.5MiB [00:03, 6.95MiB/s]
21.3MiB [00:03, 6.92MiB/s]
22.1MiB [00:03, 6.65MiB/s]
22.8MiB [00:03, 6.66MiB/s]
23.7MiB [00:03, 6.98MiB/s]
24.5MiB [00:03, 6.46MiB/s]
25.4MiB [00:03, 7.26MiB/s]
26.2MiB [00:03, 6.39MiB/s]
27.1MiB [00:04, 6.75MiB/s]
27.9MiB [00:04, 6.76MiB/s]
28.7MiB [00:04, 6.94MiB/s]
29.4MiB [00:04, 7.00MiB/s]
30.2MiB [00:04, 6.32MiB/s]
30.8MiB [00:04, 5.94MiB/s]
31.5MiB [00:04, 6.01MiB/s]
32.3MiB [00:04, 6.19MiB/s]
33.0MiB [00:05, 6.21MiB/s]
34.1MiB [00:05, 7.15MiB/s]
34.9MiB [00:05, 7.09MiB/s]
35.6MiB [00:05, 6.64MiB/s]
36.5MiB [00:05, 6.99MiB/s]
37.2MiB [00:05, 6.86MiB/s]
38.1MiB [00:05, 6.95MiB/s]
38.9MiB [00:05, 7.25MiB/s]
39.6MiB [00:05, 6.93MiB/s]
40.4MiB [00:06, 6.87MiB/s]
41.0MiB [00:06, 6.13MiB/s]
41.7MiB [00:06, 5.07MiB/s]
42.9MiB [00:06, 5.57MiB/s]
44.2MiB [00:06, 6.32MiB/s]
45.0MiB [00:06, 6.44MiB/s]
46.3MiB [00:06, 7.85MiB/s]
47.2MiB [00:07, 7.84MiB/s]
48.0MiB [00:07, 7.36MiB/s]
48.8MiB [00:07, 7.25MiB/s]
49.5MiB [00:07, 6.89MiB/s]
50.3MiB [00:07, 6.82MiB/s]
51.0MiB [00:07, 6.00MiB/s]
51.7MiB [00:07, 5.27MiB/s]
52.8MiB [00:08, 6.33MiB/s]
54.0MiB [00:08, 7.62MiB/s]
54.8MiB [00:08, 6.98MiB/s]
55.7MiB [00:08, 7.24MiB/s]
56.5MiB [00:08, 7.22MiB/s]
57.3MiB [00:08, 6.69MiB/s]
58.2MiB [00:08, 6.95MiB/s]
59.0MiB [00:08, 7.03MiB/s]
59.8MiB [00:08, 7.10MiB/s]
60.5MiB [00:09, 7.17MiB/s]
61.3MiB [00:09, 5.91MiB/s]
62.1MiB [00:09, 5.63MiB/s]
63.1MiB [00:09, 5.91MiB/s]
64.1MiB [00:09, 6.71MiB/s]
64.9MiB [00:09, 6.55MiB/s]
65.7MiB [00:09, 6.89MiB/s]
66.4MiB [00:10, 6.07MiB/s]
67.4MiB [00:10, 6.27MiB/s]
68.3MiB [00:10, 6.32MiB/s]
69.3MiB [00:10, 5.09MiB/s]
71.0MiB [00:10, 7.33MiB/s]
72.0MiB [00:10, 7.84MiB/s]
73.0MiB [00:10, 7.77MiB/s]
73.8MiB [00:11, 7.52MiB/s]
74.7MiB [00:11, 6.76MiB/s]
75.4MiB [00:11, 6.13MiB/s]
76.5MiB [00:11, 7.24MiB/s]
77.3MiB [00:11, 7.02MiB/s]
78.1MiB [00:11, 6.83MiB/s]
78.8MiB [00:11, 6.84MiB/s]
79.5MiB [00:12, 4.21MiB/s]
81.4MiB [00:12, 6.11MiB/s]
82.5MiB [00:12, 4.87MiB/s]
84.7MiB [00:12, 7.16MiB/s]
85.6MiB [00:13, 6.48MiB/s]
86.7MiB [00:13, 6.24MiB/s]
88.4MiB [00:13, 7.82MiB/s]
89.4MiB [00:13, 7.93MiB/s]
90.3MiB [00:13, 7.45MiB/s]
91.1MiB [00:13, 6.50MiB/s]
92.2MiB [00:13, 7.10MiB/s]
93.0MiB [00:14, 7.15MiB/s]
93.7MiB [00:14, 6.88MiB/s]
94.5MiB [00:14, 6.21MiB/s]
95.5MiB [00:14, 6.66MiB/s]
Validating md5 checksums of ONCVPSP-PBE-SR-PDv0.4...
Checksum test: OK
Installation completed successfully in 16.17 [s]
scf_input
##############################################
#### SECTION: basic
##############################################
nband 4
nstep 100
ecut 8.0
occopt 1
tolvrs 1e-18
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-PBE-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.3285005244 0.0000000000 3.6537614813
2.1095001748 5.9665675141 3.6537614813
0.0000000000 0.0000000000 7.3075229627
#<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": "45c393525680abc7b25445b8ec62bf83",
# "filepath": "/home/runner/.abinit/pseudos/ONCVPSP-PBE-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="PBE", 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=4,
nline=10,
nbdbuf=0,
nstep=100,
ecut=8.0,
ecutsm=1.0,
occopt=1,
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 16.374 seconds)