Skip to main content

LAMMPS trajectory file analysis utility

Project description

Trajan

LAMMPS trajectory analysis utility 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.

Trajan is a command-line utility for analyzing molecular dynamics trajectories generated by LAMMPS. It is designed with a focus on disordered systems and oxide glasses, offering specialized tools for calculating density evolution, bond angle distributions, $Q^n$ species distributions, radial distribution functions, and neutron total correlation functions $T(r)$ with experimental broadening.

🔧 Features

  • Command-line interface with argparse-based subcommands
  • Memory efficient: Batch processing for neighbor list generation in large systems
  • Glass Science Toolkit:
    • Density: Time-dependent density evolution
    • Angle: Bond angle distributions with cutoff support
    • Q-unit: Network connectivity analysis ($Q^n$ distribution)
    • RDF: Partial radial distribution functions and Neutron Total Correlation Functions ($T(r)$)
  • Experimental comparison: Includes Lorch window broadening for $T(r)$ to match experimental $Q_{max}$
  • Modular design: New analysis methods can be added as handler classes

📦 Installation

Install from PyPI

The package is published on PyPI. You can install the latest stable release with:

pip install lammps-trajan

Install directly from GitHub (bleeding-edge)

For the latest development version:

pip install git+[https://github.com/superde1fin/trajan.git](https://github.com/superde1fin/trajan.git)

Clone & install locally

For local experimentation or contributing:

git clone [https://github.com/superde1fin/trajan.git](https://github.com/superde1fin/trajan.git)
cd trajan

# Standard install
pip install .

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

Requires Python ≥ 3.6, numpy, and scipy.

🥪 Usage

The general syntax involves providing the trajectory file first, followed by the specific analyzer command:

trajan [file] [analyzer] [options]

1. Density Analysis

Calculates the system density over the trajectory. You must provide the atomic masses or element symbols.

Example:

trajan glass_melt.lammpstrj density Si O Na

If your trajectory uses custom masses, you can specify values directly:

trajan glass_melt.lammpstrj density 28.085 15.999 22.99

Options:

  • -u / --units: LAMMPS unit set (default: metal). Supports real and metal.

2. Bond Angle Distribution (angle)

Calculates the distribution of bond angles for a specified triplet of atom types (Type1-Type2-Type3), where Type2 is the central atom.

Example:

trajan glass_melt.lammpstrj angle 1 2 1 -c 1.8 1.8 -b 500

This calculates the angle distribution for Type 1 - Type 2 - Type 1, assuming a bond cutoff of 1.8 Å.

Options:

  • types: Three integers representing the atomic types (e.g., 1 2 1).
  • -c / --cutoffs: Maximum distance for atoms to be considered bonded.
  • -b / --bincount: Number of histogram bins (default: 1000).

3. Q-unit Distribution (qunit)

Calculates the distribution of $Q^n$ species (connectivity of network formers). The input requires a list of "Former" types and "Connector" types separated by a 0.

Syntax: [Formers] 0 [Connectors]

Example:

trajan silica.lammpstrj qunit 1 0 2 -c 1.8

In this example, Type 1 is the network former (e.g., Si) and Type 2 is the connector (e.g., O). The cutoff is 1.8 Å.

Complex Example (Aluminosilicate):

# Types: 1=Si, 2=Al, 3=O
trajan glass.lammpstrj qunit 1 2 0 3 -c 1.8 1.9

Note: Cutoffs must be provided for every Former-Connector pair in order.


4. Radial Distribution Functions (rdf)

Calculates partial Radial Distribution Functions $g(r)$ and the Neutron Total Correlation Function $T(r)$.

Basic RDF Example:

trajan glass.lammpstrj rdf -p 1 2 -p 1 1 -c 10.0

Neutron Total Correlation Function Example: To calculate $T(r)$, you must map atom types to their neutron scattering lengths (or element names).

trajan glass.lammpstrj rdf -t Si O Na -br 25.0

This calculates the total correlation function using standard scattering lengths for Si, O, and Na, and applies experimental broadening with $Q_{max} = 25.0$ Å⁻¹.

The Physics: When -t is invoked, Trajan calculates: $$ T(r) = 4\pi r \rho_0 G_{total}(r) $$ If -br (broadening) is used, the function is convolved with a Lorch window function to simulate the termination effects of experimental scattering data at finite $Q_{max}$.

Options:

  • -c / --cutoff: Max distance (default: 10 Å).
  • -p / --pair: Specific pairs to analyze (e.g., -p 1 2). Ignored if -t is used.
  • -t / --total: Calculate total correlation function. Provide list of elements or scattering lengths.
  • -br / --broaden: Apply experimental broadening ($Q_{max}$ in Å⁻¹).
  • -bs / --batch-size: Atom batch size for memory management (default: 1000).

📚 Documentation

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

trajan rdf --help

🧠 Design Overview

The project follows a modular "Handler" architecture:

  • cli.py: Main entry point; handles argument parsing and dispatches to specific handlers.
  • base_handler.py: Core logic for parsing LAMMPS dump files, handling periodic boundary conditions, and neighbor searching.
  • handlers/: Contains the logic for specific analyses:
    • density.py: Simple mass/volume calculations.
    • angle.py: Vector algebra for bond angles.
    • qunit.py: Network topology analysis.
    • rdfs.py: Pairwise distances and Fourier transform logic for broadening.

🥪 Development

Install dev dependencies:

pip install .[dev]

🔖 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_trajan-0.0.2.tar.gz (27.9 kB view details)

Uploaded Source

Built Distribution

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

lammps_trajan-0.0.2-py3-none-any.whl (32.2 kB view details)

Uploaded Python 3

File details

Details for the file lammps_trajan-0.0.2.tar.gz.

File metadata

  • Download URL: lammps_trajan-0.0.2.tar.gz
  • Upload date:
  • Size: 27.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for lammps_trajan-0.0.2.tar.gz
Algorithm Hash digest
SHA256 233b9b09f051d3174c614022fd81acb5a9cdde4ff1efed1d229b4dd0f5f2106d
MD5 fc45a5891ec454a1ee7a4de2a0cd136f
BLAKE2b-256 27dd0e3b47321fa32d56666043dfb2e4f9c52575cb0236ba4ed50be1c91c0da7

See more details on using hashes here.

File details

Details for the file lammps_trajan-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: lammps_trajan-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 32.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for lammps_trajan-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4526e7f63e7db84098d184038dc8c8a269463f1e4176a7a14960899c0cfdde46
MD5 72f6b1114111a332bc661bf126619042
BLAKE2b-256 9eb85a6d030a51f27ba26789b3588cc79d62469adaabe7e9aacd4296039044af

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