tfep.utils.misc.atom_to_flattened

tfep.utils.misc.atom_to_flattened(positions)[source]

Compute a positions from standard atom to flattened format.

The inverse operation of flattened_to_atom().

Parameters:

positions (torch.Tensor, numpy.ndarray, or pint.Quantity) – The input can have the following shapes: (batch_size, n_atoms, N) or (n_atoms, N), where N is the dimensionality of the phase space.

Returns:

reshaped_positions – A view of the original tensor or array with shape (batch_size, n_atoms*N) or (n_atoms*N).

Return type:

torch.Tensor, numpy.ndarray, or pint.Quantity