SFI.langevin.chunked module

Chunked simulation with periodic neighbor-list rebuilds.

Provides simulate_chunked(), a thin wrapper around OverdampedProcess.simulate() that breaks a long simulation into shorter chunks and rebuilds the CSR neighbor list (via build_neighbor_csr()) between chunks.

This avoids the O(N²) cost of AutoPairs for large particle systems while keeping the extras interface exactly as-is.

SFI.langevin.chunked.simulate_chunked(proc, dt, Nsteps, key, *, cutoff, box, skin=0.0, rebuild_every=50, save_every=None, spatial_dims=slice(None, 2, None), indptr_key='indptr', indices_key='indices', nnz_safety=1.25, oversampling=1, prerun=0, compute_observables=False, jit_compile=True, verbose=False)[source]

Run a chunked overdamped simulation with periodic neighbor rebuilds.

Parameters:
  • proc (OverdampedProcess) – An initialized process whose force uses dispatch_pairs_from_extras(indptr_key, indices_key).

  • dt (float) – Time step.

  • Nsteps (int) – Total number of steps.

  • key (jax PRNG key) – Random key for the simulation.

  • cutoff (float) – Cutoff radius for neighbor list construction.

  • box (array-like, shape (d,)) – Periodic box lengths.

  • skin (float) – Verlet skin width. The neighbor list is built with radius cutoff + skin so that particles drifting into range between rebuilds are already included. After each chunk the maximum particle displacement is checked; a warning is printed if it exceeds skin / 2 (the Verlet safety threshold).

  • rebuild_every (int) – Number of simulation steps between neighbor-list rebuilds.

  • save_every (int, optional) – Number of simulation steps per output dataset. If None, defaults to rebuild_every. Must be a multiple of rebuild_every.

  • spatial_dims (slice) – Slice into the state vector that selects spatial coordinates (default: first two components [:2]).

  • indptr_key (str) – Extras keys for the CSR neighbor list.

  • indices_key (str) – Extras keys for the CSR neighbor list.

  • nnz_safety (float) – Fraction by which max_nnz is enlarged beyond the initial neighbor count to absorb fluctuations (default 1.25 = 25%).

  • oversampling (int) – Forwarded to proc.simulate().

  • prerun (int) – Forwarded to proc.simulate().

  • compute_observables (bool) – Forwarded to proc.simulate().

  • jit_compile (bool) – Forwarded to proc.simulate().

  • verbose (bool) – Print progress info.

Returns:

Concatenated trajectory from all chunks.

Return type:

TrajectoryCollection