Modules
In this section we document the various classes defined within the koopmans
python package.
The workflow module
The central objects in koopmans
are Workflow
objects. We use these to define and run workflows, as described here. The workflow that runs most calculations is the SinglepointWorkflow
, defined as follows.
- class koopmans.workflows.SinglepointWorkflow(atoms, pseudopotentials={}, kpoints=None, projections=None, name='koopmans_workflow', parameters={}, calculator_parameters=None, plotting={}, ml={}, autogenerate_settings=True, version=None, **kwargs)
Abstract base class that defines a Koopmans workflow
- Parameters:
- atomsAtoms
an ASE
Atoms
object defining the atomic positions, cell, etc- pseudopotentialsDict[str, str]
a dictionary mapping atom labels to pseudopotential filenames
- kpointskoopmans.kpoints.Kpoints
a dataclass defining the k-point sampling and paths
- projectionsProjectionsBlocks
The projections to be used in the Wannierization
- namestr
a name for the workflow
- parametersDict[str, Any] | koopmans.settings.WorkflowSettingsDict
a dictionary specifying any workflow settings to use; note that a simpler alternative is to provide workflow settings as keyword arguments
- calculator_parametersDict[str, koopmans.settings.SettingsDict]
a dictionary containing calculator-specific settings; as for the parameters, it is usually simpler to specify these individually as keyword arguments
- plottingkoopmans.settings.PlotSettingsDict
a dictionary containing settings specific to plotting; again, it is usually simpler to specify these individually as keyword arguments
- autogenerate_settingsbool
if True (the default), autogenerate various calculator settings; the only scenario where you do not want to do this is when creating a new workflow from a .kwf file
- **kwargs
any valid workflow, calculator, or plotting settings e.g.
{"functional": "ki", "ecutwfc": 50.0}
Examples
Running a Koopmans calculation on ozone
>>> from ase.build import molecule >>> from koopmans.workflows import SinglepointWorkflow >>> ozone = molecule('O3', vacuum=5.0, pbc=False) >>> wf = SinglepointWorkflow(ozone, ecutwfc = 20.0) >>> wf.run()
Running a Koopmans calculation on GaAs
>>> from ase.build import bulk >>> from koopmans.projections import ProjectionBlocks >>> from koopmans.kpoints import Kpoints >>> from koopmans.workflows import SinglepointWorkflow >>> gaas = bulk('GaAs', crystalstructure='zincblende', a=5.6536) >>> projs = ProjectionBlocks.fromlist([["Ga: d"], ["As: sp3"], ["Ga: sp3"]], >>> spins=[None, None, None], >>> atoms=gaas) >>> kpoints = Kpoints(grid=[2, 2, 2]) >>> wf = SinglepointWorkflow(gaas, kpoints=kpoints, projections=projs, init_orbitals='mlwfs', >>> pseudo_library='sg15_v1.0', ecutwfc=40.0, >>> calculator_parameters={'pw': {'nbnd': 45}, >>> 'w90_emp': {'dis_froz_max': 14.6, 'dis_win_max': 18.6}}) >>> wf.run()