A robust Python CLI tool for automating the calculation and plotting of binary system phase diagrams (convex hulls) using LAMMPS. It directly queries the Materials Project API (via mp-api) for all known structures of a given system, sets up LAMMPS simulations using ML potentials (like ACE/GRACE), and plots the lowest-energy convex hull.
- Fully automated fetch of structural polymorphs from Materials Project
- Handles disconnected compute nodes (via the
--setup-onlyflag on a login node) - Skip-aware: Resumes safely without recalculating completed structures
- Automatic parsing of crystallographic Space Groups for plot labels
- Generates a mathematically strictly-convex lower hull plot and a CSV of formation energies
- Multi-Model Comparison: Run calculations for multiple potentials (e.g., GRACE and ACE) and compare their convex hulls on a single, beautifully formatted plot with smart, deduplicated structure labels.
You can install this directly into any conda environment.
-
Clone the repository:
git clone https://github.com/<your-username>/ConvexHull_Workflow.git cd ConvexHull_Workflow
-
Install as an editable package:
pip install -e .
Create an input.yaml file defining your system. You can specify a single model or compare multiple models.
elements:
- Ni
- Al
api_key: "YOUR_MP_API_KEY"
compare_models: true
show_only_negative_energies: true # Optional: set to true to hide structures with positive formation energy
models:
- name: "GRACE"
lammps_exec: "lmp"
pair_style: "pair_style grace"
pair_coeff: "pair_coeff * * /path/to/grace_potential_file Ni Al"
output_dir: "grace_calculations"
- name: "ACE"
lammps_exec: "lmp"
pair_style: "pair_style pace"
pair_coeff: "pair_coeff * * /path/to/ace Ni Al"
output_dir: "run_ace"elements:
- Ni
- Al
api_key: "YOUR_MP_API_KEY"
potential: "/path/to/your/potential/file"
pair_style: "pair_style pace"
pair_coeff: ""
output_dir: "test_run"
lammps_exec: "lmp"-
On the Login Node (where internet is available):
convex_hull -i input.yaml --setup-only
This will download all structures and prepare the LAMMPS inputs in the designated
output_dir(s). -
On the Compute Node (submit via Slurm script):
convex_hull -i input.yaml
This will run LAMMPS offline in the prepared directories, extract all energies, and plot the convex hull.
If you just want to tweak plotting settings (e.g., turning show_only_negative_energies on or off) without doing any calculations again, you can use the --plot-only flag. This will instantly load the existing data and redraw the plot:
convex_hull -i input.yaml --plot-only