lmodea_k.Crystal

\(\newcommand{\AA}{\text{Å}}\)

lmodea_k.Crystal#

class Crystal(symbols=None, atomic_numbers=None, cell_real=None, cell_recip=None, coords_frac=None, coords_cart=None, masses=None, symprec=1e-05)#

Describes a periodic crystal structure.

Parameters:
  • atomic_numbers (list of int, optional) – Atomic numbers. Required if symbols is not provided.

  • symbols (list of str, optional) – Element symbols. Required if atomic_numbers is not provided. Ignored if atomic_numbers is provided.

  • cell_real ((3, 3) array-like, optional) – Real-space lattice vectors as rows (Å). Required if cell_recip is not provided.

  • cell_recip ((3, 3) array-like, optional) – Reciprocal-space lattice vectors as rows (1/Å). Required if cell_real is not provided. Ignored if cell_real is provided.

  • coords_frac ((N, 3) array-like, optional) – Fractional coordinates relative to the unit cell. Required if coords_cart is not provided.

  • coords_cart ((N, 3) array-like, optional) – Cartesian coordinates in Å. Required if coords_frac is not provided. Ignored if coords_frac is provided.

  • masses ((N,) array-like, optional) – Atomic masses in amu. If omitted, masses are looked up from element symbols.

Raises:

ValueError – If required inputs (symbols/numbers, lattice, or coordinates) are missing.

Notes

Geometry is immutable after construction; derived data assume fixed lattice and coordinates.

__init__(symbols=None, atomic_numbers=None, cell_real=None, cell_recip=None, coords_frac=None, coords_cart=None, masses=None, symprec=1e-05)#

Methods

__init__([symbols, atomic_numbers, ...])

from_ase(atoms[, symprec])

Construct a Crystal object from an ASE Atoms object.

Attributes

asymm_unit_map

Map from atom index to asymmetric unit representative (spglib).

atomic_numbers

Atomic numbers of the primitive-cell atoms.

cell_real

Real-space lattice vectors (3x3, Å).

cell_recip

Reciprocal-space lattice vectors (3x3, 1/Å).

coords_cart

Cartesian coordinates (Å) of the primitive-cell atoms.

coords_frac

Fractional coordinates of the primitive-cell atoms.

highsym_kpts

High-symmetry k-point coordinates from seekpath (dict label -> fractional coords).

masses

Atomic masses (amu) corresponding to the primitive-cell symbols.

n_atoms

Number of atoms in the primitive cell.

symbols

Element symbols of the primitive-cell atoms.

symmetry

Spglib symmetry dataset for the structure.