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

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for nonbond-0.4.0.tar.gz
Algorithm Hash digest
SHA256 31306e3ed2b467e71e58bb8f5fd32caf9baae2e26ef4185f4ab20f7127d9087d
MD5 d75a61ec3ed247e18adcddfeeef9b8d0
BLAKE2b-256 66683f5f3243dae5265b48738866c372c85280eab306f5f17d3a14b17012a540

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for nonbond-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b4302bb0ee9dd49be77113834cd7cef3ff3614096d589b200c0702904c69fcf0
MD5 d67d389b578c7f70646ff50e6b13f085
BLAKE2b-256 a5d30ee63498079225a4c4da61d69ee628aa82ea0d53878b3c5bf4f7bd2ae3e9

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