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

PrimitiveCellResult

Store a structure in the fixed primitive cell of its conventional cell.

Functions

primitive_cell(structure, *[, tolerance, ...])

Return structure in the spglib-convention primitive cell.

Module Contents

class httk.atomistic.symmetry.primitive.PrimitiveCellResult[source]

Store a structure in the fixed primitive cell of its conventional cell.

transform is 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, where B_p = B_s P_c; fractional row coordinates therefore transform as f_p = f_s * transform.inv() and are wrapped into [0, 1). See the spglib primitive-cell definition.

multiplier is 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.

structure: httk.atomistic.models.structure.unitcell.UnitcellStructure[source]
spacegroup: httk.atomistic.symmetry.spacegroup.Spacegroup[source]
conventional: httk.atomistic.symmetry.standardization.ConventionalCellResult[source]
transform: httk.core.FracVector[source]
multiplier: fractions.Fraction[source]
httk.atomistic.symmetry.primitive.primitive_cell(structure, *, tolerance=None, limit_denominator=None)[source]

Return structure in 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 and assemblies are refused because this operation cannot yet transform their frame or preserve correlated site groups through the centring collapse. 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 None to derive it.

  • limit_denominator (int | None) – The maximum denominator for idealised free parameters, or None to 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 unsupported moments or assemblies, is not fully periodic, or has an unsupported centring type.

Return type:

PrimitiveCellResult