VelocityAutoCorrelation

class torch_sim.properties.correlations.VelocityAutoCorrelation(*, window_size, device, use_running_average=True, normalize=True)[source]

Bases: object

Calculator for velocity autocorrelation function (VACF).

Computes the VACF of each system by averaging over its atoms and dimensions, with optional running average across correlation windows. Systems in a batched state are kept separate: vacf has shape (n_systems, window_size), or (window_size,) if the state holds a single system.

Using VelocityAutoCorrelation with TrajectoryReporter:

# Create VACF calculator
vacf_calc = VelocityAutoCorrelation(
    window_size=100,
    device=device,
    use_running_average=True,
)

# Set up trajectory reporter
reporter = TrajectoryReporter(
    "simulation_vacf.h5",
    state_frequency=100,
    prop_calculators={10: {"vacf": vacf_calc}},
)
Parameters:
property vacf: Tensor | None

Current VACF result.

Shape (n_systems, window_size) for a batched state and (window_size,) for a single system. Zeros of shape (window_size,) until the first window is complete.