jaxdem.utils.dynamicsRoutines#
Protocols that interleave integration with periodic state/system rescaling.
Temperature control is handled by the thermostat integrators
(linear_integrator_type="verlet_rescaling" or "langevin") at
System.create time; nothing in this module duplicates that. What
is left here is the one control job no integrator does on its own:
rescaling the periodic box on a user-specified schedule while
integration runs.
Functions
|
Integrate + scheduled box-rescale protocol, saving one frame per event. |
- jaxdem.utils.dynamicsRoutines.run_packing_fraction_protocol(state: State, system: System, *, strides: jax.Array, phi_at_frames: jax.Array, unroll: int = 2) tuple[State, System, tuple[State, System]][source]#
Integrate + scheduled box-rescale protocol, saving one frame per event.
For each frame
iinrange(K):Advance
strides[i]integration steps viaSystem.step().Rescale the periodic box to
phi_at_frames[i]viascale_to_packing_fraction().Record
(state, system)as the frame.
All dynamics — pairwise forces, bonded forces, thermostat integrators, neighbor-list rebuilds, etc. — are delegated to
system.step. That means temperature control, if desired, is set up atSystem.createtime by pickinglinear_integrator_type="verlet_rescaling"(deterministic velocity rescaling) or"langevin"(stochastic). This function then runs whatever integrator is on the System and adds the box-rescale schedule on top.- Parameters:
state – Initial state / system; the system’s integrators + collider + force model determine what happens between rescales.
system – Initial state / system; the system’s integrators + collider + force model determine what happens between rescales.
strides – 1D integer array of per-frame integration step counts. Length
Ksets the number of frames.phi_at_frames – 1D float array of target packing fractions, one per frame, applied after the frame’s integration strides. Must have the same length as
strides.unroll – Unroll factor for the outer
jax.lax.scan()(same semantics asSystem.trajectory_rollout()).
- Returns:
Final state/system and the per-frame trajectory, stacked along leading axis
K— same layout astrajectory_rollout’s defaultsave_fn.- Return type:
Notes
For a non-rescaling rollout, call
System.trajectory_rollout()directly.To drive from a
save_stepsarray produced bymake_save_steps_pseudolog()ormake_save_steps_linear(), passstrides=np.diff(save_steps)and a matchingphi_at_framesarray.