SerialSumModel

class torch_sim.models.interface.SerialSumModel(*models)[source]

Bases: SumModel

Serial additive composition of multiple ModelInterface models.

Unlike SumModel, child models do not all see the same input state. Instead, each child runs after the previous child’s non-canonical outputs have been stored into a cloned SimState via torch_sim.state.SimState.store_model_extras(). This lets earlier models expose per-atom or per-system features that later models can consume. Energies, forces, and stresses remain additive, while repeated auxiliary outputs are treated as full updated values from the latest stage.

Examples

`py serial_model = SerialSumModel(polarization_model, dispersion_model) output = serial_model(sim_state) `

Parameters:

models (ModelInterface)

forward(state, **kwargs)[source]

Run child models serially, exposing extras from earlier models.

Parameters:

state (SimState)

Return type:

dict[str, Tensor]