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 worked example A real system, from free energies of a machine learning potential. |
Transition temperatures Three-phase reactions and congruent points, solved and labelled. |
Point defects Off-stoichiometry of an ordered compound from point defect energies. |
|
Excess free energy The free energy curves and common tangents behind a diagram. |
Basics Phases compete through their semi-grand potential. |
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)
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
- Examples: all worked notebooks, from the basic concepts to phases built on ASE calculators.
- API Reference: phases, interpolators, refiners and plotting.
- Caching with fleche: reuse expensive diagrams across sessions.
- Publications: papers that use landau.
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.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| landau-1.20.1.tar.gz | 27.0 MB | With provenance | Details for landau-1.20.1.tar.gz |
Release files / landau-1.20.1.tar.gz
| Download URL | landau-1.20.1.tar.gz |
|---|---|
| Size | 27.0 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a5a3ec7f88920c7e04fc081c4349494910c2b4582e3ed093ca7596d8ecc70267
|
|
BLAKE2b-256 checksum How to use checksums |
05bb57903f27efd4f9ea02e3d5f090c3678acc92e4d4288d7ec088cc909fa44e
|
| 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 logSecurity for landau 1.20.1
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.1.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 logA 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.