httk.atomistic.symmetry.primitive¶
Express a structure in the fixed primitive cell of its standard setting.
The primitive basis is obtained from the IT standard-setting conventional cell with the centring-dependent matrices documented by spglib. The matrices are stated here in their column-vector convention and transposed for httk’s row-vector cell representation.
Classes¶
Store a structure in the fixed primitive cell of its conventional cell. |
Functions¶
|
Return |
Module Contents¶
- class httk.atomistic.symmetry.primitive.PrimitiveCellResult[source]¶
Store a structure in the fixed primitive cell of its conventional cell.
transformis the row-convention matrix actually applied to the conventional basis:basis_primitive = transform * basis_conventional. The matrices are the transposes of spglib’s documented column-vector matrices, whereB_p = B_s P_c; fractional row coordinates therefore transform asf_p = f_s * transform.inv()and are wrapped into[0, 1). See the spglib primitive-cell definition.multiplieris the exact ratio of primitive-cell site count to input site count.- Parameters:
structure – The resulting primitive-cell structure.
spacegroup – The space group of the standardized input.
conventional – The conventional-cell result used as input.
transform – The row-convention matrix applied to the conventional basis.
multiplier – The exact ratio of result site count to input site count.
- transform: httk.core.FracVector[source]¶
- multiplier: fractions.Fraction[source]¶
- httk.atomistic.symmetry.primitive.primitive_cell(structure, *, tolerance=None, limit_denominator=None)[source]¶
Return
structurein the spglib-convention primitive cell.The input is first recognized or, when it already contains an asymmetric unit, used exactly as stored. Recognition arguments are rejected for an existing ASU. The recognized structure is converted to its IT standard-setting conventional cell by
conventional_cell(), then the fixed matrix for its centring type is applied exactly. Site moments are carried through as per-site data: Cartesian and collinear moments are unchanged by the basis recombination, and translation images that collapse onto one primitive site must agree, or the magnetic order needs the larger cell. Assemblies are refused because the centring collapse cannot preserve correlated site groups. This operation does not perform Niggli reduction.- Parameters:
structure (httk.atomistic.models.structure.like.StructureLike) – The structure to express in a primitive cell.
tolerance (float | None) – The Cartesian recognition tolerance, or
Noneto derive it.limit_denominator (int | None) – The maximum denominator for idealised free parameters, or
Noneto retain their exact stated values.
- Returns:
The primitive-cell structure and transform metadata.
- Raises:
ImportError – If recognition is needed and the optional spglib dependency is unavailable.
ValueError – If recognition arguments are invalid for the input, the structure has assemblies or crystal-axis moments, its magnetic order is incompatible with the primitive cell, it is not fully periodic, or it has an unsupported centring type.
- Return type: