FSKTSampler¶
- class snap_simulate.hoomd.FSKTSampler(sim, ptype, kmag=1.1, file_name='fskt_sampler.pkl', sampling_mode='linear', min_interval=10, max_interval=None, Nmag=10, Navg=1, use_multiprocessing=False, auto_load=True)[source]¶
Intermediate scattering function Fs(k,t) autocorrelation sampler.
The FSKTSampler class inherits from BaseSampler and measures the self-intermediate scattering function (\(F_s(k, t)\)) to evaluate structural relaxation and decorrelation of particle positions.
Overview¶
FSKTSampler tracks unwrapped particle coordinates for a specified particle type (ptype) and computes:
Calculations are evaluated using the optimized routines in snap_analyze. When use_multiprocessing=True is configured, calculations are performed asynchronously in a background worker process.
Parameters¶
sim (hoomd.Simulation): The active HOOMD-blue simulation instance (used to read integrator timestep size
dtand box dimensionsbox).ptype (int): The particle type index to track and analyze for spatial decorrelation.
kmag (float, default
1.1): Magnitude of the scattering wavevector \(k = |\mathbf{k}|\).**kwargs: All additional keyword arguments (
file_name,sampling_mode,min_interval,max_interval,Nmag,Navg,use_multiprocessing,auto_load) are inherited directly fromBaseSampler. See BaseSampler for parameter details. (Note thatfile_namedefaults to"fskt_sampler.pkl"forFSKTSampler).
Usage Example¶
from snap_simulate.hoomd import FSKTSampler, minimize_autocorrelation
# Create self-intermediate scattering function sampler for particle type 0
sampler = FSKTSampler(
sim,
ptype=0,
kmag=1.1,
sampling_mode="logarithmic",
use_multiprocessing=True
)
# Run simulation until spatial decorrelation is met
result = minimize_autocorrelation(sim, sampler, threshold=0.01, max_steps=1000000)
print(f"Decorrelated: {result['minimized']} in {result['steps_ran']} steps")