landau.phases

class landau.phases.AbstractLinePhase(name)[source]

Bases: Phase

Base class for fixed concentration phases.

Required overloads are AbstractLinePhase.line_concentration() and AbstractLinePhase.line_free_energy().

concentration(T, dmu)[source]

Concentration of the phase at the given state.

free_energy(T, c)[source]
abstract property line_concentration
abstractmethod line_free_energy(T)[source]
semigrand_potential(T, dmu)[source]

Calculate the semigrand potential of the phase.

class landau.phases.AbstractPointDefect[source]

Bases: ABC

abstractmethod excess_free_energy(T)[source]
class landau.phases.AsePhase(name, fixed_concentration, thermochem, pressure=None, atoms_per_formula=1)[source]

Bases: AbstractLinePhase

Phase wrapper for ASE’s ThermoChem classes.

Equality and hashing compare thermochem by its pickled bytes so two AsePhase instances built from equivalent inputs compare equal even though ASE’s ThermoChem defaults to identity-based equality.

atoms_per_formula divides the energy returned by thermochem so the result is per atom (landau’s convention). Use 2 for an ASE IdealGasThermo built around H₂ or O₂, 3 for CO₂, etc.; the default of 1 is correct when the ASE object already represents one atom or one per-atom formula unit (most HarmonicThermo setups, monatomic IdealGasThermo).

atoms_per_formula: int = 1
fixed_concentration: float
property line_concentration
line_free_energy(T)[source]
pressure: float | None = None
thermochem: ThermoChem
class landau.phases.ConstantPointDefect(name, excess_energy, excess_entropy, excess_solutes)[source]

Bases: AbstractPointDefect

A point defect that adds a contribution to the free energy of a host lattice.

Excess energy and entropy are assumed to be

concentration_contribution(T, dmu)[source]
defect_concentration(T, dmu)[source]
excess_energy: float
excess_entropy: float
excess_free_energy(T)[source]
excess_solutes: float
name: str
semigrand_potential_contribution(T, dmu)[source]
class landau.phases.IdealSolution(name, phase1, phase2)[source]

Bases: Phase

concentration(T, dmu)[source]

Concentration of the phase at the given state.

phase1: AbstractLinePhase
phase2: AbstractLinePhase
semigrand_potential(T, dmu)[source]

Calculate the semigrand potential of the phase.

class landau.phases.InterpolatingPhase(name, phases, num_coeffs=None, add_entropy=False, num_samples=100, maximum_extrapolation=0)[source]

Bases: Phase

A Version of RegularSolutionPhase that does not depend on terminals. FIXME: These two classes should be unified.

add_entropy: bool = False
check_concentration_interpolation(T=1000, samples=50, plot_excess=False)[source]

Plot free energies of an interpolating phase and its underlying line phases to visually assess fit quality.

Parameters:
  • T (float) – at which temperature to check interpolation

  • samples (int) – number of sampling points for plot

  • plot_excess (bool) – if True, subtract free energy at concentration range endpoints for legibility

check_interpolation(T=1000, samples=50)[source]
concentration(T, dmu)[source]

Concentration of the phase at the given state.

free_energy(T, c)[source]
maximum_extrapolation: float = 0
num_coeffs: int = None
num_samples: int = 100
phases: Iterable[AbstractLinePhase]
semigrand_potential(T, dmu)[source]

Calculate the semigrand potential of the phase.

class landau.phases.LinePhase(name, fixed_concentration, line_energy, line_entropy=0)[source]

Bases: AbstractLinePhase

Simple phase with a fixed concentration and temperature independent entropy.

fixed_concentration: float
property line_concentration
line_energy: float
line_entropy: float = 0
line_free_energy(T)[source]
class landau.phases.Phase(name)[source]

Bases: ABC

Represents a phase in a binary phase diagram.

abstractmethod concentration(T, dmu)[source]

Concentration of the phase at the given state.

name: str
abstractmethod semigrand_potential(T, dmu)[source]

Calculate the semigrand potential of the phase.

