batch_pepper#

torchspin.batch_pepper(systems, exp, opt=None, *, weights=None, return_individual=True)[source]#

Simulate CW EPR spectra for multiple SpinSystems in batch.

Each system is simulated via pepper() (full pipeline including SOPHE projection, strain, and calibrated normalization) and the results are stacked into a single tensor.

Parameters:
  • systems (Sequence[SpinSystem]) – List of SpinSystem objects to simulate.

  • exp (Experiment) – Shared experimental parameters (mwFreq, Range, nPoints, Harmonic).

  • opt (Options | None) – Computational options. Defaults to Options().

  • weights (Sequence[float] | None) – Per-system weights for summing. Defaults to each system’s weight attribute (1.0 if not set). Only used when return_individual=False.

  • return_individual (bool) – If True (default), return (x, spectra) where spectra.shape == (N, nPoints). If False, return (x, weighted_sum) where weighted_sum.shape == (nPoints,).

Returns:

  • x – Field axis in mT, shape (nPoints,).

  • spectra – If return_individual=True: (N, nPoints) tensor. If return_individual=False: (nPoints,) weighted sum.

Return type:

tuple[Tensor, Tensor]