aiida_pythonjob_ins.workflows.tosca¶
WorkChains composing the TOSCA scattering-intensity operations.
Two chains, split by input rather than combined into one with an either/or port (see proposal.md and Decision 1 in design.md): a required parameter for one input (q_spacing) would be meaningless for the other, which a flat process spec cannot express honestly.
ToscaFromModesWorkChain– the stable core. Takes prepared phonon modes and nothing else as a source; independently runnable.ToscaFromForceConstantsWorkChain– inheritsForceConstantsWorkChain(it genuinely is a force-constants-sourced chain) while composingToscaFromModesWorkChainthrough AiiDA’s exposed-input/output machinery, mirroring PwBandsWorkChain exposing PwBaseWorkChain (https://github.com/aiidateam/aiida-quantumespresso/blob/main/src/aiida_quantumespresso/workflows/pw/bands.py).
ToscaFromModesWorkChain runs three provenance steps, split so that a change to one input does not invalidate the others under caching (Decision 5):
compute_intensities– a PythonJob computing the full, ungrouped line set (every atom x quantum-order x detector-angle component). Expensive; the step this design exists to make reusable.group_spectra– a cheapcalcfunctiongrouping/summing that line set by caller-supplied metadata keys (Decision 6).broaden_spectra– a cheapcalcfunctionapplying TOSCA’s resolution broadening to the grouped result (Decision 9). Broadening after grouping is exact, not approximate: the resolution operator is linear, sobroaden(sum(y)) == sum(broaden(y)).
Functions¶
|
Group/sum the full TOSCA line set by the requested metadata keys. |
|
Apply TOSCA resolution broadening to an already-grouped line set. |
Module Contents¶
- aiida_pythonjob_ins.workflows.tosca.group_spectra(components: aiida.orm.XyData, group_by: aiida.orm.List) aiida.orm.XyData[source]¶
Group/sum the full TOSCA line set by the requested metadata keys.
Empty keys yield a single total line: Euphonic’s
group_by()with no keys already returns a one-lineSpectrum1DCollection(unlikesum(), which returns a bareSpectrum1D), so routing both cases throughgroup_bykeeps this function’s return type – and therefore the conversion back toXyData– uniform (Decision 6).