pymatgen-analysis-alloys Library

0.0.8 · active · verified Fri Apr 17

pymatgen-analysis-alloys is an add-on library for Pymatgen, providing classes and tools specifically designed for describing alloy (disordered) systems. It extends Pymatgen's core functionalities to handle compositions and structures where atomic sites may be occupied by multiple species with certain probabilities. The current version is 0.0.8, and releases are generally tied to new features or compatibility updates within the broader Pymatgen ecosystem.

Common errors

Warnings

Install

Imports

Quickstart

This example demonstrates how to create a `DisorderedComposition` object for an alloy system and access its basic properties. It also shows the distinction between a `DisorderedComposition` and a standard Pymatgen `Composition`.

from pymatgen_analysis_alloys.composition import DisorderedComposition
from pymatgen.core.composition import Composition

# Create a simple disordered composition, e.g., Cu_0.5 Ni_0.5
disordered_comp = DisorderedComposition({"Cu": 0.5, "Ni": 0.5})

print(f"Disordered composition: {disordered_comp}")
print(f"Formula: {disordered_comp.reduced_formula}")

# Compare with a standard pymatgen Composition
standard_comp = Composition({"Cu": 0.5, "Ni": 0.5})
print(f"Standard composition: {standard_comp}")

# Accessing properties
print(f"Atomic fractions: {disordered_comp.as_dict()}")

view raw JSON →