translate_pretty¶
- torch_sim.transforms.translate_pretty(fractional, pbc)[source]¶
ASE pretty translation in pytorch.
Translates atoms such that fractional positions are minimized.
- Parameters:
- Returns:
Translated fractional coordinates of shape (n_atoms, 3).
- Return type:
Example
>>> coords = torch.tensor([[0.1, 1.2, -0.3], [0.7, 0.8, 0.9]]) >>> pbc = [True, True, True] >>> translate_pretty(coords, pbc) tensor([[0.1000, 0.2000, 0.7000], [0.7000, 0.8000, 0.9000]])