Skip to content

Bain Path

BainPathAnalyzer

BainPathAnalyzer(
    calculator: BaseCalculator | None = None,
    bain_transformation: BainDisplacementTransformation
    | None = None,
)

A class used to analyze the Bain transformation path for a given structure.

Applies a Bain transformation to an undeformed structure and calculates the potential energy at each c/a ratio along the transformation path.

Initializes the BainPathAnalyzer object.

Parameters:

Name Type Description Default
calculator BaseCalculator | None

The calculator object used to compute potential energies.

None
bain_transformation BainDisplacementTransformation | None

The transformation object used to apply Bain displacements. If not provided, a new instance is initialized.

None

calculate

calculate(
    structure: Structure | Atoms, is_relaxed: bool = False
) -> dict[str, list]

Calculates the potential energies along the Bain Path for the given undeformed structure.

Applies the Bain transformation to the input structure to generate deformed structures at a series of c/a ratios, then evaluates the potential energy of each with the provided calculator.

Parameters:

Name Type Description Default
structure Structure | Atoms

The undeformed structure to be transformed and analyzed.

required
is_relaxed bool

Whether the input structure is already relaxed. Defaults to False.

False

Returns:

Type Description
dict[str, list]

dict[str, list]: Dictionary with keys: - c_a_list: c/a ratios for each deformed structure. - energy_list: Potential energy for each deformed structure.

Raises:

Type Description
ValueError

If the calculator object does not have the 'energy' property implemented.

bain_transformation

bain_transformation() -> BainDisplacementTransformation

Returns the Bain displacement transformation object used to apply Bain displacements.

Returns:

Name Type Description
BainDisplacementTransformation BainDisplacementTransformation

The transformation object used for Bain displacements.