Workflows¶
The high-level WorkChains and their inputs/outputs. Workflows that start
from force constants accept either a CASTEP castep_file or a pre-built
force_constants node (e.g. from Phonopy); ToscaFromModesWorkChain instead
starts from precomputed phonon modes and offers no force-constants source at all
– see the worked examples.
These pages are generated from the live process spec by AiiDA’s
aiida-workchain directive, showing the inputs, outputs, and outline, with
exit codes documented in the class reference.
- workchainaiida_pythonjob_ins.workflows.dispersion.DispersionWorkChain
Compute phonon dispersion from a CASTEP file or a ForceConstantsData node. Exit Codes: * 400 (ERROR_SUB_PROCESS_FAILED): A PythonJob step did not finish successfully.
Inputs:
- castep_file, (SinglefileData, NoneType), optional – CASTEP .castep_bin/.check file (read in-workflow via a PythonJob).
- code, AbstractCode, required – Python code used to run the PythonJob steps.
- force_constants, (ForceConstantsData, NoneType), optional – Pre-built force constants (e.g. from Phonopy); skips the read step.
- metadata, Namespace
- call_link_label, str, optional, is_metadata – The label to use for the CALL link if the process is called by another process.
- description, (str, NoneType), optional, is_metadata – Description to set on the process node.
- disable_cache, (bool, NoneType), optional, is_metadata – Do not consider the cache for this process, ignoring all other caching configuration rules.
- label, (str, NoneType), optional, is_metadata – Label to set on the process node.
- store_provenance, bool, optional, is_metadata – If set to False provenance will not be stored in the database.
- q_spacing, Float, optional – Target q-point spacing along the band path, in 1/Angstrom.
Outputs:
- band_path, KpointsData, required – The high-symmetry q-point path (positions + labels).
- band_structure, BandsData, required – Phonon band structure (frequencies as bands) for plotting.
- phonon_modes, QpointPhononModesData, required – Frequencies + eigenvectors along the band path.
- structure, StructureData, required – Crystal structure extracted from the force constants.
Outline:
if(should_read_castep) read_force_constants(Read force constants from the CASTEP file via a PythonJob.) assign_force_constants(Set ``self.ctx.force_constants`` from the input node or the read step.) generate_path(Extract the structure, then build the q-point path. Both are parent-side calcfunctions (cheap, and they build AiiDA nodes). seekpath needs only the structure, so we materialize a ``StructureData`` first -- reusable and idiomatic -- then derive the path from it.) interpolate(Interpolate phonon modes on the q-point path.) finalize(Expose the modes, path and a composed BandsData.)
- workchainaiida_pythonjob_ins.workflows.dos.DosWorkChain
Compute a phonon DOS from a CASTEP file or a ForceConstantsData node. Exit Codes: * 400 (ERROR_SUB_PROCESS_FAILED): A PythonJob step did not finish successfully.
Inputs:
- castep_file, (SinglefileData, NoneType), optional – CASTEP .castep_bin/.check file (read in-workflow via a PythonJob).
- code, AbstractCode, required – Python code used to run the PythonJob steps.
- energy_spacing, Float, optional – DOS energy bin width, in meV.
- force_constants, (ForceConstantsData, NoneType), optional – Pre-built force constants (e.g. from Phonopy); skips the read step.
- metadata, Namespace
- call_link_label, str, optional, is_metadata – The label to use for the CALL link if the process is called by another process.
- description, (str, NoneType), optional, is_metadata – Description to set on the process node.
- disable_cache, (bool, NoneType), optional, is_metadata – Do not consider the cache for this process, ignoring all other caching configuration rules.
- label, (str, NoneType), optional, is_metadata – Label to set on the process node.
- store_provenance, bool, optional, is_metadata – If set to False provenance will not be stored in the database.
- q_spacing, Float, optional – Target Monkhorst-Pack grid spacing, in 1/Angstrom.
Outputs:
- dos, XyData, required – Phonon density of states (energy vs DOS).
Outline:
if(should_read_castep) read_force_constants(Read force constants from the CASTEP file via a PythonJob.) assign_force_constants(Set ``self.ctx.force_constants`` from the input node or the read step.) compute_dos(Sample a grid and compute the DOS.) finalize(Expose the DOS XyData.)
- workchainaiida_pythonjob_ins.workflows.tosca.ToscaFromModesWorkChain
Compute a TOSCA spectrum from prepared phonon modes. Takes a ``QpointPhononModesData`` node and nothing else as a source: no file-reading step is offered, so this chain carries no q-point sampling parameter (that belongs to :class:`ToscaFromForceConstantsWorkChain`, which composes this one). See Decision 2 in `design.md` for why the core requires a node rather than a file path. Exit Codes: * 400 (ERROR_SUB_PROCESS_FAILED): The intensity PythonJob did not finish successfully.
Inputs:
- code, AbstractCode, required – Python code used to run the intensity PythonJob.
- detector_angles, List, optional – Scattering angles in degrees, one per detector bank to evaluate.
- energy_max, Float, optional – Instrument-range cutoff on the energy axis, in energy_unit. TOSCA results are conventionally examined up to 4000 cm-1, comfortably inside the ~8000 cm-1 the instrument can reach.
- energy_spacing, Float, optional – Energy bin width, in energy_unit.
- energy_unit, Str, optional – Unit for energy_spacing, energy_max and final_energy.
- final_energy, Float, optional – Analyser-fixed final neutron energy, in energy_unit.
- group_by, List, optional – Metadata keys to group and sum spectrum lines by (e.g. [‘atom_symbol’], [‘quantum_order’], or both). Empty (the default) yields a single total spectrum.
- metadata, Namespace
- call_link_label, str, optional, is_metadata – The label to use for the CALL link if the process is called by another process.
- description, (str, NoneType), optional, is_metadata – Description to set on the process node.
- disable_cache, (bool, NoneType), optional, is_metadata – Do not consider the cache for this process, ignoring all other caching configuration rules.
- label, (str, NoneType), optional, is_metadata – Label to set on the process node.
- store_provenance, bool, optional, is_metadata – If set to False provenance will not be stored in the database.
- modes, QpointPhononModesData, required – Precomputed phonon modes to simulate a TOSCA spectrum from.
- resolution_model, Str, optional – Name of the resins resolution model applied when broadening.
- temperature, Float, optional – Sample temperature in kelvin (governs Debye-Waller attenuation).
Outputs:
- components, XyData, required – The full, ungrouped line set: one line per contributing atom, quantum order and detector angle. Committed to the graph before grouping so that regrouping can reuse this calculation.
- spectrum, XyData, required – The grouped and resolution-broadened TOSCA spectrum.
Outline:
compute_intensities(Compute the full, ungrouped line set as a PythonJob.) group(Group the committed line set by the requested metadata keys.) broaden(Apply resolution broadening to the grouped spectrum.) finalize(Expose the ungrouped components and the grouped, broadened spectrum.)
- workchainaiida_pythonjob_ins.workflows.tosca.ToscaFromForceConstantsWorkChain
Compute a TOSCA spectrum from force constants, via interpolated modes. Inherits :class:`~aiida_pythonjob_ins.workflows.base.ForceConstantsWorkChain` for the force-constants source (a CASTEP file or a prepared node – exactly one, as usual), interpolates modes on a Monkhorst-Pack grid (a powder average, matching :class:`~aiida_pythonjob_ins.workflows.dos.DosWorkChain` rather than the symmetry-path sampling of :class:`~aiida_pythonjob_ins.workflows.dispersion.DispersionWorkChain`: the almost-isotropic incoherent approximation needs a representative *density* of modes, not specific q-point positions), and delegates the spectrum calculation to :class:`ToscaFromModesWorkChain` rather than reimplementing it (Decision 1). Exit Codes: * 400 (ERROR_SUB_PROCESS_FAILED): A PythonJob step of this workflow’s own (the force-constants read, or the mode interpolation) did not finish successfully. * 401 (ERROR_SPECTRUM_WORKCHAIN_FAILED): The delegated ``ToscaFromModesWorkChain`` did not finish successfully.
Inputs:
- castep_file, (SinglefileData, NoneType), optional – CASTEP .castep_bin/.check file (read in-workflow via a PythonJob).
- code, AbstractCode, required – Python code used to run the PythonJob steps.
- force_constants, (ForceConstantsData, NoneType), optional – Pre-built force constants (e.g. from Phonopy); skips the read step.
- metadata, Namespace
- call_link_label, str, optional, is_metadata – The label to use for the CALL link if the process is called by another process.
- description, (str, NoneType), optional, is_metadata – Description to set on the process node.
- disable_cache, (bool, NoneType), optional, is_metadata – Do not consider the cache for this process, ignoring all other caching configuration rules.
- label, (str, NoneType), optional, is_metadata – Label to set on the process node.
- store_provenance, bool, optional, is_metadata – If set to False provenance will not be stored in the database.
- q_spacing, Float, optional – Target Monkhorst-Pack grid spacing for the mode sampling, in 1/Angstrom.
- spectrum, Namespace – Scientific and instrument inputs forwarded to the composed ToscaFromModesWorkChain (modes and code excluded: modes is produced internally, and code is shared with the force-constants step above).
- detector_angles, List, optional – Scattering angles in degrees, one per detector bank to evaluate.
- energy_max, Float, optional – Instrument-range cutoff on the energy axis, in energy_unit. TOSCA results are conventionally examined up to 4000 cm-1, comfortably inside the ~8000 cm-1 the instrument can reach.
- energy_spacing, Float, optional – Energy bin width, in energy_unit.
- energy_unit, Str, optional – Unit for energy_spacing, energy_max and final_energy.
- final_energy, Float, optional – Analyser-fixed final neutron energy, in energy_unit.
- group_by, List, optional – Metadata keys to group and sum spectrum lines by (e.g. [‘atom_symbol’], [‘quantum_order’], or both). Empty (the default) yields a single total spectrum.
- metadata, Namespace
- call_link_label, str, optional, is_metadata – The label to use for the CALL link if the process is called by another process.
- description, (str, NoneType), optional, is_metadata – Description to set on the process node.
- disable_cache, (bool, NoneType), optional, is_metadata – Do not consider the cache for this process, ignoring all other caching configuration rules.
- label, (str, NoneType), optional, is_metadata – Label to set on the process node.
- store_provenance, bool, optional, is_metadata – If set to False provenance will not be stored in the database.
- resolution_model, Str, optional – Name of the resins resolution model applied when broadening.
- temperature, Float, optional – Sample temperature in kelvin (governs Debye-Waller attenuation).
Outputs:
- components, XyData, required – The full, ungrouped line set: one line per contributing atom, quantum order and detector angle. Committed to the graph before grouping so that regrouping can reuse this calculation.
- spectrum, XyData, required – The grouped and resolution-broadened TOSCA spectrum.
Outline:
if(should_read_castep) read_force_constants(Read force constants from the CASTEP file via a PythonJob.) assign_force_constants(Set ``self.ctx.force_constants`` from the input node or the read step.) interpolate_modes(Interpolate phonon modes on a Monkhorst-Pack grid, as a PythonJob.) compute_spectrum(Delegate the spectrum calculation to ToscaFromModesWorkChain.) finalize(Expose the delegated workchain's outputs as this chain's own.)