aiida_hubbard.workflows.hubbard#
Turn-key solution to automatically compute the self-consistent Hubbard parameters for a given structure.
Module Contents#
Classes#
Workchain computing the self-consistent Hubbard parameters of a structure. |
Functions#
|
Return a tuple with onsites and intersites parameters separated. |
|
Validate that the value is positive. |
|
Validate the entire inputs. |
Attributes#
- aiida_hubbard.workflows.hubbard.get_separated_parameters(hubbard_parameters: list[tuple[int, str, int, str, float, tuple[int, int, int], str]]) tuple[list, list][source]#
Return a tuple with onsites and intersites parameters separated.
- Returns:
tuple (list of onsites, list of intersites).
- aiida_hubbard.workflows.hubbard.validate_positive(value, _)[source]#
Validate that the value is positive.
- class aiida_hubbard.workflows.hubbard.SelfConsistentHubbardWorkChain(inputs: dict | None = None, logger: logging.Logger | None = None, runner: aiida.engine.runners.Runner | None = None, enable_persistence: bool = True)[source]#
Bases:
aiida.engine.WorkChain,aiida_quantumespresso.workflows.protocols.utils.ProtocolMixinWorkchain computing the self-consistent Hubbard parameters of a structure.
It iteratively relaxes the structure (optional) with the
PwRelaxWorkChainand computes the Hubbard parameters through theHpWorkChain, using the remote folder of an scf performed via thePwBaseWorkChain, until the Hubbard values are converged within certain tolerance(s).The procedure in each step of the convergence cycle is slightly different depending on the electronic and magnetic properties of the system. Each cycle will roughly consist of three steps:
Relaxing the structure at the current Hubbard values (optional).
One or two DFT calculations depending whether the system is metallic or insulating, respectively.
A DFPT calculation of the Hubbard parameters, perturbing the ground-state of the last DFT run.
The possible options for the set of DFT SCF calculations that have to be run in the second step look are:
- Metals:
SCF with smearing.
- Insulators
SCF with smearing.
- SCF with fixed occupations; if magnetic, total magnetization and number of bands
are fixed to the values found from the previous SCF calculation.
When convergence is achieved a node will be returned containing the final converged
HubbardStructureData.- classmethod get_protocol_filepath()[source]#
Return
pathlib.Pathto the.yamlfile that defines the protocols.
- classmethod get_builder_from_protocol(pw_code, hp_code, hubbard_structure, protocol=None, overrides=None, options_pw=None, options_hp=None, **kwargs)[source]#
Return a builder prepopulated with inputs selected according to the chosen protocol.
- Parameters:
pw_code – the
Codeinstance configured for thequantumespresso.pwplugin.hp_code – the
Codeinstance configured for thequantumespresso.hpplugin.hubbard_structure – the
HubbardStructureDatainstance containing the initialised Hubbard paramters.protocol – protocol to use, if not specified, the default will be used.
overrides – optional dictionary of inputs to override the defaults of the protocol.
options_pw – A dictionary of options that will be recursively set for the
metadata.optionsinput of all the pwCalcJobsthat are nested in this work chain.options_hp – A dictionary of options that will be recursively set for the
metadata.optionsinput of all the hpCalcJobsthat are nested in this work chain.
- Returns:
a process builder instance with all inputs defined ready for launch.
- should_run_relax()[source]#
Return whether a relax calculation needs to be run, which is true if relax is specified in inputs.
- get_inputs(cls, namespace)[source]#
Return the inputs for one of the subprocesses whose inputs are exposed in the given namespace.
- Parameters:
cls – the process class of the subprocess
namespace – namespace into which the inputs are exposed.
- Returns:
dictionary with inputs.
- set_pw_parameters(inputs)[source]#
Set the input parameters for a generic quantumespresso.pw calculation.
- Parameters:
inputs – AttributeDict of a
PwBaseWorkChainbuilder input.
- get_pseudos() dict[source]#
Return the mapping of pseudos based on the current structure.
Note
this is necessary because during the workchain the kind names of the structure can change, meaning the mapping of the pseudos that is to be passed to the subprocesses also may have to change, since the keys are based on the kind names of the structure.
- Returns:
dictionary of pseudos where the keys are the kindnames of
self.ctx.current_hubbard_structure.
- relabel_hubbard_structure(workchain) None[source]#
Relabel the Hubbard structure if new types have been detected.
- run_scf_smearing()[source]#
Run an scf PwBaseWorkChain with smeared occupations.
This step is always needed since we do not a priori whether the material will be metallic or insulating.
- run_scf_fixed()[source]#
Run an scf PwBaseWorkChain with fixed occupations on top of the previous calculation.
The nunmber of bands and total magnetization (if magnetic) are set according to those of the previous calculation that was run with smeared occupations.
- inspect_hp()[source]#
Analyze the last completed HpWorkChain.
We check the current Hubbard parameters and compare those with the values computed in the previous iteration. If the difference for all Hubbard sites is smaller than the tolerance(s), the calculation is considered to be converged.