crystals.Lattice

class crystals.Lattice(lattice_vectors: _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes], **kwargs)

Container class for lattice information and manipulations.

Instances can also be create from the standard ‘three lengths and angles’ parameters via Lattice.from_parameters:

Parameters:

lattice_vectors (iterable of ~numpy.ndarray, shape (3,)) – Lattice vectors.

__init__(lattice_vectors: _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes], **kwargs)

Methods

__array__(*args, **kwargs)

Returns a 3x3 float array in which each row is a lattice vector

__delattr__(name, /)

Implement delattr(self, name).

__dir__()

Default dir() implementation.

__eq__(other)

Return self==value.

__format__(format_spec, /)

Default object formatter.

__ge__(value, /)

Return self>=value.

__getattribute__(name, /)

Return getattr(self, name).

__gt__(value, /)

Return self>value.

__hash__()

Return hash(self).

__init__(lattice_vectors, **kwargs)

__init_subclass__

This method is called when a class is subclassed.

__le__(value, /)

Return self<=value.

__lt__(value, /)

Return self<value.

__ne__(value, /)

Return self!=value.

__new__(**kwargs)

__reduce__()

Helper for pickle.

__reduce_ex__(protocol, /)

Helper for pickle.

__repr__()

Return repr(self).

__setattr__(name, value, /)

Implement setattr(self, name, value).

__sizeof__()

Size of object in memory, in bytes.

__str__()

Return str(self).

__subclasshook__

Abstract classes can override this to customize issubclass().

bounded_reflections(bound[, min_bound])

Generates reflections (hkl) with norm(G) <= bound

frac_mesh(*xi[, indexing])

Coordinate arrays for fractional coordinates.

from_parameters(a, b, c, alpha, beta, gamma)

Create a Lattice instance from three lengths and angles.

mesh(*xi[, indexing])

Cartesian coordinate arrays from fractional coordinate vectors.

miller_indices(scattering_vector)

Miller indices from scattering vector components.

scattering_vector(reflection)

Scattering vector from Miller indices.

Attributes

__annotations__

lattice_parameters

Lattice parameters as three lengths [Å] and three angles [degrees].

lattice_system

One of the seven lattice system, returned in the form of the LatticeSystem enumeration.

lattice_vectors

Iterable of lattice vectors

periodicity

Crystal periodicity in x, y and z direction from the lattice constants.

reciprocal

Reciprocal lattice

reciprocal_vectors

Reciprocal lattice vectors, defined as:

volume

Lattice cell volume Angtroms cubed