Skip to main content

Add your description here

Project description

Nonbond

Nonbond is an ASE (Atomic Simulation Environment) calculator designed for computing non-bonded interactions.
Currently, it is primarily intended for use in specific contexts such as GCMC simulations, as it outputs only the total energy and per-atom energies (forces are not yet implemented).


🧩 Features

  • Lennard-Jones (LJ) potential energy calculations
  • Efficient long-range Coulomb interaction algorithms
  • Fast neighbor list construction using PyTorch and vesin
  • GPU acceleration via PyTorch

🧠 Requirements

  • Python ≥ 3.12
  • ASE ≥ 3.26.0
  • torch-pme ≥ 0.3.2
  • vesin-torch ≥ 0.4.2
  • PyTorch (latest stable version recommended)

⚙️ Installation

Install via pip:

pip install nonbond

🚀 Example

from ase import Atoms
from nonbond import Nonbond
import numpy as np

# Define Lennard-Jones parameters for SPC/E water
epsilon = {
    'Ow': 0.15535,
    'Hw': 0.0,
}

sigma = {
    'Ow': 3.16600,
    'Hw': 1.0,
}

# Create calculator
calc = Nonbond(
    epsilon=epsilon,
    sigma=sigma,
    rc=14.0,
    charge_method='ewald',  # Options: 'direct', 'ewald', 'pme', 'p3m'
    accuracy=1e-5
)

# Build an SPC/E water molecule
atoms = Atoms(
    'OH2',
    positions=[
        [0.00000, -0.06461, 0.00000],
        [0.81649,  0.51275, 0.00000],
        [-0.81649, 0.51275, 0.00000]
    ],
    cell=[40.0, 40.0, 40.0],
    pbc=True
)

# Assign atom types and charges
atoms.set_array('type', np.array(['Ow', 'Hw', 'Hw']))
atoms.set_initial_charges([-0.8476, 0.4238, 0.4238])

# Attach calculator and compute energy
atoms.calc = calc
energy = atoms.get_potential_energy()
print(f"Potential energy: {energy:.6f} eV")

📝 Notes

  • Only energy calculations are currently supported.
  • Force and stress tensor support will be added in future releases.

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

nonbond-0.1.0.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

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

nonbond-0.1.0-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file nonbond-0.1.0.tar.gz.

File metadata

  • Download URL: nonbond-0.1.0.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for nonbond-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5de3c7a5b9c73938436a9b1c9924eab028e9fac3415cfda1075417ffc3d31a82
MD5 8bda33115dc62f2896feca8955e734e6
BLAKE2b-256 3f4b1be45e6f27f3b028a6e8364e06f090178bd80f5c19f3b88362f404276adf

See more details on using hashes here.

File details

Details for the file nonbond-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: nonbond-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for nonbond-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7714d7f6fc8554bc14ae38da9344d175814db40e945dee7ea29912eef963795b
MD5 8d571344dbed15ec4f9e26c8000be9ee
BLAKE2b-256 393e7b5518f31fc54b7d933dc0ba9bae3e197959a5d5875f90908a57e95c8c3f

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