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.3.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.3-py3-none-any.whl (24.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: lammps_tablegen-0.1.3.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.3.tar.gz
Algorithm Hash digest
SHA256 7992f23569b241d817e249bf5c796cb6ae1610129ea5408221ebd6a9f766afc7
MD5 e32553cfe4225fcd734b4099bfe42d77
BLAKE2b-256 c9d37e9353ce5851a6aadfa48db62bd35a7b9936ea659499d36f04d1ee7955ec

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lammps_tablegen-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 7e1b89a5d4b90fb9a7e2bf6b8fe5d91d8e04c5741ef1e2e6250ef324be24d0b0
MD5 bc7b61b089f9330af9fd94be36589050
BLAKE2b-256 f5b4005527a2b2b2be3b385e3eca636c5148ab0a89b04ab0eb4ceeb1a204267e

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