The QEpyCalculator object
The QEpyCalculator
object is a calculator for ASE:
from qepy.calculator import QEpyCalculator
driver = QEpyCalculator(inputfile='qe_in.in')
Note
The units of ASE Calculator is different from qepy.driver.Driver
object.
List of all Methods
- class qepy.calculator.QEpyCalculator(atoms=None, inputfile=None, from_file=False, wrap=False, extrapolation=True, ase_espresso=None, qe_options=None, comm=None, ldescf=False, iterative=False, task='scf', embed=None, prefix=None, outdir=None, logfile=None, prog='pw', **kwargs)[source]
QEpy Calculator for ASE.
QEpy initialization depends on the input file. Here are some ways to generate input file :
Give a file inputfile or/and a dict qe_options will generate a temporary input file with new atomic information.
Give input file name inputfile and from_file = True will read the structures to atoms (ase.Atoms) from inputfile and initialize the QEpy with inputfile.
Give dict ase_espresso will generate a temporary input file with ase.io.espresso.write_espresso_in (Only works for program PW).
- Parameters:
atoms (ase.Atoms) -- ASE atoms object
inputfile (str) -- Name of QE input file
from_file (str) -- Read the structure from inputfile, and use the inputfile for the QE Initialization.
wrap (bool) -- If True, wrap the atoms back to cell before update the ions.
extrapolation (str or bool) -- If False, every step will re-run the QE from file.
ase_espresso (dict) -- A dictionary with some parameters to generate PW input.
qe_options (dict) -- A dictionary with input parameters for QE to generate QE input file.
comm (object) -- Parallel communicator
ldescf (bool) -- If True, also print the scf correction term in the iteratively mode
iterative (bool) -- Iteratively run the scf or tddft
task (str) --
Task of the driver :
'scf' : scf task
'optical' : Optical absorption spectrum (TDDFT)
'nscf' : read file from scf
embed (object (Fortran)) -- embed object for QE
prefix (str) -- prefix of QE input/output
outdir (str) -- The output directory of QE
logfile (str, file or bool) --
The screen output of QE. If it is a file descriptor, it should open with 'w+'.
None : Show on the screen.
str : Save to the given file.
True : Save to the temporary file, see also
qepy.driver.Driver.get_output()
.
Note
if from_file is True, the qe_options will not use.
The bool gather parameter in functions means the data is gathered in root or distributed in all cpus.
if ase_espresso is set, will use ase module to write QE input file. ase_espresso contains :
input_data: dict
pseudopotentials: dict
kpts: (int, int, int) or dict
koffset: (int, int, int)
crystal_coordinates: bool
More details, see ase.io.espresso.write_espresso_in.
- get_band_structure(qe_options=None, kpts=None, reference=None, inputfile=None, **kwargs)[source]
calculate band structure and return ase BandStructure.
- Parameters:
qe_options (dict) -- A dictionary with input parameters for QE to generate QE input file.
kpts (ase.dft.kpoints.bandpath) -- A band path
reference (float) -- Fermi level which should come from the SCF or DOS calculation. If not set, will try to use previous calculation instead of band structure calculation.
inputfile (str) -- Directly use the inputfile to run the QE calculation.
- get_dos(qe_options=None, spin=None, inputfile=None, **kwargs)[source]
calculate density of states (DOS) and return the tuple (energies, dos)
- Parameters:
qe_options (dict) -- A dictionary with input parameters for QE to generate QE input file.
spin (int) --
None : total DOS
0 : up
1 : down
inputfile (str) -- Directly use the inputfile to run the QE calculation.
- get_stress(atoms=None)[source]
Return the stress tensor in the Voigt order (xx, yy, zz, yz, xz, xy)
- implemented_properties: List[str] = ['energy', 'forces', 'stress']
Properties calculator can handle (energy, forces, ...)
- property is_root