Skip to main content
Acta Crystallographica Section A: Foundations and Advances logoLink to Acta Crystallographica Section A: Foundations and Advances
. 2020 Oct 29;76(Pt 6):713–718. doi: 10.1107/S2053273320012668

Algorithms for target transformations of lattice basis vectors

Semën Gorfman a,*
PMCID: PMC7598097  PMID: 33125354

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 Inline graphic, 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 2T = 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 = Inline graphic.

Iteration 0: We transform the basis vectors a i to Inline graphic = ±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 Inline graphic = Inline graphic [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 Inline graphic. This creates two transformation variants [Inline graphic = Inline graphic],

2.1.
2.1.

Because det[S] = 1, Inline graphic form the basis of the same lattice for both variants. The coordinates of T transform as

2.1.

The exit condition of the algorithm is that one of Inline graphic is zero. This happens if Inline graphic = Inline graphic. If valid, the exit condition holds for both transformation variants. We can choose variant (2) to ensure that Inline graphic . The final transformation a iA i is given by the matrix product,

2.1.

If the exit condition is not fulfilled, we select the variant m yielding all positive Inline graphic: Inline graphic and Inline graphic force the choice of m = 1 [Fig. S1(c)] and m = 2 [Fig. S1(b)], respectively. The transformation Inline graphic is

2.1.

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 iA i so that A 3T = 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 = Inline graphic .

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 Inline graphic   Inline graphic Inline graphic
1 Inline graphic Inline graphic Inline graphic Inline graphic
2 Inline graphic Inline graphic Inline graphic Inline graphic
3 Inline graphic Inline graphic Inline graphic Inline graphic
4 Inline graphic Inline graphic Inline graphic Inline graphic

Figure 1.

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 Inline graphic.

Iteration 0: We transform the basis vectors Inline graphic = ±a i as in PARA, followed by their permutations ensuring the ‘right-handedness’ of Inline graphic {det[S (0)] = 1}, where [S (0)] is a 3×3 transformation matrix between a i and Inline graphic [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 Inline graphic, creating three transformation variants [Inline graphic = Inline graphic]:

2.2.
2.2.
2.2.

Because det[S] = 1, Inline graphic and a i build the same lattice for all three variants. The new coordinates of T are

2.2.

The exit condition (two of the new T coordinates are zero) is fulfilled if Inline graphic = Inline graphic = Inline graphic. If valid, it holds for all three variants but choosing [S 3] ensures Inline graphic. The transformation a iA i is [S (f)] = [S (n−1)][S 3]. Otherwise, we select the variant m, which gives non-negative Inline graphic. According to equations (6)–(9) , m is defined such that

2.2.

If equation (10) is fulfilled only for one m then none of Inline graphic is zero [Fig. 1(b), m = 2]. The transformation Inline graphic is

2.2.

This moves the algorithm to the iteration n + 1.

However, equation (10) might be valid for two variants if e.g. Inline graphic = Inline graphic. Then either [S m1] or [S m2] could be selected for the next iteration, which yields Inline graphic or Inline graphic, respectively. The transformation Inline graphic is described by equation (11) with m = max(m1, m2), which ensures Inline graphic ≠ 0 [m = 3, Inline graphic = 0 in Fig. 1(c)]. The algorithm will be completed by PARA with respect to the vectors a 1 = Inline graphic and a 2 = Inline graphic such that Inline graphic ≠ 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 = Inline graphic results in

2.2.

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* = Inline graphic, 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 Inline graphic with the target vector Inline graphic:

3.

We can calculate the equivalent matrix of transformation of the direct-lattice vectors [equation (21) in Appendix A ],

3.

This will result in A 1, A 2T*. 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 (Inline graphic). 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 3T. The corresponding reciprocal-lattice vectors Inline graphic = Inline graphic are transformed by [S*]T = [S]−1, with Inline graphic 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):

4.

followed by

4.

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*] Inline graphic, Inline graphic, Inline graphic
[110] Inline graphic 0.25 Å−1, 0.36 Å−1, 90°
[111] Inline graphic 0.35 Å−1, 0.35 Å−1, 60°
[123] Inline graphic 0.56 Å−1, 0.61 Å−1, 137°
[431] Inline graphic 1.03 Å−1, 0.79 Å−1, 23°

Figure 2.

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 Inline graphic 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

a-76-00713-sup1.txt (2.2KB, txt)

Additional tables and figures. DOI: 10.1107/S2053273320012668/ae5090sup2.pdf

