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:
phaseorix.crystal_map.Phase

A phase with a crystal lattice and symmetry.

xyznumpy.ndarray, list, or tuple, optional

Cartesian coordinates of indices of reciprocal lattice vector(s) hkl. Default is None. This, hkl, or hkil is required.

hklnumpy.ndarray, list, or tuple, optional

Indices of reciprocal lattice vector(s). Default is None. This, xyz, or hkil is required.

hkilnumpy.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.azimuth

Azimuth spherical coordinate, i.e. the angle \(\phi \in [0, 2\pi]\) from the positive z-axis to a point on the sphere, according to the ISO 31-11 standard :cite:`weisstein2005spherical`.

ReciprocalLatticeVector.coordinate_format

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

ReciprocalLatticeVector.coordinates

Miller or Miller-Bravais indices.

ReciprocalLatticeVector.data

Return the data.

ReciprocalLatticeVector.dim

Return the number of dimensions for this object.

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.ndim

Return the number of navigation dimensions of the object.

ReciprocalLatticeVector.norm

Return the norm of the data.

ReciprocalLatticeVector.perpendicular

Return the perpendicular vectors.

ReciprocalLatticeVector.polar

Polar spherical coordinate, i.e. the angle \(\theta \in [0, \pi]\) from the positive z-axis to a point on the sphere, according to the ISO 31-11 standard :cite:`weisstein2005spherical`.

ReciprocalLatticeVector.radial

Return the radial spherical coordinate, i.e. the distance from a point on the sphere to the origin, according to the ISO 31-11 standard :cite:`weisstein2005spherical`.

ReciprocalLatticeVector.scattering_parameter

Scattering parameter \(0.5 \cdot g\).

ReciprocalLatticeVector.shape

Return the shape of the object.

ReciprocalLatticeVector.size

Return the total number of entries in this object.

ReciprocalLatticeVector.structure_factor

Kinematical structure factors \(F\).

ReciprocalLatticeVector.theta

Twice the Bragg angle.

ReciprocalLatticeVector.unit

Unit reciprocal lattice vectors.

ReciprocalLatticeVector.x

Return or set the x coordinates.

ReciprocalLatticeVector.xyz

Return the coordinates as three arrays, useful for plotting.

ReciprocalLatticeVector.y

Return or set the y coordinates.

ReciprocalLatticeVector.z

Return or set the z coordinate.

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.draw_circle([...])

Draw great or small circles with a given opening_angle to to the vectors in the stereographic projection.

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_path_ends(vectors)

Return vectors along the shortest path on the sphere between two or more consectutive vectors.

ReciprocalLatticeVector.from_polar(azimuth, ...)

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

ReciprocalLatticeVector.get_circle([...])

Get vectors delineating great or small circle(s) with a given opening_angle about each vector.

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 new flattened object from a random sample of a given size.

ReciprocalLatticeVector.in_fundamental_sector([...])

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

ReciprocalLatticeVector.inverse_pole_density_function([...])

Plot the Inverse Pole Density Function (IPDF) within the fundamental sector of a given point group symmetry in the stereographic projection.

ReciprocalLatticeVector.mean()

Return the mean vector.

ReciprocalLatticeVector.pole_density_function([...])

Plot the Pole Density Function (PDF) on a given hemisphere in the stereographic projection.

ReciprocalLatticeVector.print_table()

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

ReciprocalLatticeVector.random([shape])

Return uniformly distributed random data.

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.scatter([...])

Plot vectors in the stereographic projection.

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.to_polar([degrees])

Return the azimuth \(\phi\), polar \(\theta\), and radial \(r\) spherical coordinates defined as in the ISO 31-11 standard :cite:`weisstein2005spherical`.

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.