Skip to main content

Generator for LAMMPS two-body and three-body tabulated potentials.

Project description

Tablegen

LAMMPS potential table generator for LAMMPS, developed by Vasilii Maksimov at the Functional Glasses and Materials Modeling Laboratory (FGM²L) at the University of North Texas, under the supervision of Dr. Jincheng Du.

Tablegen is a command-line utility for generating two-body and three-body potential tables for use with LAMMPS simulations. It supports several interaction models commonly used in materials science and glass chemistry, including:

  • SHIK potential (Buckingham + Wolf summation)
  • Classical Buckingham potential
  • Extended Buckingham potential with softening
  • Truncated harmonic three-body interactions

🔧 Features

  • Command-line interface with argparse-based subcommands
  • Supports plotting potential curves with matplotlib
  • Generates .table and .3b files directly usable in LAMMPS
  • Fully modular: new potentials can be added as new handler classes
  • Handles numeric precision using mpmath
  • Actively developed for materials modeling workflows

📦 Installation

Install from PyPI (preferred)

The package is now published on PyPI you can install the latest stable release with:

pip install lammps-tablegen

Install directly from GitHub (bleeding‑edge)

If you need the most recent commit:

pip install git+https://github.com/superde1fin/tablegen.git

Clone & install locally

For local experimentation or contributing:

git clone https://github.com/superde1fin/tablegen.git
cd tablegen

# Standard install (no dev extras)
pip install .

# OR editable install (auto‑reload while editing)
pip install -e .

Tip : add the [dev] extra to pull in testing, type‑checking, and release tools:

pip install .[dev]

This installs pytest, ruff, mypy, twine, and other developer utilities declared in pyproject.toml.

Requires Python ≥ 3.9 and a working C/Fortran toolchain if installing numpy from source.

🥪 Usage

After installation, invoke the CLI with:

tablegen [subcommand] [options]

Available subcommands:

  • shik: Generate two-body tables using the SHIK potential
  • buck: Generate tables using the standard Buckingham potential
  • buck_ext: Use the extended Buckingham potential with softened short-range repulsion
  • 3b_trunc: Generate three-body truncated harmonic tables

Example usage:

tablegen shik structure_file.lmp Si O -t SHIK.table -p
tablegen buck Na-O Si-O -c 10 -d 5000 -t buck.table -p -10 10

📚 Documentation

All subcommands support -h or --help flags for detailed usage:

tablegen shik --help

🧠 Design Overview

The project is modular:

  • cli.py: Main entry point, defines CLI and parses arguments
  • handlers/: Contains one handler class per potential type (SHIK, BUCK, etc.)
  • constants.py: Shared constants (e.g., cutoffs, physical constants, default coefficients)
  • __init__.py: Exposes handler classes and version metadata
  • pyproject.toml: Build and dependency metadata

Each handler:

  • Parses user-provided arguments
  • Validates species/pair/triplet input
  • Prompts for coefficients
  • Provides eval_force and eval_pot methods used by two_body() or three_body()

📈 Plotting

If the --plot option is passed, matplotlib will be used to visualize the potential curves for the specified pairs or triplets.

🥪 Development

Install dev dependencies:

pip install .[dev]

Run tests:

pytest

🔖 License

GNU General Public License v3.0 (GPLv3). See LICENSE for details.

👤 Author

Vasilii Maksimov
University of North Texas
✉️ VasiliiMaksimov@my.unt.edu

🌐 Links

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

lammps_tablegen-0.1.2.tar.gz (22.4 kB view details)

Uploaded Source

Built Distribution

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

lammps_tablegen-0.1.2-py3-none-any.whl (24.7 kB view details)

Uploaded Python 3

File details

Details for the file lammps_tablegen-0.1.2.tar.gz.

File metadata

  • Download URL: lammps_tablegen-0.1.2.tar.gz
  • Upload date:
  • Size: 22.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for lammps_tablegen-0.1.2.tar.gz
Algorithm Hash digest
SHA256 dbf0c5d9381f2f382c6936940430cfc14a1436b899b68e0302bc978f512d010c
MD5 7173a282acd714bb123a985fb00b0f46
BLAKE2b-256 fb8b7438001f06a15ad483fb9797d6a379ff6534ba01fbb22589d41da6653c21

See more details on using hashes here.

File details

Details for the file lammps_tablegen-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for lammps_tablegen-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5814fd887e8cd1ab6a03792c350e84e8be1143f9b03c5df484a3464ee34c2078
MD5 3e9ff4b130be6fdd760dde7b99830f01
BLAKE2b-256 9a8c367a486c1243426f781248db583cdf24b393611481393720793e6a682d31

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