a-76-00713-sup2.pdf (1.2MB, 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.

Inline graphic are the reciprocal basis vectors, such that their dot products with a i are Inline graphic = δij (here δij is the Kronecker delta). Inline graphic are the reciprocals of the transformed basis vectors such that Inline graphic = δij.

[g] and [g*] are the components of the direct and reciprocal metric tensors: g ij = a i · a j and Inline graphic = Inline graphic. [G] and [G*] are the analogous components for the transformed basis vectors: G ij = A i · A j and Inline graphic = Inline graphic.

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* = Inline graphic. H i are the transformed coordinates of the same vector: T* = Inline graphic.

[S] is the N×N matrix of the a iA 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:

Appendix A.

A i form a primitive unit cell of the same lattice if Inline graphic 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:

Appendix A.

[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:

Appendix A.
Appendix A.

The relationship between [S] and [S*]:

Appendix A.

The transformation of the matrix of the dot product:

Appendix A.

If the transformations Inline graphic and Inline graphic are defined by the matrices [S 1] and [S 2], then the combined transformation Inline graphic is defined as a matrix product:

Appendix A.

Funding Statement

This work was funded by Israel Science Foundation grant 51/5651.

References

  1. Abrahams, S. C., Hamilton, W. C. & Reddy, J. M. (1966). J. Phys. Chem. Solids, 27, 1013–1018.
  2. Aroyo, M. I., Kirov, A., Capillas, C., Perez-Mato, J. M. & Wondratschek, H. (2006). Acta Cryst. A62, 115–128. [DOI] [PubMed]
  3. 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.
  4. Bézout, E. (1779). Théorie générale des équations algébriques. Hachette Livre-BNF.
  5. Biermanns, A., Breuer, S., Davydok, A., Geelhaar, L. & Pietsch, U. (2011). Phys. Status Solidi RRL, 5, 156–158.
  6. De Graef, M. & McHenry, M. E. (2012). Structure of Materials: An Introduction to Crystallography, Diffraction and Symmetry. Cambridge University Press.
  7. Flor, G. de la, Orobengoa, D., Tasci, E., Perez-Mato, J. M. & Aroyo, M. I. (2016). J. Appl. Cryst. 49, 653–664.
  8. Giacovazzo, C. (1992). Fundamentals of Crystallography. International Union of Crystallography/Oxford University Press.
  9. Glazer, A. M. (1972). Acta Cryst. B28, 3384–3392.
  10. Glazer, A. M. (1975). Acta Cryst. A31, 756–762.
  11. Hahn, T. (2005). International Tables for Crystallography, Volume A, Space Group Symmetry. Heidelberg: Springer.
  12. Helfrich, B. (1985). Theor. Comput. Sci. 41, 125–139.
  13. 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.
  14. Howard, C. J. & Stokes, H. T. (2005). Acta Cryst. A61, 93–111.
  15. Knuth, D. E. (1997). The Art of Computer Programming. London: Pearson Education.
  16. Kresse, G. & Furthmüller, J. (1996). Phys. Rev. B, 54, 11169–11186. [DOI] [PubMed]
  17. Marzouki, M. A., Souvignier, B. & Nespolo, M. (2014). IUCrJ, 1, 39–48. [DOI] [PMC free article] [PubMed]
  18. Momma, K. & Izumi, F. (2011). J. Appl. Cryst. 44, 1272–1276.
  19. Müller, U. (2013). Symmetry Relationships between Crystal Structures: Applications of Crystallographic Group Theory in Crystal Chemistry. Oxford University Press.
  20. Nespolo, M. & Ferraris, G. (2006). Acta Cryst. A62, 336–349. [DOI] [PubMed]
  21. Niggli, P. (1928). Krystallographische und strukturtheoretische Grundbegriffe. Leipzig: Akademische Verlagsgesellschaft mbH.
  22. 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.
  23. Ren, Z., Bourgeois, D., Helliwell, J. R., Moffat, K., Šrajer, V. & Stoddard, B. L. (1999). J. Synchrotron Rad. 6, 891–917.
  24. Rote, G. (1997). Theor. Comput. Sci. 172, 303–308.
  25. Schwarz, K., Blaha, P. & Madsen, G. K. H. (2002). Comput. Phys. Commun. 147, 71–76.
  26. 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.
  27. 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]
  28. Vainshtein, B. K. (2013). Structure Analysis by Electron Diffraction. Amsterdam: Elsevier.
  29. Weis, R. S. & Gaylord, T. K. (1985). Appl. Phys. A, 37, 191–203.
  30. 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

a-76-00713-sup1.txt (2.2KB, txt)

Additional tables and figures. DOI: 10.1107/S2053273320012668/ae5090sup2.pdf

a-76-00713-sup2.pdf (1.2MB, pdf)

Articles from Acta Crystallographica. Section A, Foundations and Advances are provided here courtesy of International Union of Crystallography

RESOURCES