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.6.0.tar.gz (10.6 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.6.0-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for nonbond-0.6.0.tar.gz
Algorithm Hash digest
SHA256 8a22599a9404c806b9b0c789d9b2be15a7a472ef82f17dc2d4aaa0110364905f
MD5 d71ff64e6755e17a8cfe6d0b88e8041e
BLAKE2b-256 7083af2655189dd9640dce139cea94a3a44c6c43cde8dc21142a1854cd7f44f4

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for nonbond-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e18c0961efba67faf67cbd8736013d0610bc333d4d58ba4fc83730dde1cb4af5
MD5 a793a2877b597009f35034251418d407
BLAKE2b-256 d044862a90a77a08037f2aa27cb82cd80a1c1a40fc51126954d185725988053a

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