nvalchemi.models.pipeline.PipelineGroup#
- class nvalchemi.models.pipeline.PipelineGroup(steps, use_autograd=False, derivative_fn=None)[source]#
A group of steps that share a derivative computation strategy.
Steps within a group execute in order (for wiring). Groups execute in declaration order.
stepsaccepts bareBaseModelMixininstances orPipelineStepwrappers. Bare models are normalized toPipelineStep(model, wire={})internally.- Parameters:
steps (list[BaseModelMixin | PipelineStep]) – Ordered list of models (or wrapped models) in this group.
use_autograd (bool) – If
True, sub-models produce energies only; the group sums them and callsderivative_fnto compute forces, stresses, and any other requested derivatives from the summed energy. IfFalse(default), each sub-model computes its own outputs and the group sums them directly.derivative_fn (DerivativeFn | None) –
Custom derivative function called after energy summation in autograd groups. Receives
(energy, data, requested)whereenergyis the summed group energy (on the autograd graph),datais the batch (withpositions.requires_grad=True), andrequestedis the set of output keys that still need to be computed (e.g.{"forces", "stress"}).When
None(default), the pipeline uses a built-in function that computes forces as-dE/drand stresses via the affine strain trick (seeprepare_strain()).Only meaningful when
use_autograd=True.