Skip to content

Configuration

High-level structure generation and supercell objects.

configuration

DEFAULT_SYMPREC module-attribute

DEFAULT_SYMPREC: Final[float] = 0.001

SSAGenerator

SSAGenerator(prim_cell: Cell, magnetic_site_indices: Sequence[int], *, sublattice: Sublattice | None = None, multiplicity_preserving: bool = True, symprec: float = DEFAULT_SYMPREC, atol: float = 1e-05)

prim_dataset property

prim_dataset: MoyoDataset

prim_rotations property

prim_rotations: NDArrayInt

prim_translations property

prim_translations: NDArrayFloat

propagation_vectors property

propagation_vectors: list[NDArrayFloat] | None

Propagation vectors in the primitive standardized setting, or None if the generator was not constructed with :meth:with_propagation_vectors.

enumerate

enumerate(spin_only_group_type: SpinOnlyGroupType, *, k_index: int | None = None, max_depth: int | None = 1, up_to_parent_conjugacy: bool = True) -> list[tuple[SpinOnlyGroup, NontrivialSpinSpaceGroup, SpinSymmetryAdaptedStructure]]

Enumerate spin symmetry adapted (SSA) structures.

For every retained family space subgroup G' <= G, spin space groups are classified under N_G(G') x O(3). up_to_parent_conjugacy independently controls whether G-conjugate family subgroups are retained separately.

Parameters:

Name Type Description Default
spin_only_group_type SpinOnlyGroupType

Type of the spin-only group to enumerate.

required
k_index int | None

Global index of the invariant translation sublattice used to bound family-subgroup enumeration. Without propagation vectors, every index-k_index sublattice is considered. With propagation vectors, their commensurate sublattice fixes the bound and its index is used automatically.

None
max_depth int | None

Maximum Hermann translationengleiche subgroup depth from the parent group. 0 retains the parent as the only Hermann group while still including its bounded klassengleiche descendants. 1 retains the parent and maximal proper Hermann subgroups (default); None retains all Hermann subgroups. Bounded klassengleiche descendants inherit their Hermann group depth.

1
up_to_parent_conjugacy bool

Classify family space subgroups up to conjugation by the crystallographic parent. When False, retain every enumerated t-group, family-lattice, and finite-quotient complement conjugate. This does not change the per-family N_G(G') x O(3) relation.

True

generate_oriented

generate_oriented(sas: SpinSymmetryAdaptedStructure, spin_only_group: SpinOnlyGroup, nontrivial_spin_space_group: NontrivialSpinSpaceGroup, *, preserve_spin_planochirality: bool = True, rng: Generator | None = None, atol: float = 1e-05) -> list[tuple[Structure, MagneticSpaceSubgroup]]

Generate oriented structures using only the SSG family group's axes.

with_propagation_vectors classmethod

with_propagation_vectors(cell: Cell, propagation_vectors: Sequence[NDArrayFloat], magnetic_site_indices: Sequence[int], *, k_frame: Literal['input', 'prim_std'] = 'input', multiplicity_preserving: bool = True, symprec: float = DEFAULT_SYMPREC, atol: float = 1e-05) -> Self

Create a generator from propagation vectors given in a named frame.

The internal enumeration works in moyopy's primitive standardized cell, whose setting may differ from that of cell (e.g. hexagonal axis permutations). The propagation vectors are transformed into that frame explicitly, and the accepted vectors are echoed back in both settings at INFO level so a frame mismatch can be caught before enumeration. The resulting commensurate translation lattice is also used as the single bound for t-, k-, and general-family subgroup enumeration.

Parameters:

Name Type Description Default
cell Cell

Input cell, e.g. in the CIF / experimental setting. Do not pre-standardize it unless the propagation vectors are given in the same standardized setting (then use k_frame="prim_std").

required
propagation_vectors Sequence[NDArrayFloat]

Propagation vectors in fractional reciprocal coordinates of the frame named by k_frame.

required
magnetic_site_indices Sequence[int]

Indices of magnetic sites in cell.

required
k_frame Literal['input', 'prim_std']

Frame in which propagation_vectors are given. "input" (default) is the setting of cell. "prim_std" is moyopy's primitive standardized cell; the vectors are used as-is.

'input'

SpinSymmetryAdaptedStructure dataclass

SpinSymmetryAdaptedStructure(supercell: Supercell, magnetic_moments_basis: list[NDArrayFloat], atol: float = 1e-08)

atol class-attribute instance-attribute

atol: float = field(default=1e-08, repr=False)

dim property

dim: int

grouped_magnetic_moments_basis cached property

grouped_magnetic_moments_basis: dict[frozenset[SupercellSiteIndex], list[int]]

Group basis vectors by the supercell sites they act on.

Returns a dict mapping frozensets of supercell site indices (where the basis vector has nonzero rows) to lists of indices into magnetic_moments_basis sharing that site pattern.

magnetic_moments_basis instance-attribute

magnetic_moments_basis: list[NDArrayFloat]

supercell instance-attribute

supercell: Supercell

generate

generate(rng: Generator | None = None) -> Structure

generate_oriented

generate_oriented(spin_only_group: SpinOnlyGroup, nontrivial_spin_space_group: NontrivialSpinSpaceGroup, *, preserve_spin_planochirality: bool = True, parent_prim_rotations: NDArrayInt | None = None, rng: Generator | None = None, atol: float = 1e-05) -> list[tuple[Structure, MagneticSpaceSubgroup]]

generate_with_magnetic_moments

generate_with_magnetic_moments(magnetic_moments: NDArrayFloat) -> Structure

Supercell

Supercell(prim_cell: Cell, sublattice: Sublattice, symprec: float = 0.0001)

basis property

basis: NDArrayFloat

num_supercell_sites property

num_supercell_sites: int

numbers property

numbers: list[int]

positions property

positions: NDArrayFloat

Return fractional coordinates of sites in the supercell.

prim_cell property

prim_cell: Cell

sublattice property

sublattice: Sublattice

act_operation

act_operation(sub_sites: Sequence[SupercellSiteIndex], prim_rotation: NDArrayInt, prim_translation: NDArrayFloat) -> dict[SupercellSiteIndex, SupercellSiteIndex] | None

Permutation of sub_sites under one primitive-frame operation.

Returns the mapping from each site in sub_sites to its image site, or None when the operation does not permute sub_sites within the symprec tolerance.

map_sites

map_sites(prim_site_indices: Sequence[PrimSiteIndex]) -> list[SupercellSiteIndex]

site_permutations

site_permutations(rotations: Sequence[NDArrayInt], translations: Sequence[NDArrayFloat]) -> list[NDArrayInt]

Supercell-site permutations under primitive-frame operations.

For each (rotation, translation) pair, returns the array mapping each supercell site index to its image site index (brute-force O(n^2) matching). Raises if an operation does not permute the sites within the symprec tolerance.

get_commensurate_sublattice

get_commensurate_sublattice(qpoints: list[NDArrayFloat], *, max_denominator: int = DEFAULT_MAX_DENOMINATOR)