pwtools.calculators.Pwscf

class pwtools.calculators.Pwscf(**kwds)[source]

Bases: FileIOCalculator, CalculatorBase

Pwscf (pw.x) calculator.

ATM, we don’t write a ase.calculators.calculator.Parameters class (dict) and have no read() method so I guess that restarts don’t work. Only simple SCF runs for now.

Examples

Define a calculator object:

>>> calc=Pwscf(label='pw',
...            directory='/path/to/calculation/dir',
...            kpts=1/0.35,
...            ecutwfc=80,
...            conv_thr=1e-8,
...            pp='pbe-n-kjpaw_psl.0.1.UPF',
...            pseudo_dir='/home/schmerler/soft/share/espresso/pseudo/espresso/',
...            calc_name='my_calc',
...            outdir='/scratch/schmerler/',
...            command='mpirun -np 16 pw.x < pw.in > pw.out')
>>> at=crys.Structure(...).get_ase_atoms(pbc=True)
>>> at.set_calculator(calc)
>>> at.get_potential_energy()

Relation to ASE k-grid tools:

>>> import numpy as np
>>> from ase.calculators.calculator import kpts2mp
>>> from pwtools.crys import kgrid
>>> st=crys.Structure(cell=np.diag([5,3,3]),
...                   coords=rand(5,3),
...                   symbols=['H']*5)
>>> at=st.get_ase_atoms(pbc=True)
>>> crys.kgrid(st.cell, h=0.35)
array([4, 6, 6])
>>> kpts2mp(at, kpts=1/0.35)
array([4, 6, 6])
__init__(**kwds)[source]
Parameters:

Methods

fill_infile_templ()

Replace all placeholders in self.infile_templ.

init_params_from_input(kwds)

Set self.parameters = self.default_parameters and update with input keyword arguments kwds.

read_results()

write_input(atoms[, properties, system_changes])

Attributes

default_parameters

implemented_properties

infile_templ