aiida_vasp.workchains.v2.bands#
Bands workchain with a more flexible input TODO:
Add option to use alternative pathways obtained using sumo-interface
- Improve the hybrid workchain by performing local dryrun to extract the full kpoints
If running SOC, the ISYM should be turned to 0 or -1.
Module Contents#
Classes#
Workchain for running bands calculations. |
|
Bands workchain for hybrid calculations |
Functions#
Primitivize the structure with SeeKpath and generate the high symmetry k-point path through its Brillouin zone. This calcfunction will take a structure and pass it through SeeKpath to get the normalized primitive cell and the path of high symmetry k-points through its Brillouin zone. Note that the returned primitive cell may differ from the original structure in which case the k-points are only congruent with the primitive cell. The keyword arguments can be used to specify various Seekpath parameters, such as: |
|
Add additional information from the kpoints allow richer informations to be stored such as band structure labels. |
|
This function dryruns a VASP calculation using the primitive structure obtained by performing seekpath analyses |
|
Split the kpoints into multiple one and combined with SCF kpoints |
|
Split the kpoints into multiple one and combined with SCF kpoints |
|
Perform a “dryrun” for splitting the kpoints |
|
Combine splitted bands and kpoints data |
|
Combine bands from splitted kpoints into a single bands node. |
|
Extract computed kpoints from a existing calculation |
|
Extract explicity kpoints from a finished calculation |
|
Extract explicity kpoints from a finished calculation |
|
Data#
API#
- aiida_vasp.workchains.v2.bands.SITE_MAG_THRESHOLD = 0#
- aiida_vasp.workchains.v2.bands.logger = 'getLogger(...)'#
- class aiida_vasp.workchains.v2.bands.VaspBandsWorkChain(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_vasp.workchains.v2.mixins.WithBuilderUpdater,aiida_vasp.protocols.ProtocolMixinWorkchain for running bands calculations.
This workchain does the following:
Relax the structure if requested (eg. inputs passed to the relax namespace).
Do a SCF singlepoint calculation.
Do a non-scf calculation for bands and dos.
Inputs must be passed for the SCF calculation, others are optional. The dos calculation will only run if the kpoints for DOS are passed or a full specification is given under the dos input namesace.
The SCF calculation may be skipped by passing a CHGCAR file/remote folder. In which case the SCF inputs are carried on for non-scf calculations.
The band structure calculation will run unless only_dos is set to Bool(True).
For magnetic structures, the workchain will internally create additional species for the symmetry analysis and regenerate “undecorated” structures with corresponding initial magnetic moments. This works for both FM and AFM species. Care should be taken when the MAGMOM is obtained from site projected values in case of unexpected symmetry breaking.
Input for bands and dos calculations are optional. However, if they are needed, the full list of inputs must be passed. For the parameters node, one may choose to only specify those fields that need to be updated.
For optics calculations, one should run with only_dos, set ‘NBANDS’ to a high value and set ‘LOPTICS’ to be True.
Initialization
Construct a WorkChain instance.
Construct the instance only if it is a sub class of WorkChain, otherwise raise InvalidOperation.
- Parameters:
inputs – work chain inputs
logger – aiida logger
runner – work chain runner
enable_persistence – whether to persist this work chain
- _base_wk_string = 'vasp.v2.vasp'#
- _base_workchain = None#
- _relax_wk_string = 'vasp.v2.relax'#
- _relax_workchain = None#
- _protocol_tag = 'band'#
- option_class = None#
- classmethod get_builder_from_protocol(code: aiida.orm.AbstractCode, structure: aiida.orm.StructureData, protocol=None, run_relax=True, overrides=None, options=None, band_settings=None, **kwargs)[source]#
- aiida_vasp.workchains.v2.bands.seekpath_structure_analysis(structure: aiida.orm.StructureData, band_settings: aiida.orm.Dict) Any[source]#
Primitivize the structure with SeeKpath and generate the high symmetry k-point path through its Brillouin zone. This calcfunction will take a structure and pass it through SeeKpath to get the normalized primitive cell and the path of high symmetry k-points through its Brillouin zone. Note that the returned primitive cell may differ from the original structure in which case the k-points are only congruent with the primitive cell. The keyword arguments can be used to specify various Seekpath parameters, such as:
with_time_reversal: True
reference_distance: 0.025
recipe: ‘hpkot’
threshold: 1e-07
symprec: 1e-05
angle_tolerance: -1.0
Note that exact parameters that are available and their defaults will depend on your Seekpath version.
- aiida_vasp.workchains.v2.bands.compose_labelled_bands(bands: aiida.orm.BandsData, kpoints: aiida.orm.KpointsData) aiida.orm.BandsData[source]#
Add additional information from the kpoints allow richer informations to be stored such as band structure labels.
- aiida_vasp.workchains.v2.bands.get_primitive_strucrture_and_scf_kpoints(structure: aiida.orm.StructureData) Any[source]#
This function dryruns a VASP calculation using the primitive structure obtained by performing seekpath analyses
The input StructureData should be returned by an VaspRelaxWorkChain which will be used for dryun using local VASP and getting the explicity kpoints for SCF calculation.
- class aiida_vasp.workchains.v2.bands.VaspHybridBandsWorkChain(inputs: dict | None = None, logger: logging.Logger | None = None, runner: aiida.engine.runners.Runner | None = None, enable_persistence: bool = True)[source]#
Bases:
aiida_vasp.workchains.v2.bands.VaspBandsWorkChainBands workchain for hybrid calculations
This workchain compute the bandstructure by adding band path segments as zero-weighted kpoints for self-consistent calculations. This is mainly for hybrid calculations, but can also be used for GGA calculations, although it would be not as efficient as the non-SCF method implemented in
VaspBandsWorkChain.In contrast to
VaspBandsWorkChainthis workflow requires and explicitly defined kpoints set for thescf.kpointsport. This can be obtained by parsing theIBZKPTfile from and existing calculation or dryrun. Or by parsing thevasprun.xmlfile.If a relaxation workchain is run as part of the process, the
kpointsoutput returned can be used for this purpose automatically.Only the scf namespace will be used for performing the calculation
- TODO:
Warn if the calculation is not actually a hybrid one
Automatic Kpoints from dryruns
Initialization
Construct a WorkChain instance.
Construct the instance only if it is a sub class of WorkChain, otherwise raise InvalidOperation.
- Parameters:
inputs – work chain inputs
logger – aiida logger
runner – work chain runner
enable_persistence – whether to persist this work chain
- should_do_scf_for_scf_kpoints() bool[source]#
Check if one should redo a SCF run to obtain the IBZKPT
- run_scf_for_kpoints() Any[source]#
Run an SCF calculation to just obtain the kpoints for the current structure Ideally we should do this in a dryrun mode @ local machine
- aiida_vasp.workchains.v2.bands.split_kpoints(scf_kpoints: aiida.orm.KpointsData, band_kpoints: aiida.orm.KpointsData, kpn_per_split: aiida.orm.Int) Any[source]#
Split the kpoints into multiple one and combined with SCF kpoints
The kpoints for band structure calculation has zero weights
- aiida_vasp.workchains.v2.bands._split_kpoints(scf_kpoints: aiida.orm.KpointsData, band_kpoints: aiida.orm.KpointsData, kpn_per_split: aiida.orm.Int) Any[source]#
Split the kpoints into multiple one and combined with SCF kpoints
The kpoints for band structure calculation has zero weights
- aiida_vasp.workchains.v2.bands.dryrun_split_kpoints(structure: aiida.orm.StructureData, scf_kpoints: aiida.orm.KpointsData, kpn_per_split: aiida.orm.Int, kpoints_args: Any = None, verbose: bool = True) Any[source]#
Perform a “dryrun” for splitting the kpoints
- aiida_vasp.workchains.v2.bands.combine_bands_data(bs_kpoints: aiida.orm.KpointsData, **kwargs: Any) aiida.orm.BandsData[source]#
Combine splitted bands and kpoints data
The inputs should be supplied as keyword arguments like band_001, kpoint_001 for the splitted kpoints and correspdonging bands data from each calculation. The bs_kpoints is the originally generated band structure path.
Returns a BandsData by combining the zero-weighted bands from each calculation.
- aiida_vasp.workchains.v2.bands._combine_bands_data(bs_kpoints: aiida.orm.KpointsData, kpoints_list: List[aiida.orm.KpointsData], bands_list: List[aiida.orm.BandsData]) aiida.orm.BandsData[source]#
Combine bands from splitted kpoints into a single bands node.
The list of kpoints and bands must be sorted in the right order.
- aiida_vasp.workchains.v2.bands.extract_kpoints_from_calc(calc: Any) Any[source]#
Extract computed kpoints from a existing calculation
- aiida_vasp.workchains.v2.bands.extract_kpoints_from_retrieved(retrieved: aiida.orm.FolderData) aiida.orm.KpointsData[source]#
Extract explicity kpoints from a finished calculation