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, engine, pseudopotentials={}, kpoints=None, projections=None, name=None, parameters={}, calculator_parameters=None, plotting={}, ml={}, ml_model=None, snapshots=None, autogenerate_settings=True, version=None, parent_process=None, **kwargs)
Abstract base class that defines a Koopmans workflow.
- Parameters:
- atomsAtoms
an ASE
Atomsobject defining the atomic positions, cell, etc- pseudopotentialsOrderedDict[str, UPFDict]
a dictionary mapping atom labels to pseudopotential objects
- 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}- `SinglepointWorkflow` is an implementation of the `Workflow` class that performs a single-point calculation.
Examples
Running a Koopmans calculation on ozone
>>> from ase_koopmans.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_koopmans.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()