Skip to main content

Computing neighbor lists for atomistic system, in TorchScript

Project description

Vesin: fast neighbor lists for atomistic systems

Documentation Tests

English 🇺🇸⁠/⁠🇬🇧 Occitan Arpitan French 🇫🇷 Gallo‑Italic Catalan Spanish 🇪🇸 Italian 🇮🇹
neighbo(u)r vesin vesin voisin visin veí vecino vicino

Vesin is a fast and easy to use library computing neighbor lists for atomistic system. We provide an interface for the following programing languages:

  • C (also compatible with C++). The project can be installed and used as a library with your own build system, or included as a single file and built directly by your own build system;
  • Python;
  • TorchScript, with both a C++ and Python interface;

Installation

To use the code from Python, you can install it with pip:

pip install vesin

See the documentation for more information on how to install the code to use it from C or C++.

Usage instruction

You can either use the NeighborList calculator class:

import numpy as np
from vesin import NeighborList

# positions can be anything compatible with numpy's ndarray
positions = [
    (0, 0, 0),
    (0, 1.3, 1.3),
]
box = 3.2 * np.eye(3)

calculator = NeighborList(cutoff=4.2, full_list=True)
i, j, S, d = calculator.compute(
    points=positions,
    box=box,
    periodic=True,
    quantities="ijSd"
)

We also provide a function with drop-in compatibility to ASE's neighbor list:

import ase
from vesin import ase_neighbor_list

atoms = ase.Atoms(...)

i, j, S, d = ase_neighbor_list("ijSd", atoms, cutoff=4.2)

See the documentation for more information on how to use the code from C or C++.

Benchmarks

You can find below benchmark result computing neighbor lists for increasingly large diamond supercells, using an AMD 3955WX CPU and an NVIDIA 4070 Ti SUPER GPU. You can run this benchmark on your system with the script at benchmarks/benchmark.py. Missing points indicate that a specific code could not run the calculation (for example, NNPOps requires the cell to be twice the cutoff in size, and can't run with large cutoffs and small cells).

Benchmarks

License

Vesin is is distributed under the 3 clauses BSD license. By contributing to this code, you agree to distribute your contributions under the same license.

Citation

If you found vesin useful, you can cite the pre-print where it was presented (https://doi.org/10.48550/arXiv.2508.15704) as

@misc{metatensor-and-metatomic,
    title = {Metatensor and Metatomic: Foundational Libraries for Interoperable Atomistic
    Machine Learning},
    shorttitle = {Metatensor and Metatomic},
    author = {Bigi, Filippo and Abbott, Joseph W. and Loche, Philip and Mazitov, Arslan
    and Tisi, Davide and Langer, Marcel F. and Goscinski, Alexander and Pegolo, Paolo
    and Chong, Sanggyu and Goswami, Rohit and Chorna, Sofiia and Kellner, Matthias and
    Ceriotti, Michele and Fraux, Guillaume},
    year = {2025},
    month = aug,
    publisher = {arXiv},
    doi = {10.48550/arXiv.2508.15704},
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vesin_torch-0.5.1.tar.gz (78.2 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

vesin_torch-0.5.1-py3-none-win_amd64.whl (1.4 MB view details)

Uploaded Python 3Windows x86-64

vesin_torch-0.5.1-py3-none-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (1.6 MB view details)

Uploaded Python 3manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

vesin_torch-0.5.1-py3-none-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl (1.4 MB view details)

Uploaded Python 3manylinux: glibc 2.24+ ARM64manylinux: glibc 2.28+ ARM64

vesin_torch-0.5.1-py3-none-macosx_11_0_arm64.whl (1.4 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

File details

Details for the file vesin_torch-0.5.1.tar.gz.

File metadata

  • Download URL: vesin_torch-0.5.1.tar.gz
  • Upload date:
  • Size: 78.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for vesin_torch-0.5.1.tar.gz
Algorithm Hash digest
SHA256 2788dcfe3b85d9057e3af00253a027c4aa35f461346c184829abbba0fc52ca4b
MD5 fb452e109b4b95dd53142befc721f5cf
BLAKE2b-256 2231cdd0ba299d5937c44ebe8c08d2fdfc8e484d3baa5965e169b0ec18522ec2

See more details on using hashes here.

File details

Details for the file vesin_torch-0.5.1-py3-none-win_amd64.whl.

File metadata

  • Download URL: vesin_torch-0.5.1-py3-none-win_amd64.whl
  • Upload date:
  • Size: 1.4 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for vesin_torch-0.5.1-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 4f60bd1cb54219587218e2383c2a9da87bbd246d9bbb514b919da4f33ebb36f6
MD5 cee4ef71b3853337669c3683d5f3a159
BLAKE2b-256 0e2cb6d2af2a23306f4512ac1bdb6d80dec50e735e6098044efcb2f0585d856c

See more details on using hashes here.

File details

Details for the file vesin_torch-0.5.1-py3-none-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for vesin_torch-0.5.1-py3-none-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ded777a97cbe04a775678ca8e298a3957f1071b9cd2d497ebb94201d40344327
MD5 9b240b0c40bc34e5fbd5122855b6c62b
BLAKE2b-256 dfa3f5544293e3cf25d4eaf7b4adb663f7497435ba2c49a895eb76d63bdb68e8

See more details on using hashes here.

File details

Details for the file vesin_torch-0.5.1-py3-none-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for vesin_torch-0.5.1-py3-none-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 fc62c61e9505a793bbdd12ace0bb084cd2167df4637f570a417cbef1d3a044fb
MD5 b6da2543ccc2c4db29e67746e1ff848f
BLAKE2b-256 44b54bdfff92a5332f1fb87ad84a219045a8781d3ea838e0cf0f72cb3f009601

See more details on using hashes here.

File details

Details for the file vesin_torch-0.5.1-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for vesin_torch-0.5.1-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8585df06902cd46f9c0f876b0447a4f4334c612b9b23124e9ec215e885b15d55
MD5 88851f46338a36d24db7f8a2dc9c6ae8
BLAKE2b-256 544403928957f0a18739bf6e092099d7a725dc9a1fcb964e266348633ef1cfa9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page