Skip to main content

TorchScript-able neighbor lists implementations (linear and quadratic scaling) for molecular modeling

Project description

torch_nl

Provide a pytorch implementation of a naive (compute_neighborlist_n2) and a linked cell (compute_neighborlist) neighbor list that are compatible with TorchScript.

Their correctness is tested against ASE's implementation.

Note that contrary to ASE, the atoms positions are assumed to be wrapped inside the unit cell.

How to

instal with pip

pip install torch-nl

use the neighborlist

from torch_nl import compute_neighborlist, ase2data
from ase.build import bulk, molecule

frames = [bulk("Si", "diamond", a=6, cubic=True), molecule("CH3CH2NH2")]
pos, cell, pbc, batch, n_atoms = ase2data(frames)

mapping, batch_mapping, shifts_idx = compute_neighborlist(
    cutoff, pos, cell, pbc, batch, self_interaction
)

Benchmarks

Periodic structure

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

torch_nl-0.3.tar.gz (11.6 kB view details)

Uploaded Source

Built Distribution

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

torch_nl-0.3-py3-none-any.whl (12.9 kB view details)

Uploaded Python 3

File details

Details for the file torch_nl-0.3.tar.gz.

File metadata

  • Download URL: torch_nl-0.3.tar.gz
  • Upload date:
  • Size: 11.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.7

File hashes

Hashes for torch_nl-0.3.tar.gz
Algorithm Hash digest
SHA256 e89a836691e665a5841128fae439fab15ae60af73dd111740f3aaf74289898b5
MD5 0e6c859c01ddb938bef1f4b1d82b2409
BLAKE2b-256 2876d3704afa7d5627c586da83b4a760001e0621988d1694895fdb29c4d777eb

See more details on using hashes here.

File details

Details for the file torch_nl-0.3-py3-none-any.whl.

File metadata

  • Download URL: torch_nl-0.3-py3-none-any.whl
  • Upload date:
  • Size: 12.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.7

File hashes

Hashes for torch_nl-0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 7588ae71c8889243f50d5c2a7826c9864007f2b285b5b67cc2096daf35ccc6f5
MD5 9d1208de3e14fcbf2025bbbea9e1727c
BLAKE2b-256 0da42f31e2aeb5115951ced565760c7c341d0c8dfdb171e05b314f52d22fc089

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