\(\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_mapMap from atom index to asymmetric unit representative (spglib).
atomic_numbersAtomic numbers of the primitive-cell atoms.
cell_realReal-space lattice vectors (3x3, Å).
cell_recipReciprocal-space lattice vectors (3x3, 1/Å).
coords_cartCartesian coordinates (Å) of the primitive-cell atoms.
coords_fracFractional coordinates of the primitive-cell atoms.
highsym_kptsHigh-symmetry k-point coordinates from seekpath (dict label -> fractional coords).
massesAtomic masses (amu) corresponding to the primitive-cell symbols.
n_atomsNumber of atoms in the primitive cell.
symbolsElement symbols of the primitive-cell atoms.
symmetrySpglib symmetry dataset for the structure.