Presented here are algorithms for the transformation of lattice basis vectors to a specific target. The algorithms are useful for crystallographic operations in direct and reciprocal spaces alike. The algorithms are demonstrated graphically and numerically.
Keywords: crystal lattice, transformations, lattice planes, zones
Abstract
Simple algorithms are proposed for the transformation of lattice basis vectors to a specific target. In the first case, one of the new basis vectors is aligned to a predefined lattice direction, while in the second case, two of the new basis vectors are brought to a lattice plane with predefined Miller indices. The multi-dimensional generalization of the algorithm is available in the supporting materials. The algorithms are useful for such crystallographic operations as simulation of zone planes (i.e. geometry of electron diffraction patterns) or transformation of a unit cell for surface or cleavage energy calculations. The most general multi-dimensional version of the algorithm may be useful for the analysis of quasiperiodic crystals or as an alternative method of calculating Bézout coefficients. The algorithms are demonstrated both graphically and numerically.
1. Introduction
The transformation of lattice basis vectors is a key mathematical operation in crystallography. It is expressed using a transformation matrix [S] (A
i = a
j
S
ji) connecting old (a
1, a
2, a
3), and new (A
1, A
2, A
3) lattice basis vectors. If det[S] = ±1 and , then A
i and a
i are the bases of the same lattice/form the unit cells of the same crystal structure. Such unit-cell transformations are useful for analysing the structures of polymorphs (Müller, 2013 ▸; de la Flor et al., 2016 ▸), twin laws (Nespolo & Ferraris, 2006 ▸; Zhang et al., 2010 ▸; Marzouki et al., 2014 ▸), phase transitions (Howard & Stokes, 2005 ▸), tilting of structural polyhedra (Glazer, 1972 ▸, 1975 ▸) and nanoscale stacking order (Biermanns et al., 2011 ▸). The ability to ‘view’ the same crystal structure using different unit-cell settings is crucial for a skilful crystallographer.
This article introduces new algorithms for the transformation of basis vectors for a specific target. The first version of the algorithm enables the transformation (A i = a j S ji, det[S] = ±1) such that A 3 is parallel to a target lattice vector T. The second version results in A 1, A 2 parallel to a target lattice plane (hkl) and A 3 connecting lattice points of two adjacent planes. In this way the algorithm suggests an alternative approach to calculate the Bézout coefficients (Bézout, 1779 ▸).
In contrast with other number-theoretical approaches [e.g. the extended Euclidean algorithm (Knuth, 1997 ▸)], the new algorithms are easily extendable to higher-dimensional lattices. In addition, two- and three-dimensional versions allow for clear visualization using lattice directions and their stereographic projections. The algorithms are useful for the simulation of electron diffraction patterns or for exploring the two-dimensional periodicity of crystal structures within a given lattice plane. It is necessary to follow the algorithms whenever the indices of a target direction or a plane are non-trivial. The output can be used in structure visualization programs [e.g. VESTA (Momma & Izumi, 2011 ▸)], for the structure utilities of the Bilbao Crystallographic Server (Aroyo, Perez-Mato et al., 2006 ▸; Aroyo, Kirov et al., 2006 ▸) and for the ab initio calculation of surface energy (Tran et al., 2016 ▸; Kresse & Furthmüller, 1996 ▸; Schwarz et al., 2002 ▸). The multi-dimensional version of the algorithm might be useful for the analysis of quasiperiodic materials. The algorithm is deposited as a MATLAB program.
2. Transformation to a target direction
The list of notations and relevant crystallographic relations are available in Appendix A . The names of the two-, three- and multi-dimensional algorithms are PARA, TRIO and MULDIN, respectively. PARA and TRIO are described here, while MULDIN is deposited in the supporting information.
2.1. PARA: two-dimensional lattice
This algorithm transforms the basis vectors a
1, a
2 to A
1, A
2 such that A
2 ∥ T = x
1
a
1 + x
2
a
2. Table S1 and Fig. S1 (in the supporting information) provide a step-by-step illustration of the algorithm for the example target vector T = .
Iteration 0: We transform the basis vectors a
i to = ±a
i (‘−’ is taken if x
i is negative) and rearrange them so that det[S
(0)] = 1, where [S
(0)] is a 2×2 transformation matrix
=
[Fig. S1(a)]. According to equation (19) in Appendix A
the new coordinates of T are [X
(0)] = [S
(0)]−1[x]. All the components of [X
(0)] are non-negative.
Iteration n: We replace one of the basis vectors by . This creates two transformation variants [
=
],
![]() |
![]() |
Because det[S] = 1, form the basis of the same lattice for both variants. The coordinates of T transform as
![]() |
The exit condition of the algorithm is that one of is zero. This happens if
=
. If valid, the exit condition holds for both transformation variants. We can choose variant (2) to ensure that
. The final transformation a
i → A
i is given by the matrix product,
![]() |
If the exit condition is not fulfilled, we select the variant m yielding all positive :
and
force the choice of m = 1 [Fig. S1(c)] and m = 2 [Fig. S1(b)], respectively. The transformation
is
![]() |
The algorithm continues to the next iteration until the exit condition is reached [Fig. S1(d)].
2.2. TRIO: three-dimensional lattice
This algorithm transforms the basis vectors of a three-dimensional lattice a i → A i so that A 3 ∥ T = x i a i. Table 1 ▸ and Fig. 1 ▸ support the explanations.
Table 1. Information for each TRIO iteration for the transformation to the target vector T =
.
The table is organized in the same way as Table S1. Iterations 3 and 4 in this example follow the PARA algorithm. For the first row [X (−1)] = [x].
n | [X (n−1)] | [S m] | [S (n)] | [X (n)] |
---|---|---|---|---|
0 |
![]() |
![]() |
![]() |
|
1 |
![]() |
![]() |
![]() |
![]() |
2 |
![]() |
![]() |
![]() |
![]() |
3 |
![]() |
![]() |
![]() |
![]() |
4 |
![]() |
![]() |
![]() |
![]() |
Figure 1.
The transformations of the basis vectors given in the rows of Table 1 ▸: panel (a) corresponds to the first row in Table 1 ▸ with n = 0, panel (b) to the second row with n = 1 etc. The directions are drawn on the stereographic projection, which includes the poles of a cubic crystal lattice with a maximum index of 10. Panel (a) uses the stereographic projection along [001], and panels (b) to (d) use the stereographic projection along .
Iteration 0: We transform the basis vectors = ±a
i as in PARA, followed by their permutations ensuring the ‘right-handedness’ of
{det[S
(0)] = 1}, where [S
(0)] is a 3×3 transformation matrix between a
i and
[Fig. 1 ▸(a)]. The new non-negative coordinates of T become [X
(0)] = [S
(0)]−1[x].
Iteration n: We replace one of the basis vectors by , creating three transformation variants [
=
]:
![]() |
![]() |
![]() |
Because det[S] = 1, and a
i build the same lattice for all three variants. The new coordinates of T are
![]() |
The exit condition (two of the new T coordinates are zero) is fulfilled if =
=
. If valid, it holds for all three variants but choosing [S
3] ensures
. The transformation a
i → A
i is [S
(f)] = [S
(n−1)][S
3]. Otherwise, we select the variant m, which gives non-negative
. According to equations (6)–(9)
, m is defined such that
![]() |
If equation (10) is fulfilled only for one m then none of is zero [Fig. 1 ▸(b), m = 2]. The transformation
is
![]() |
This moves the algorithm to the iteration n + 1.
However, equation (10) might be valid for two variants if e.g.
=
. Then either [S
m1] or [S
m2] could be selected for the next iteration, which yields
or
, respectively. The transformation
is described by equation (11) with m = max(m1, m2), which ensures
≠ 0 [m = 3,
= 0 in Fig. 1 ▸(c)]. The algorithm will be completed by PARA with respect to the vectors a
1 =
and a
2 =
such that
≠ 0 [Figs. 1 ▸(d) and 1 ▸(e)].
Table 1 ▸ and Fig. 1 ▸ show that the example of the TRIO algorithm where the target vector is T = results in
![]() |
3. Transformation of basis vectors to a target lattice plane
We will show how TRIO helps transform the basis vectors a
i → A
i so that A
1, A
2 are parallel to the reticular (lattice) planes with Miller indices (hkl). Such planes are perpendicular to a reciprocal-lattice vector T* = , and the inter-planar distance is the inverse length of T* [see e.g. De Graef & McHenry (2012 ▸) and Giacovazzo (1992 ▸)]. We apply TRIO to the reciprocal basis vectors
with the target vector
:
![]() |
We can calculate the equivalent matrix of transformation of the direct-lattice vectors [equation (21) in Appendix A ],
![]() |
This will result in A 1, A 2 ⊥ T*. Because A i form the basis of the same lattice, A 1, A 2 are the basis of the two-dimensional lattice in the (hkl) planes and A 3 connects two adjacent planes. This algorithm applies for two-dimensional (Table S2/Fig. S2) and multi-dimensional cases alike. The three-dimensional case is illustrated in the key application below and in Table S3/Fig. S3. The multi-dimensional version (supporting information) may be useful for the analysis of quasicrystals where projecting the multi-dimensional lattice onto one of its three-dimensional sub-lattices is required.
Note that the coordinates of A 3 (or vector A N for the multi-dimensional case) are known as Bézout coefficients (Bézout, 1779 ▸). Therefore, the algorithm may be useful as an alternative method for finding such coefficients for any number of dimensions.
4. Simulation of the geometry of zone planes perpendicular to the target zone axis
The ‘zone axis’ is the direction parallel to a lattice vector T = u
i
a
i (). The reciprocity of direct and reciprocal lattices means that T is normal to the reciprocal-lattice planes with ‘Miller’ indices u
i. Zones appear e.g. in electron diffraction as two-dimensional sections of reciprocal space by a nearly flat Ewald sphere (Vainshtein, 2013 ▸) or in Laue diffraction patterns (Helliwell et al., 1989 ▸; Ren et al., 1999 ▸; Send et al., 2009 ▸) as visually striking second-order curves – ellipses, hyperbolas and parabolas.
Using T as a target of TRIO, we obtain the transformation matrix [S] for the direct-lattice vectors with A
3 ∥ T. The corresponding reciprocal-lattice vectors =
are transformed by [S*]T = [S]−1, with
parallel to the zone plane. The two-dimensional lattice parameters of a zone are obtained from the components of the reciprocal metric tensor and equation (22):
![]() |
followed by
![]() |
Table 2 ▸ and Fig. 2 ▸ demonstrate four ‘zones’ of a cubic lattice (a i a j = a 2δij) with a = 4 Å.
Table 2. The transformations of the reciprocal-lattice basis vectors of a cubic lattice (a = 4 Å) to pre-selected zones.
The last column shows the corresponding two-dimensional lattice parameters.
Zone axis | [S*] |
![]() ![]() ![]() |
---|---|---|
[110] |
![]() |
0.25 Å−1, 0.36 Å−1, 90° |
[111] |
![]() |
0.35 Å−1, 0.35 Å−1, 60° |
[123] |
![]() |
0.56 Å−1, 0.61 Å−1, 137° |
[431] |
![]() |
1.03 Å−1, 0.79 Å−1, 23° |
Figure 2.
Illustrations of the new basis vectors for a cubic lattice and pre-selected zone axes, corresponding to the rows in Table 2 ▸: panel (a) corresponds to the first row in Table 2 ▸ with zone axis [110], panel (b) to the second row with zone axis [111] etc. The projection of the basis vectors is shown in the bottom left-hand corner of each panel.
Section S5 in the supporting information shows another application of the algorithm for the transformation of a unit cell (the LiNbO3 crystal structure is considered). In particular, it demonstrates the extension of the algorithm for the case of a non-primitive conventional unit cell.
5. On the length of the vectors A i
The algorithms introduced here help in reaching one of infinitely many transformations to the specific target. However, the course of the algorithms does not depend on the matrix of dot products [G] or lattice parameters. Under these conditions, the transformed lattice parameters remain undefined and it is therefore impossible to choose one variant of the transformation over another. If [G] is known, the existing lattice reduction algorithms [e.g. Niggli (1928 ▸)] can be applied to transform the subset of A i (e.g. A 1 and A 2) without changing the target. For example, it is possible to apply the Minkowski algorithm to reduce the lengths of vectors A 1 and A 2 [e.g. Rote (1997 ▸) and Helfrich (1985 ▸)].
6. Related literature
The following references are cited in the supporting information: Abrahams et al. (1966 ▸), Ong et al. (2013 ▸), Weis & Gaylord (1985 ▸).
7. Conclusions
We have presented algorithms for the transformation of lattice basis vectors, so that one of the vectors is parallel to a target direction T, or alternatively two of the vectors are parallel to the target lattice planes (hkl). Such transformations are useful for e.g. the simulation of electron diffraction (presented here) and the transformation of crystal structures for exposing certain lattice planes (supporting information). We generalize the algorithm to the multi-dimensional case (MULDIN algorithm, supporting information), which may be useful for the analysis of quasiperiodic crystals or as an alternative approach for finding multi-dimensional Bézout coefficients.
Supplementary Material
MATLAB script realizing the algorithm in the general multi-dimensional form. The number of space dimensions is determined by the size of the input vector. DOI: 10.1107/S2053273320012668/ae5090sup1.txt
Additional tables and figures. DOI: 10.1107/S2053273320012668/ae5090sup2.pdf
Acknowledgments
The author acknowledges Dr Alexei Entin (School of Mathematics, Tel Aviv University, Israel) for stimulating discussions and proofreading the manuscript.
Appendix A. Symbols, notation and important crystallographic relationships
The indices i, j run from 1 to N (N is the number of space dimensions). The Einstein summation rule applies to these indices but is abandoned for the index in brackets (m).
a i are linearly independent basis vectors of an N-dimensional crystal lattice. A i are transformed basis vectors of the same crystal lattice. We assume that both sets determine primitive unit cells, otherwise the transformation to such must be performed.
are the reciprocal basis vectors, such that their dot products with a
i are
= δij (here δij is the Kronecker delta).
are the reciprocals of the transformed basis vectors such that
= δij.
[g] and [g*] are the components of the direct and reciprocal metric tensors: g
ij = a
i · a
j and =
. [G] and [G*] are the analogous components for the transformed basis vectors: G
ij = A
i · A
j and
=
.
x i are the direct lattice coordinates of a vector T = x i a i. X i are the coordinates of the same vector relative to the transformed basis vectors: T = X i A i.
h
i (hk for two- and hkl for three-dimensional cases) are the reciprocal-lattice coordinates of a vector T* = . H
i are the transformed coordinates of the same vector: T* =
.
[S] is the N×N matrix of the a i → A i transformation. The columns of [S] are the coordinates of A i relative to a i, so that A i = a j S ji. For the three-dimensional case, the formal matrix equation applies:
![]() |
A
i form a primitive unit cell of the same lattice if and det[S] = ±1. (det[S] = −1 if the transformation changes the handedness of the coordinate system.)
[S*] is the N×N matrix of transformation for the reciprocal-lattice vectors:
![]() |
[x], [X] are the N×1 columns of the numbers x i, X i, respectively. [h], [H] are the 1×N rows of the reciprocal-lattice coordinates h i, H i.
The following transformations are used in this paper (De Graef & McHenry, 2012 ▸; Hahn, 2005 ▸; Giacovazzo, 1992 ▸).
The transformation of the direct- and reciprocal-lattice coordinates of a vector:
![]() |
![]() |
The relationship between [S] and [S*]:
![]() |
The transformation of the matrix of the dot product:
![]() |
If the transformations and
are defined by the matrices [S
1] and [S
2], then the combined transformation
is defined as a matrix product:
![]() |
Funding Statement
This work was funded by Israel Science Foundation grant 51/5651.
References
- Abrahams, S. C., Hamilton, W. C. & Reddy, J. M. (1966). J. Phys. Chem. Solids, 27, 1013–1018.
- Aroyo, M. I., Kirov, A., Capillas, C., Perez-Mato, J. M. & Wondratschek, H. (2006). Acta Cryst. A62, 115–128. [DOI] [PubMed]
- Aroyo, M. I., Perez-Mato, J. M., Capillas, C., Kroumova, E., Ivantchev, S., Madariaga, G., Kirov, A. & Wondratschek, H. (2006). Z. Kristallogr. 221, 15–27.
- Bézout, E. (1779). Théorie générale des équations algébriques. Hachette Livre-BNF.
- Biermanns, A., Breuer, S., Davydok, A., Geelhaar, L. & Pietsch, U. (2011). Phys. Status Solidi RRL, 5, 156–158.
- De Graef, M. & McHenry, M. E. (2012). Structure of Materials: An Introduction to Crystallography, Diffraction and Symmetry. Cambridge University Press.
- Flor, G. de la, Orobengoa, D., Tasci, E., Perez-Mato, J. M. & Aroyo, M. I. (2016). J. Appl. Cryst. 49, 653–664.
- Giacovazzo, C. (1992). Fundamentals of Crystallography. International Union of Crystallography/Oxford University Press.
- Glazer, A. M. (1972). Acta Cryst. B28, 3384–3392.
- Glazer, A. M. (1975). Acta Cryst. A31, 756–762.
- Hahn, T. (2005). International Tables for Crystallography, Volume A, Space Group Symmetry. Heidelberg: Springer.
- Helfrich, B. (1985). Theor. Comput. Sci. 41, 125–139.
- Helliwell, J. R., Habash, J., Cruickshank, D. W. J., Harding, M. M., Greenhough, T. J., Campbell, J. W., Clifton, I. J., Elder, M., Machin, P. A., Papiz, M. Z. & Zurek, S. (1989). J. Appl. Cryst. 22, 483–497.
- Howard, C. J. & Stokes, H. T. (2005). Acta Cryst. A61, 93–111.
- Knuth, D. E. (1997). The Art of Computer Programming. London: Pearson Education.
- Kresse, G. & Furthmüller, J. (1996). Phys. Rev. B, 54, 11169–11186. [DOI] [PubMed]
- Marzouki, M. A., Souvignier, B. & Nespolo, M. (2014). IUCrJ, 1, 39–48. [DOI] [PMC free article] [PubMed]
- Momma, K. & Izumi, F. (2011). J. Appl. Cryst. 44, 1272–1276.
- Müller, U. (2013). Symmetry Relationships between Crystal Structures: Applications of Crystallographic Group Theory in Crystal Chemistry. Oxford University Press.
- Nespolo, M. & Ferraris, G. (2006). Acta Cryst. A62, 336–349. [DOI] [PubMed]
- Niggli, P. (1928). Krystallographische und strukturtheoretische Grundbegriffe. Leipzig: Akademische Verlagsgesellschaft mbH.
- Ong, S. P., Richards, W. D., Jain, A., Hautier, G., Kocher, M., Cholia, S., Gunter, D., Chevrier, V. L., Persson, K. A. & Ceder, G. (2013). Comput. Mater. Sci. 68, 314–319.
- Ren, Z., Bourgeois, D., Helliwell, J. R., Moffat, K., Šrajer, V. & Stoddard, B. L. (1999). J. Synchrotron Rad. 6, 891–917.
- Rote, G. (1997). Theor. Comput. Sci. 172, 303–308.
- Schwarz, K., Blaha, P. & Madsen, G. K. H. (2002). Comput. Phys. Commun. 147, 71–76.
- Send, S., von Kozierowski, M., Panzner, T., Gorfman, S., Nurdan, K., Walenta, A. H., Pietsch, U., Leitenberger, W., Hartmann, R. & Strüder, L. (2009). J. Appl. Cryst. 42, 1139–1146.
- Tran, R., Xu, Z., Radhakrishnan, B., Winston, D., Sun, W., Persson, K. A. & Ong, S. P. (2016). Sci Data, 3, 160080. [DOI] [PMC free article] [PubMed]
- Vainshtein, B. K. (2013). Structure Analysis by Electron Diffraction. Amsterdam: Elsevier.
- Weis, R. S. & Gaylord, T. K. (1985). Appl. Phys. A, 37, 191–203.
- Zhang, Y., Li, Z., Esling, C., Muller, J., Zhao, X. & Zuo, L. (2010). J. Appl. Cryst. 43, 1426–1430. [DOI] [PMC free article] [PubMed]
Associated Data
This section collects any data citations, data availability statements, or supplementary materials included in this article.
Supplementary Materials
MATLAB script realizing the algorithm in the general multi-dimensional form. The number of space dimensions is determined by the size of the input vector. DOI: 10.1107/S2053273320012668/ae5090sup1.txt
Additional tables and figures. DOI: 10.1107/S2053273320012668/ae5090sup2.pdf