multiplicative_isotropic_cutoff¶
- torch_sim.transforms.multiplicative_isotropic_cutoff(fn, r_onset, r_cutoff)[source]¶
Creates a smoothly truncated version of an isotropic function.
Takes an isotropic function f(r) and constructs a new function f’(r) that smoothly transitions to zero between r_onset and r_cutoff. The resulting function is C¹ continuous (continuous in both value and first derivative).
The truncation is achieved by multiplying the original function by a smooth switching function S(r) where: - S(r) = 1 for r < r_onset - S(r) = 0 for r > r_cutoff - S(r) smoothly transitions between 1 and 0 for r_onset < r < r_cutoff
The switching function follows the form used in HOOMD-blue: S(r) = (rc² - r²)² * (rc² + 2r² - 3ro²) / (rc² - ro²)³ where rc = r_cutoff and ro = r_onset
- Parameters:
- Returns:
A new function with the same signature as fn that smoothly goes to zero between r_onset and r_cutoff.
- Return type:
References
HOOMD-blue documentation: https://hoomd-blue.readthedocs.io/en/latest/hoomd/md/module-pair.html