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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nonbond-0.3.0.tar.gz.
File metadata
- Download URL: nonbond-0.3.0.tar.gz
- Upload date:
- Size: 7.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
772658d7ef6484f56fab2e6a81a5d5e58500e10d31163f11cd927668f06ff1c9
|
|
| MD5 |
944421c5682e868d9f5e6debee363496
|
|
| BLAKE2b-256 |
f19d8f8e096e81f5288f11ad9be1d0ffa84d92abf9a3e690ff232f1b24fb72f2
|
File details
Details for the file nonbond-0.3.0-py3-none-any.whl.
File metadata
- Download URL: nonbond-0.3.0-py3-none-any.whl
- Upload date:
- Size: 7.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
06d05db81588d2bcc6e8b804ea93dbbd4fbaf883146d176fe327707a639a6d22
|
|
| MD5 |
f9496a5010bd17c38b8733c580f64486
|
|
| BLAKE2b-256 |
337d5d20b44178e06d06d241b45a39f69326a125218074c5bb62f87be4630e80
|