Skip to main content

PyPI DOI Documentation Status Ask DeepWiki

landau.py

A library to calculate thermodynamic equilibria and plot phase diagrams of binary alloys in the (semi-)grand ensemble.

You supply a free energy model for each phase — analytic toy models, CALPHAD-style parametrizations, or interpolations of computed free energy data — and landau finds the stable phases, refines the phase boundaries and draws the diagram.

Mg-Ca phase diagram with labelled transition temperatures
Mg–Ca worked example
A real system, from free energies of a machine learning potential.
Phase diagram with a liquid miscibility gap over a line compound, invariant temperatures labelled
Transition temperatures
Three-phase reactions and congruent points, solved and labelled.
Phase diagram of an ordered compound with a finite solubility range
Point defects
Off-stoichiometry of an ordered compound from point defect energies.
Free energy curves of four phases with their common tangents
Excess free energy
The free energy curves and common tangents behind a diagram.
Semi-grand potential of three phases against temperature, transitions marked
Basics
Phases compete through their semi-grand potential.
Phase diagram in chemical potential and temperature
Plot gallery
Every plot function, including diagrams in chemical potential.

Installation

pip install landau

Installation covers installing from source.

Quickstart

Phases are defined by their free energies. Two ideal solutions — a solid and a liquid — already give a full binary phase diagram:

import numpy as np
from landau import LinePhase, IdealSolution, plot_phase_diagram
from landau.calculate import calc_phase_diagram
from landau.phases import kB

solid = IdealSolution("solid",
    LinePhase("A",    fixed_concentration=0, line_energy=-2.0, line_entropy=1.0 * kB),
    LinePhase("B",    fixed_concentration=1, line_energy=-3.0, line_entropy=1.5 * kB))
liquid = IdealSolution("liquid",
    LinePhase("A(l)", fixed_concentration=0, line_energy=-1.9, line_entropy=2.5 * kB),
    LinePhase("B(l)", fixed_concentration=1, line_energy=-2.9, line_entropy=2.2 * kB))

df = calc_phase_diagram([solid, liquid], Ts=np.linspace(400, 1800, 100), mu=100)
plot_phase_diagram(df)

Concentration-temperature phase diagram of a solid and a liquid ideal solution

calc_phase_diagram returns a plain pandas dataframe of (T, mu, phase, c, phi) samples that the plotting functions consume, so intermediate results stay easy to inspect and post-process.

Where Next

Citation

This code is part of a publication, please cite it accordingly if you use this package in your work

@article{poul2025automated,
    title = {Automated generation of structure datasets for machine learning potentials and alloys},
    journal = {npj Computational Materials},
    author = {Poul, Marvin and Huber, Liam and Neugebauer, J{\"o}rg},
    volume = {11},
    number = {1},
    pages = {174},
    year = {2025},
    doi = {10.1038/s41524-025-01669-4},
}

Metadata

Release files for landau 1.20.0

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

Source distribution (sdist)

Source distribution for landau 1.20.0
File Size Uploaded Provenance Actions
landau-1.20.0.tar.gz 27.0 MB With provenance Details for landau-1.20.0.tar.gz

Release files / landau-1.20.0.tar.gz

Download URL landau-1.20.0.tar.gz
Size 27.0 MB
Tags Source
SHA-256 checksum
How to use checksums
22304eea936c9252f74b4f54a0385c982eab46f65bbe30d8552acb9959fd5d04
BLAKE2b-256 checksum
How to use checksums
bbcd41b3b3fd95a38743def5b5369f5df2309897c6f3b0ab576591c686223536
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.

Transparency log

Security for landau 1.20.0

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.

Full provenance

1 file in this release has been uploaded with provenance metadata.

Attestation for landau-1.20.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

1.20.0 This release

1 release file Full provenance

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