QCAT (Quantum Chemistry Analysis Toolkit) is a tool for analyzing data from quantum chemistry softwares, mainly Quantum Espresso and Qbox.
- Directly read the binary output generated by Quantum Espresso / Qbox
- Support multi-kpoints, spin-polarized calculation
- Paralleled by using multiprocessing
- Support HDF5
- Optimized with Cython
To install qcat, clone the repository and
# loading a system-provided MPI module (openmpi or intelmpi)
module load intelmpi/2019.up7+intel-19.1.1
conda create -n qcat python=3.10
conda activate qcat
cd qcat
rm -rf .git # remove git track
pip install .
To update the package, please run:
pip install qcat --upgrade
To uninstall the package, please run:
pip uninstall qcat
class_ldos.py
has the main class for computing local band edge (local CBM and VBM)qe_io.py
is a general I/O class to parse Quantum Espresso's binary outpututils.py
includes some useful functions to output/analyze local band edge
......
- browse qcat for more information
Computing local density of states by analyzing wavefunctions generated by Quantum Espresso
- ssh to interactive session to utilize computing node (1 node is enough)
sinteractive --exclusive --partition=broadwl --nodes=1 --ntasks=28 --gres=gpu:0 --time=2:00:00
# loading a system-provided MPI module (openmpi or intelmpi)
module load intelmpi/2019.up7+intel-19.1.1
- Create a python file to call functions from qcat
from mpi4py import MPI
import json
from qcat.pp import class_ldos
from qcat.io_kernel import qe_io, qbox_io
comm = MPI.COMM_WORLD
rank = comm.Get_rank()
# delta : parameter to control the location of LCBM/LVBM (checkout eq.3 of https://doi.org/10.1063/1.4811481)
# outFolder : the location of folder for *.save (QE) or XML sample and qbox.out (QBOX)
# comm : MPI COMM_WORLD
# choose abinitio software
outFolder = "./si.save"
# initialize reader instance
# abinitioRead = qbox_io.QBOXRead(outFolder=outFolder, comm=comm) # Qbox
abinitioRead = qe_io.QERead(outFolder=outFolder, comm=comm) # QE
# initialize LDOS instance.
localDensityOfState = LDOS(read_obj=abinitioRead,
delta=delta,
comm=comm)
# compute LDOS along z axis (can be 'x' or 'y')
localDensityOfState.computeLDOS(axis='z')
# obtain lcbm and lvbm
# lcbm: local CBM
# lvbm: local VBM
# lcbm and lvbm are 1d numpy.ndarray with size of FFT grid along chosen axis (z in this case).
lcbm, lvbm = localDensityOfState.localBandEdge()
if rank == 0:
# write lcbm and lvbm to json file
data = {'lcbm': lcbm.tolist(), 'lvbm': lvbm.tolist()}
fname = "ldos.json"
with open(fname, 'w') as json_file:
json.dump(data, json_file)
logger.info(f"Data has been written to {fname}")
see example/pp_example/ldos_example.py
for reference. Or simply run the example script:
mpirun [-np NTASKS] python3 example/pp_example/ldos_example.py [-h] [-a ABINITIO] [-s SAVEFILEFOLDER] [-d DELTA] [-o ORIENTATION]
- Configuration of ldos_example.py:
optional arguments:
-h, --help show this help message and exit
-a ABINITIO, --abinitio ABINITIO
abinitio software: qe/qbox. Default: qe
-s SAVEFILEFOLDER, --saveFileFolder SAVEFILEFOLDER
*.save folder generated by QE or the folder that store qbox output. Default:
./scf.save
-d DELTA, --delta DELTA
delta that control local VB/CB. Default: 0.001
-o ORIENTATION, --orientation ORIENTATION
LDOS orientation. Default: z
version of Quantum Espresso >= 5.4