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 data 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.

API keys

To fit systems not in the repo 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.2

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.2
File Size Uploaded Provenance Actions
gliquid-0.3.2.tar.gz 8.2 MB With provenance Details for gliquid-0.3.2.tar.gz

Built distribution (wheel)

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

Total release size: 15.3 MB

Release files / gliquid-0.3.2.tar.gz

Download URL gliquid-0.3.2.tar.gz
Size 8.2 MB
Tags Source
SHA-256 checksum
How to use checksums
4b14d2e8eff837dede8636bc0d71db24a0a6a01cf6f187ecfeeb2d8a684634cc
BLAKE2b-256 checksum
How to use checksums
e0d0c11dfa57ac0675e26f0aefbd510cbf57eb6fc9fca42737bd74c57930a93d
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 Oct 29, 2026.

Transparency log

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

Download URL gliquid-0.3.2-py3-none-any.whl
Size 7.1 MB
Tags Python 3
SHA-256 checksum
How to use checksums
f94de16e7bcfcd231bc425602eebd417224c9d1775c8a700176c51e1f17082a0
BLAKE2b-256 checksum
How to use checksums
b5d5867501631bdc37a25dcff9c6e1a3f3700efd7df7b199214cb54495c257eb
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 Oct 29, 2026.

Transparency log

Security for gliquid 0.3.2

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.2.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 Oct 29, 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