The QEpyCalculator object

The QEpyCalculator object is a calculator for ASE:

from qepy.calculator import QEpyCalculator
driver = QEpyCalculator(inputfile='')


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 (Only works for program PW).

  • 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+'.


  • 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

static get_atoms_from_qepy()[source]

Return the atom.Atoms from QE.

get_band_structure(qe_options=None, kpts=None, reference=None, inputfile=None, **kwargs)[source]

calculate band structure and return ase BandStructure.

  • 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.


See qepy.driver.Driver.get_bz_k_points()


See qepy.driver.Driver.get_density()

get_dos(qe_options=None, spin=None, inputfile=None, **kwargs)[source]

calculate density of states (DOS) and return the tuple (energies, dos)

  • 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_eigenvalues(kpt=0, spin=0)[source]

See qepy.driver.Driver.get_eigenvalues()


See qepy.driver.Driver.get_fermi_level()

get_forces(atoms=None, icalc=0)[source]

See qepy.driver.Driver.get_forces()


See qepy.driver.Driver.get_ibz_k_points()


See qepy.driver.Driver.get_k_point_weights()


See qepy.driver.Driver.get_magnetic_moment()


See qepy.driver.Driver.get_number_of_bands()


See qepy.driver.Driver.get_number_of_grid_points()


See qepy.driver.Driver.get_number_of_k_points()


See qepy.driver.Driver.get_number_of_spins()

get_occupation_numbers(kpt=0, spin=0)[source]

See qepy.driver.Driver.get_occupation_numbers()

get_potential_energy(atoms=None, **kwargs)[source]

See qepy.driver.Driver.get_potential_energy()

get_pseudo_density(spin=None, pad=True, gather=False)[source]

See qepy.driver.Driver.get_pseudo_density()

get_pseudo_wave_function(band=None, kpt=0, spin=0, broadcast=True, pad=True)[source]

See qepy.driver.Driver.get_pseudo_wave_function()


See qepy.driver.Driver.get_spin_polarized()


Return the stress tensor in the Voigt order (xx, yy, zz, yz, xz, xy)

get_wave_function(band=None, kpt=0)[source]

See qepy.driver.Driver.get_wave_function()


See qepy.driver.Driver.get_xc_functional()

property is_root

See qepy.driver.Driver.is_root()

stop(what='all', **kwargs)[source]

See qepy.driver.Driver.stop()