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.5.tar.gz (84.9 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.5-py3-none-win_amd64.whl (1.7 MB view details)

Uploaded Python 3Windows x86-64

vesin_torch-0.5.5-py3-none-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (1.8 MB view details)

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

vesin_torch-0.5.5-py3-none-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl (1.7 MB view details)

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

vesin_torch-0.5.5-py3-none-macosx_11_0_arm64.whl (1.7 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

File details

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

File metadata

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

File hashes

Hashes for vesin_torch-0.5.5.tar.gz
Algorithm Hash digest
SHA256 1f1ac806e6e305b3e5878d1cf3593ac8702ed8c4a093c3cf769f4e9b264f56ae
MD5 6bcf8b74c9141f22fb1b63c010ca4438
BLAKE2b-256 d1568dab4001ea9ea152d8e24e065e31bac5c92e6e983eb5eceda7a00a353868

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for vesin_torch-0.5.5-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 d31d26857f16f967284ef9be24328fdfe74d164cc1abb93fdd80683e7a9f159c
MD5 eeeae72e4f4027903b0e0a446a39d66e
BLAKE2b-256 0770480bebd96976ac0b394b4d1dba7dff29271aef9128d1fd9f14b092699881

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for vesin_torch-0.5.5-py3-none-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 73c9ed73864814bfa5779b01e5b219a2322abb4c18b95fbf82c642ff1ed4b7e2
MD5 d014d5eafa3bacd5cdc92363d6f963b0
BLAKE2b-256 34759218f2c81b60d7eb59fd67287009cdd41dc790fa1945beb793f1d63b319f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for vesin_torch-0.5.5-py3-none-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 c696df4ee25c0f1de43501c16b798777de304106a3f28cb0ec5787acade228ed
MD5 52c8650009b1697d27cfc3038f0a3573
BLAKE2b-256 4831da3d46bba85b1efda311abff24d0ae954600ee1c75033c4f73544c862216

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for vesin_torch-0.5.5-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6523390a19f6b2a7a14968e8583657dfb1c4d51e61099100b69baae31e86eede
MD5 a471bb1ef3e7da6532cd1a20355189e2
BLAKE2b-256 873f8cc003f26c63726aae7e603545817316323061c03c43b6fda3ff2d048bd8

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