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.

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)

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

pip install 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.0.tar.gz (22.2 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.0-py3-none-any.whl (15.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: lammps_tablegen-0.1.0.tar.gz
  • Upload date:
  • Size: 22.2 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.0.tar.gz
Algorithm Hash digest
SHA256 48f7d4964018b84a1be594d9a9246014cfa75c2a0f66cc0dd9a0de1577574a21
MD5 837f235740d45ff0fb9f86ac3ef43c19
BLAKE2b-256 b0af3b462f0bd15f66fa737b09f39aced8e0e316d8884b97ab53ea38fc81aaa0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lammps_tablegen-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 401a523161dcdd8915c01b81aaae6081c72c4650f2c238f2cc2984a64fd8ddec
MD5 118fb87389581c627dc1881c89a975f3
BLAKE2b-256 110faaeb69fd737d5f1195c1f2d788009e0760a6b79c1bca38401b8e981c6185

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