Skip to main content

Muse

PyPI version Python 3.10+ License: MIT Build and Test

Muse (Mixture builder for simulation environments) is a Python package for rapidly building amorphous solids and liquid mixtures from relaxed solid-state structures on Materials Project. It uses Packmol for packing molecules into simulation cells and supports density equilibration through molecular dynamics with machine learning interatomic potentials (MLIPs), especially universal interatomic potentials (UIPs) such as MACE and CHGNet.

Features

  • Structure generation — Build binary/multicomponent amorphous mixtures from Materials Project crystal structures via mix_number and mix_cell
  • Density equilibration — Run NVT → NPT molecular dynamics workflows to compute equilibrium densities with DensityCalc
  • Thermodynamic analysis — Plot binary mixing enthalpy (G–x), density–composition, and excess volume diagrams with Redlich–Kister fits
  • Trajectory I/O — Convert pymatgen trajectories to extended XYZ format
  • HPC integration — Submit SLURM batch jobs programmatically

Installation

pip install muse-xtal

Optional extras

# MACE calculator support
pip install "muse-xtal[mace]"

# Development tools (ruff, pytest)
pip install "muse-xtal[dev]"

# Documentation building
pip install "muse-xtal[docs]"

Prerequisites

Muse requires Packmol to be installed and available on your PATH. You can compile it from source:

bash scripts/install-packmol.sh

You also need a Materials Project API key set as the MP_API_KEY environment variable (or in a .env file).

Quick Start

from muse.transforms.mixture import mix_number

# Build a NaCl–KCl mixture (3:1 ratio, ~20 atoms)
atoms = mix_number(
    recipe={"NaCl": 3, "KCl": 1},
    tolerance=2.0,
    scale=1.05,
    seed=42,
)
print(atoms)  # Atoms object ready for simulation

Density equilibration with MACE

import numpy as np
from ase import units
from mace.calculators import MACECalculator
from muse.calcs.density import DensityCalc

calc = MACECalculator(model_paths="path/to/model", device="cpu")

density_calc = DensityCalc(
    calculator=calc,
    optimizer="FIRE",
    steps=500,
    mask=np.eye(3),
    rtol=1e-3,
    atol=5e-4,
)

results = density_calc.calc(
    atoms=atoms,
    temperature=1100,  # K
    externalstress=0.0,  # eV/ų
)
print(f"Density: {results['mass_density']:.4f} amu/ų")

Documentation

Full documentation is available at chiang-yuan.github.io/muse.

Citation

If you use Muse in your research, please cite:

@software{chiang2023muse,
  author    = {Chiang, Yuan},
  title     = {muse-xtal},
  version   = {0.2.0},
  year      = {2023},
  doi       = {10.5281/zenodo.10369245},
  url       = {https://github.com/chiang-yuan/muse}
}

Contributing

Contributions are welcome! See CONTRIBUTING.md for guidelines.

License

This project is licensed under the MIT License — see LICENSE for details.

Metadata

Release files for muse-xtal 0.2.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 muse-xtal 0.2.0
File Size Uploaded
muse_xtal-0.2.0.tar.gz 21.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for muse-xtal 0.2.0
File Interpreter ABI Platform
muse_xtal-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 46.6 kB

Release files / muse_xtal-0.2.0.tar.gz

Download URL muse_xtal-0.2.0.tar.gz
Size 21.8 kB
Tags Source
SHA-256 checksum
How to use checksums
d78f5828d86e6d5d4806e68da6eb50788a5258bd5205e554782880c1ecb6414a
BLAKE2b-256 checksum
How to use checksums
35439431dd8ed8a45246d8bdb5e684112961490b62e4c698ad3cb993fe28bfb6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Apr 18, 2026.

Transparency log

Release files / muse_xtal-0.2.0-py3-none-any.whl

Download URL muse_xtal-0.2.0-py3-none-any.whl
Size 24.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
aff178d1f97d35f03b976ef45e14f73f28f6cf29ce3bcbcd684e4fc402fd7ad8
BLAKE2b-256 checksum
How to use checksums
d23783e9f85ef7163fc5303582ac4c816dae0c809c47f5329cccddd09f10620e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Apr 18, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

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