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, including the 12-6 Lennard–Jones (LJ) and Coulomb potentials.
It currently outputs only the total potential energy and per-atom energies.
(Note: Force and stress calculations are not yet implemented.)

Requirements

  • ASE
  • torch-pme
  • vesin-torch

Installation

Install via pip:

conda create -n nonbond python=3.13
conda activate nonbond
pip install nonbond

Example

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

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

# Unit: Å
sigma = {
    'Ow': 3.16600,
    'Hw': 1.0,
}

# Calculator
calc = Nonbond(
    epsilon=epsilon,
    sigma=sigma,
    cutoff=14.0,  # Unit: Å, cutoff radius for LJ and Coulomb interactions
    coul_method='ewald',  # Options: 'direct', 'ewald', 'pme', 'p3m'
    accuracy=1e-5,  # Accuracy for long-range Coulomb interactions
    device='cpu', # Options: 'cuda'
)

# 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")

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.5.0.tar.gz (10.5 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.5.0-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: nonbond-0.5.0.tar.gz
  • Upload date:
  • Size: 10.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.8

File hashes

Hashes for nonbond-0.5.0.tar.gz
Algorithm Hash digest
SHA256 e7114952cac148058742f96e25cd6c1ef937de931c8ed32b4fbba69034231612
MD5 b1b8d887c33f53f020a715bba234cd9b
BLAKE2b-256 3dd895ae2e2a64d176906a13e5300674a562b25d726ec8624f568c93574ae750

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nonbond-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 11.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.8

File hashes

Hashes for nonbond-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 70b92a3dd6314b0d29879a3169d62bcb7acabeb2fc16cb34831bf3b4cf95428e
MD5 0aaa885b8965bf96d36e68e2f92c8aa4
BLAKE2b-256 d12fa0407c5125d3fe34db2a635d095f9360c2c8f4599fb3ffd7fd99c6298870

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