Skip to main content

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

Metadata

Release files for chemphase 1.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for chemphase 1.0.3
File Interpreter ABI Platform Actions
chemphase-1.0.3-py3-none-any.whl Python 3 none any Details for chemphase-1.0.3-py3-none-any.whl

Release files / chemphase-1.0.3-py3-none-any.whl

Download URL chemphase-1.0.3-py3-none-any.whl
Size 22.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f44cf40ee0d1434d3ea6691380f1da16275d0c00c14b5ff13b006228dc9a0877
BLAKE2b-256 checksum
How to use checksums
6346bf391f641132a8ff6787c1945a6cbbeb6a641ef7b5755b49f7e0963f1b74
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.11

Security for chemphase 1.0.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page