Custom Space

Custom functions simplifying the handling of fractional coordinates.

chemtrain.jax_md_mod.custom_space.init_fractional_coordinates(box)[source]

Returns a 2D box tensor and a scale function that projects positions within a box in real space to the unit-hypercube as required by fractional coordinates.

Parameters:

box (Union[float, Array]) – A 1 or 2-dimensional box

Return type:

Tuple[Union[float, Array], Callable]

Returns:

A tuple (box, scale_fn) of a 2D box tensor and a scale_fn that scales positions in real-space to the unit hypercube.