Vesin is a fast and easy-to-use Python library for computing neighbor lists in atomistic systems. It provides interfaces for Python, C, C++, and TorchScript, leveraging highly optimized C++ and CUDA code for performance. The library focuses on efficient calculation of inter-atomic distances and periodic shifts, crucial for molecular simulations and materials science. The current version is 0.5.4, released on April 2, 2026, indicating an active development and release cadence.
pip install vesinVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to initialize the `NeighborList` calculator, define an atomistic system with positions and a simulation box, and compute neighbor lists including indices, periodic shifts, and distances. It also shows the basic structure for using the ASE-compatible `ase_neighbor_list` function.
Consult the `vesin` documentation for the exact subset of `ase` functionality supported when using `ase_neighbor_list`. For full functionality, consider `NeighborList` or direct `ASE` calls.
Unless performance is absolutely critical and you manage object lifetimes carefully, it is recommended to either use the default `copy=True` or ensure that you process the returned arrays immediately after the `compute` call and before any other operation on the `NeighborList` object. If `copy=False` is used, consider making a deep copy of the results if they need to persist or be modified.
Install the library using pip: `pip install vesin`.
Review the `NeighborList.compute()` signature in the official documentation or the quickstart example. Ensure you are using `points` instead of `positions`.
Ensure the `quantities` string consists only of valid characters: 'i', 'j', 'P', 'S', 'd', 'D'. For example, `quantities="ijSd"` is valid, but `quantities="xyz"` is not.