Skip to main content

GLiquid: DFT-Referenced Thermodynamic Modeling

License: MIT Python Open In Colab

GLiquid fits DFT-referenced liquid free energies to binary phase diagrams. From those fits it interpolates ternary liquidus surfaces and predicts liquid parameters for unassessed systems with a bundled machine-learning model. Browse the fitted and predicted systems in the interactive matrix.

Installation

GLiquid supports Python 3.10–3.13. Install it into a fresh environment:

conda create --name gliquid-env python=3.12
conda activate gliquid-env
pip install gliquid

Optional extras:

Extra Install Adds
ml pip install "gliquid[ml]" ML predictions of liquid parameters (ProductionModelRunner)
mpds pip install "gliquid[mpds]" downloading phase diagrams from MPDS that are not already cached
notebook pip install "gliquid[notebook]" Jupyter and the interactive widgets used in the notebooks

Data and notebooks

The package does not include per-system data (DFT convex hulls and digitized phase diagrams). Clone the repository for the example notebooks and the cached DFT convex hulls they use:

git clone https://github.com/willwerj/gliquid_python.git

Then point GLiquid at the clone's cache/ folder:

import gliquid.config as cfg
cfg.set_cache_dir("path/to/gliquid_python/cache")

Without this, systems are fetched as needed and saved to ./gliquid_cache.

To add a digitized phase diagram, open its entry on MPDS, click JSON and save the file into the cache directory under any name. Each notebook lists the entries it uses.

API keys

To fit systems not in your cache, you'll need both MP and MPDS API keys. If you only interpolate from the fitted parameters in our published dataset (interactive matrix), you only need the MP API key.

  • Materials Project (DFT data): get a key at materialsproject.org.
  • MPDS (phase diagrams): needs the mpds extra and an MPDS account (paid subscription at mpds.io).
import os
os.environ["NEW_MP_API_KEY"] = "your Materials Project key"
os.environ["MPDS_API_KEY"] = "your MPDS key"

Quick start

from gliquid.binary import BinaryLiquid, BLPlotter

bl = BinaryLiquid.from_cache("Cu-Mg")
fits = bl.fit_parameters(n_opts=5)
best = min(fits, key=lambda fit: fit["mae"])
print(f"liquidus MAE {best['mae']:.0f} K, MAPE {best['mape']:.1f}%")

BLPlotter(bl).show("fit+liq")

The notebooks walk through fitting (fitting_demo), ternary interpolation (interpolation_demo) and adjusting a prediction to experiment (GaRu_adjustment, PbTb_adjustment). To run them locally, install the notebook extra and start Jupyter from the notebooks folder.

Google Colab

Open colab_demo.ipynb for a complete example that runs without API keys. Each of the other notebooks has a commented Colab setup cell at the top; uncomment it to run that notebook on Colab. For use in Colab, install GLiquid without extras: Colab already has XGBoost and the notebook widgets.

Citing

If GLiquid contributes to published work, please cite it using CITATION.cff (GitHub's "Cite this repository" button).

Contributing

Pull requests are welcome. CONTRIBUTING.md covers development setup and running the tests. Release history is in CHANGELOG.md.

License

MIT

Acknowledgements

This project is made possible by funding from the U.S. Department of Energy (DOE) Office of Science, Basic Energy Sciences Award No. DE-SC0021130 and the National Science Foundation (NSF) Award No. OAC-2209423.

Metadata

Release files for gliquid 0.3.6

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

Source distribution (sdist)

Source distribution for gliquid 0.3.6
File Size Uploaded Provenance Actions
gliquid-0.3.6.tar.gz 8.3 MB With provenance Details for gliquid-0.3.6.tar.gz

Built distribution (wheel)

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

Total release size: 15.4 MB

Release files / gliquid-0.3.6.tar.gz

Download URL gliquid-0.3.6.tar.gz
Size 8.3 MB
Tags Source
SHA-256 checksum
How to use checksums
04e7a488b55c9fe576eb8749a05ea98e94e86cf1fc70a5a1033ff871b24b4dd9
BLAKE2b-256 checksum
How to use checksums
2b5230c922170c9d452f188a7dce7bf9dc84e9bbcce2f5622ef0dd007d6db481
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 Nov 25, 2026.

Transparency log

Release files / gliquid-0.3.6-py3-none-any.whl

Download URL gliquid-0.3.6-py3-none-any.whl
Size 7.2 MB
Tags Python 3
SHA-256 checksum
How to use checksums
68ab49d9638e82cf1be25114777de2e5bb1c15127b93f74c34ee468c7f9256ac
BLAKE2b-256 checksum
How to use checksums
343e4825ff917ac9ad8dd6e02657fc0bb9ef9914d77cedf3acf3da3fc2eb1c14
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 Nov 25, 2026.

Transparency log

Security for gliquid 0.3.6

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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for gliquid-0.3.6.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 Nov 25, 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.

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