get_hkl_sets#

ReciprocalLatticeVector.get_hkl_sets()[source]#

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

Returns:
hkl_setsdefaultdict

Dictionary with (h, k, l) as keys and a tuple with numpy.ndarray with integers of the vectors (possibly multi-dimensional) in each set. The keys (h, k, l) are rounded to six decimals so that applying integer values (h, k, l) as dictionary keys work.

Examples

See ReciprocalLatticeVector for the creation of rlv

>>> rlv
ReciprocalLatticeVector (2,), al (m-3m)
[[1. 1. 1.]
 [2. 0. 0.]]
>>> hkl_sets = rlv.get_hkl_sets()
>>> hkl_sets
defaultdict(<class 'tuple'>, {(2.0, 0.0, 0.0): (array([1]),), (1.0, 1.0, 1.0): (array([0]),)})
>>> hkl_sets[2, 0, 0]
(array([1]),)
>>> rlv[hkl_sets[2, 0, 0]]
ReciprocalLatticeVector (1,), al (m-3m)
[[2. 0. 0.]]