cell_shape_walk¶
- jaxrens.init.cells.cell_shape_walk(key, cell, n_steps, step_size_shear, step_size_stretch, min_aspect_ratio_val, n_atoms, max_volume_per_atom, min_volume_per_atom)[source]¶
Run n_steps shear+stretch moves on a cell, keeping volume constant.
At each step a random draw selects either a shear or a stretch proposal. A proposal is accepted only if the resulting cell satisfies min_aspect_ratio_val; volume is held constant by construction of both proposal kernels.
max_volume_per_atom and min_volume_per_atom are passed as parameters for interface symmetry with later init pipeline stages but are NOT enforced here – volume is held constant throughout the walk and was chosen before this function is called.
- Parameters:
key (Array) – JAX PRNG key.
cell (Array) – (3, 3) starting cell, rows are lattice vectors.
n_steps (int) – Number of shear/stretch proposals.
step_size_shear (float) – Scale parameter for shear proposals.
step_size_stretch (float) – Scale parameter for stretch proposals.
min_aspect_ratio_val (float) – Minimum acceptable aspect ratio; proposals that produce an aspect ratio below this value are rejected.
n_atoms (int) – Number of atoms (used for aspect-ratio volume denominator).
max_volume_per_atom (float) – Not enforced; passed for interface completeness.
min_volume_per_atom (float) – Not enforced; passed for interface completeness.
- Returns:
final (3, 3) cell and scalar int32 acceptance count over n_steps proposals.
- Return type:
(final_cell, n_accepted)