class landau.phases.PointDefectSublattice(name, sublattice, sublattice_fraction, defects)[source]

Bases: object

Groups together PointDefect that live on the same sublattice within a host structure.

concentration_contribution(T, dmu)[source]
defects: list[AbstractPointDefect]
name: str
semigrand_potential_contribution(T, dmu)[source]
sublattice: int
sublattice_fraction: float
class landau.phases.PointDefectedPhase(name, line_phase, sublattices)[source]

Bases: Phase

Phase that combines any host phase and any number of point defects in it.

concentration(T, dmu)[source]

Concentration of the phase at the given state.

line_phase: AbstractLinePhase

Underlying phase object of the host lattice.

semigrand_potential(T, dmu)[source]

Calculate the semigrand potential of the phase.

sublattices: list[PointDefectSublattice]

Sublattices and their point defects.

class landau.phases.RegularSolution(name, phases, num_coeffs=4, add_entropy=False)[source]

Bases: Phase

A regular solution model phase that interpolates through a given set of line phases using Redlich-Kister polynomials.

add_entropy: bool = False

If False, assume that the free energies of the line phases already include configurational mixing entropy. If True add ideal mixing entropy.

check_concentration_interpolation(T=1000, samples=50, plot_excess=False)[source]

Plot free energies of an interpolating phase and its underlying line phases to visually assess fit quality.

Parameters:
  • T (float) – at which temperature to check interpolation

  • samples (int) – number of sampling points for plot

  • plot_excess (bool) – if True, subtract free energy at concentration range endpoints for legibility

check_interpolation(T=1000, samples=50)[source]
concentration(T, dmu)[source]

Concentration of the phase at the given state.

excess_free_energy(T, c)[source]
free_energy(T, c)[source]
num_coeffs: int = 4

Number of Redlich-Kister coefficients for the mixing “enthalpy”; restricted to number of phases - 2.

phases: Iterable[AbstractLinePhase]

Line phases to interpolate, must include the terminals.

semigrand_potential(T, dmu, plot=False, raw=False)[source]

Calculate the semigrand potential of the phase.

class landau.phases.SlowInterpolatingPhase(name, phases, add_entropy=False, maximum_extrapolation=0, concentration_range=(0.0, 1.0), interpolator=None)[source]

Bases: Phase

A slower version of RegularSolutionPhase that does not depend on terminals. FIXME: These two classes should be unified.

add_entropy: bool = False
check_concentration_interpolation(T=1000, samples=50, plot_excess=False)[source]

Plot free energies of an interpolating phase and its underlying line phases to visually assess fit quality.

Parameters:
  • T (float) – at which temperature to check interpolation

  • samples (int) – number of sampling points for plot

  • plot_excess (bool) – if True, subtract free energy at concentration range endpoints for legibility

  • concentration_range (tuple of float) – min/max concentration range

check_interpolation(T=1000, samples=50)[source]
concentration(T, dmu)[source]

Concentration of the phase at the given state.

concentration_range: tuple[float, float] = (0.0, 1.0)
free_energy(T, c)[source]
interpolator: ConcentrationInterpolator | None = None
maximum_extrapolation: float = 0
phases: Iterable[AbstractLinePhase]
semigrand_potential(T, dmu)[source]

Calculate the semigrand potential of the phase.

class landau.phases.TemperatureDependentLinePhase(name, fixed_concentration, temperatures, free_energies, interpolator=SGTE(nparam=3))[source]

Bases: AbstractLinePhase

” Simple phase with a fixed concentration and temperature dependent free energy.

check_interpolation(Tl=0.9, Tu=1.1, samples=50)[source]
fixed_concentration: float

The fixed concentration of the phase

free_energies: Iterable[float]

Sampled free energy of the phase has been computed.

interpolator: TemperatureInterpolator = SGTE(nparam=3)

How to interpolate to arbitrary temperatures from the samples.

property line_concentration
line_free_energy(T)[source]
temperatures: Iterable[float]

Temperatures at which the free energy of the phase has been sampled.