ReciprocalLatticeVector#

class diffsims.crystallography.ReciprocalLatticeVector(phase, xyz=None, hkl=None, hkil=None)[source]#

Bases: Vector3d

Reciprocal lattice vectors \((hkl)\) for use in electron diffraction analysis and simulation.

All lengths are assumed to be given in Å or inverse Å.

This class extends orix.vector.Vector3d to reciprocal lattice vectors \((hkl)\) specifically for diffraction experiments and simulations. It is thus different from orix.vector.Miller, which is a general class for Miller indices both in reciprocal and direct space. It supports relevant methods also supported in Miller, like obtaining a set of vectors from a minimal interplanar spacing.

Create a set of reciprocal lattice vectors from \((hkl)\) or \((hkil)\).

The vectors are stored internally as cartesian coordinates in data.

Parameters:
  • phase (orix.crystal_map.Phase) – A phase with a crystal lattice and symmetry.

  • xyz (numpy.ndarray, list, or tuple, optional) – Cartesian coordinates of indices of reciprocal lattice vector(s) hkl. Default is None. This, hkl, or hkil is required.

  • hkl (numpy.ndarray, list, or tuple, optional) – Indices of reciprocal lattice vector(s). Default is None. This, xyz, or hkil is required.

  • hkil (numpy.ndarray, list, or tuple, optional) – Indices of reciprocal lattice vector(s), often preferred over hkl in trigonal and hexagonal lattices. Default is None. This, xyz, or hkl is required.

Examples

>>> from diffpy.structure import Atom, Lattice, Structure
>>> from orix.crystal_map import Phase
>>> from diffsims.crystallography import ReciprocalLatticeVector
>>> phase = Phase(
...     "al",
...     space_group=225,
...     structure=Structure(
...         lattice=Lattice(4.04, 4.04, 4.04, 90, 90, 90),
...         atoms=[Atom("Al", [0, 0, 1])],
...     ),
... )
>>> rlv = ReciprocalLatticeVector(phase, hkl=[[1, 1, 1], [2, 0, 0]])
>>> rlv
ReciprocalLatticeVector (2,), al (m-3m)
[[1. 1. 1.]
 [2. 0. 0.]]

Attributes

ReciprocalLatticeVector.allowed

Return whether vectors diffract according to diffraction selection rules assuming kinematic scattering theory.

ReciprocalLatticeVector.coordinate_format

Vector coordinate format, either "hkl" or "hkil".

ReciprocalLatticeVector.coordinates

Miller or Miller-Bravais indices.

ReciprocalLatticeVector.dspacing

Direct lattice interplanar spacing \(d = 1 / g\).

ReciprocalLatticeVector.gspacing

Reciprocal lattice vector spacing \(g\).

ReciprocalLatticeVector.h

First reciprocal lattice vector index.

ReciprocalLatticeVector.has_hexagonal_lattice

Whether the crystal lattice is hexagonal/trigonal.

ReciprocalLatticeVector.hkil

Miller-Bravais indices.

ReciprocalLatticeVector.hkl

Miller indices.

ReciprocalLatticeVector.i

Third reciprocal lattice vector index in 4-index Miller-Bravais indices, equal to \(-(h + k)\).

ReciprocalLatticeVector.k

Second reciprocal lattice vector index.

ReciprocalLatticeVector.l

Third reciprocal lattice vector index, or fourth index in 4-index Miller Bravais indices.

ReciprocalLatticeVector.multiplicity

Number of symmetrically equivalent directions per vector.

ReciprocalLatticeVector.scattering_parameter

Scattering parameter \(0.5 \cdot g\).

ReciprocalLatticeVector.structure_factor

Kinematical structure factors \(F\).

ReciprocalLatticeVector.theta

Twice the Bragg angle.

ReciprocalLatticeVector.unit

Unit reciprocal lattice vectors.

Methods

ReciprocalLatticeVector.angle_with(other[, ...])

Calculate angles between reciprocal lattice vectors, possibly using symmetrically equivalent vectors to find the smallest angle under symmetry.

ReciprocalLatticeVector.calculate_structure_factor([...])

Populate structure_factor with the complex kinematical structure factor \(F_{hkl}\) for each vector.

ReciprocalLatticeVector.calculate_theta(voltage)

Populate theta with the Bragg angle \(theta_B\) in radians.

ReciprocalLatticeVector.cross(other)

Cross product between reciprocal lattice vectors producing zone axes \([uvw]\) or \([UVTW]\) in the direct lattice.

ReciprocalLatticeVector.deepcopy()

Get a deepcopy of the vectors.

ReciprocalLatticeVector.dot(other)

Dot product of the vectors with other reciprocal lattice vectors.

ReciprocalLatticeVector.dot_outer(other)

Outer dot product of the vectors with other reciprocal lattice vectors.

ReciprocalLatticeVector.empty()

Return an empty object with the appropriate dimensions.

ReciprocalLatticeVector.flatten()

A new instance with these reciprocal lattice vectors in a single column.

ReciprocalLatticeVector.from_highest_hkl(...)

Create a set of unique reciprocal lattice vectors from three highest indices.

ReciprocalLatticeVector.from_miller(miller)

Create a new instance from a Miller instance.

ReciprocalLatticeVector.from_min_dspacing(phase)

Create a set of unique reciprocal lattice vectors with a a direct space interplanar spacing greater than a lower threshold.

ReciprocalLatticeVector.from_polar(azimuth, ...)

Initialize from spherical coordinates according to the ISO 31-11 standard :cite:`weisstein2005spherical`.

ReciprocalLatticeVector.get_hkl_sets()

Get unique sets of \({hkl}\) for the vectors and the indices of vectors in each set.

ReciprocalLatticeVector.get_nearest(*args, ...)

Return the vector in x with the smallest angle to this vector.

ReciprocalLatticeVector.get_random_sample(...)

Return a random sample of a given size in a flattened instance.

ReciprocalLatticeVector.in_fundamental_sector([...])

Project vectors to a symmetry's fundamental sector (inverse pole figure).

ReciprocalLatticeVector.mean()

Return the mean vector.

ReciprocalLatticeVector.print_table()

Table with indices, structure factor values and multiplicity of each set of \({hkl}\).

ReciprocalLatticeVector.reshape(*shape)

A new instance with these reciprocal lattice vectors reshaped.

ReciprocalLatticeVector.rotate(*args, **kwargs)

Convenience function for rotating this vector.

ReciprocalLatticeVector.sanitise_phase()

Sanitise the phase inplace for calculation of structure factors.

ReciprocalLatticeVector.squeeze()

A new instance with these reciprocal lattice vectors where singleton dimensions are removed.

ReciprocalLatticeVector.stack(sequence)

A new instance from a sequence of reciprocal lattice vectors.

ReciprocalLatticeVector.symmetrise([...])

Unique vectors symmetrically equivalent to the vectors.

ReciprocalLatticeVector.to_miller()

Return the vectors as a Miller instance.

ReciprocalLatticeVector.transpose(*axes)

A new instance with the navigation shape of these reciprocal lattice vectors transposed.

ReciprocalLatticeVector.unique([...])

The unique vectors.

ReciprocalLatticeVector.xvector()

Return a unit vector in the x-direction.

ReciprocalLatticeVector.yvector()

Return a unit vector in the y-direction.

ReciprocalLatticeVector.zero([shape])

Return zero vectors in the specified shape.

ReciprocalLatticeVector.zvector()

Return a unit vector in the z-direction.