Skip to main content

Phase diagram & chemical potential heatmap generator — binary/ternary composition diagrams, chempot diagrams, and fixed chemical potential heatmaps from Materials Project API or local VASP data

Project description

chemphase

Phase Diagram & Chemical Potential Heatmap Generator v5.0

Python License

Generate high-quality phase diagrams from Materials Project API or local VASP calculations.

Features

  • API Mode: Download thermodynamic data from Materials Project database
  • Local Mode: Read local VASP calculation directories (POSCAR + vasprun.xml/OUTCAR)
  • Hybrid Mode: Local data + API supplement
  • Binary Composition Diagrams: ΔE vs composition with convex hull and auto label positioning
  • Ternary Composition Diagrams: Gibbs triangle plots (Plotly interactive) with Delaunay hull triangulation
  • Chemical Potential Diagrams: pymatgen ChemicalPotentialDiagram (binary/ternary/quaternary)
  • Fixed Chemical Potential Heatmaps: doped CompetingPhasesAnalyzer heatmaps (requires chemphase[heatmap])
  • Structure Comparison: Detect crystal structure differences between local calculations and MP database

Installation

pip install chemphase

# With heatmap support
pip install chemphase[heatmap]

# With PNG export support for chempot diagrams
pip install chemphase[export]

Quick Start

API Mode (default)

# Use default elements Cu-Ag-O-Se
chemphase

# Specify elements
chemphase --elements Li O Co

# With chemical potential diagrams
chemphase --elements Li O Co --chempot

# With heatmaps (requires doped)
chemphase --elements Li O Co --chempot --heatmap

Local VASP Data Mode

chemphase --local /path/to/vasp/calculations --elements Cu Ag O Se

Structure Comparison

chemphase --local /path/to/vasp/calculations --elements Cu Ag O Se --compare-structure

Dependencies

  • pymatgen — Materials analysis library
  • doped — Defect calculation tools (optional, for heatmaps)
  • matplotlib — 2D plotting
  • plotly — Interactive ternary diagrams

API Key

API mode requires a Materials Project API key. Set the environment variable:

export MATERIALS_PROJECT_API_KEY=your_key_here

Get a key at: https://materialsproject.org/api

Command-Line Arguments

Argument Description Default
--elements Element list Cu Ag O Se
--local Local VASP directory
--output Output directory phase_diagrams_output
--eah Energy above hull threshold 0.05 eV/atom
--compare-structure Enable structure comparison False
--chempot Generate chemical potential diagrams False
--heatmap Generate fixed chemical potential heatmaps False
--debug Debug mode False

Python API Usage

from chemphase import (
    PhaseDiagramConfig,
    generate_binary_composition_diagram,
    generate_ternary_composition_diagram,
    generate_chempot_phase_diagram,
    find_viable_hosts,
    generate_fixed_chempot_heatmap,
)

from pathlib import Path

# Configure
config = PhaseDiagramConfig(
    api_key="your_mp_api_key",
    eah_threshold=0.05,
    output_root="my_output",
)

# Generate diagrams programmatically — see examples/ for full usage

License

MIT License — see LICENSE

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

chemphase-1.0.2-py3-none-any.whl (20.8 kB view details)

Uploaded Python 3

File details

Details for the file chemphase-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: chemphase-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 20.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.11

File hashes

Hashes for chemphase-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c1e1299240305637d22ab8b5c90588011b6d47cd7573d6e782a41dcf8a4fc351
MD5 ce7d8c198ad59b7fcc55ad707a68e33d
BLAKE2b-256 4d1969eebe53e2a446257c1f7a4fde126833eb52e919fd85c32efc23f7f776b1

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