research papers\(\def\hfill{\hskip 5em}\def\hfil{\hskip 3em}\def\eqno#1{\hfil {#1}}\)

ISSN: 2053-2733

Coordinate transformations in modern crystallographic computing

aDepartment of Biochemistry, UT Southwestern Medical Center at Dallas, 5323 Harry Hines Boulevard, Dallas, TX 75390-9038, USA
*Correspondence e-mail:

(Received 7 January 2004; accepted 13 July 2004)

A review of 4 × 4-matrix notation and of tensor formalism focused on crystallographic applications is presented. A discussion of examples shows how this notation simplifies tasks encountered in crystallographic computing.

1. Introduction

This paper presents a summary of tensor formalism, which is very important in crystallography, and especially in crystallographic computations. Most of the material described here is well known but was published in very old books and papers (Einstein, 1916[Einstein, A. (1916). Ann. Phys. (Leipzig), 49, 769.]; Seitz, 1936[Seitz, F. (1936). Ann. Math. 37, 17-28.]; Bienenstock & Ewald, 1962[Bienenstock, A. & Ewald, P. P. (1962). Acta Cryst. 15, 1253-1261.]; Bradley & Cracknell, 1972[Bradley, C. J. & Cracknell, A. P. (1972). The Mathematical Theory of Symmetry in Solids. Oxford: Clarendon Press.]; Hall, 1981[Hall, S. (1981). Acta Cryst. A37, 517-525.] etc.). We feel that it is high time to recall this formalism in a review focused on its application to crystallographic computing and adaptation to high-level programming languages.

Crystallography deals with objects defined in various coordinate systems, e.g. the fractional coordinate system (used for data or symmetry operators), the grid coordinate system (in which computations are done), the Protein Data Bank (PDB) coordinate system, or the graphics coordinate system (used to display data on a computer screen). Moreover, these objects may have different transformation properties.

Distinguishing mathematical objects with respect to their transformation properties is very important when writing crystallographic software. In particular, keeping track of coordinate systems and transformation properties of variables allows for more efficient and less error-prone programming.

The importance of consistency in notation for further development of the field has been recognized by the IUCr by appointing the Commission on Crystallographic Nomenclature. In one of their reports (Trueblood et al., 1996[Trueblood, K. N., Bürgi, H.-B., Burzlaff, H., Dunitz, J. D., Gramaccioli, C. M., Schulz, H. H., Shmueli, U. & Abrahams, S. C. (1996). Acta Cryst. A52, 770-781.]), a uniform notation for atomic displacement parameters is proposed, including distinguishing between contravariant and covariant quantities. The present article follows this recommendation by providing a review of a uniform notation for coordinate changes for all crystallographic quantities.

A natural way of coupling program variables to their crystallographic properties is the object-oriented programming style. With its use, one can implicitly define operations allowed for each type of variable. Operations explicitly defined for one coordinate system may be implicitly extended to other cases by the compiler. This is especially important when new functionality is added to an already existing application. In the present paper, we recall a mathematical formalism, which can be naturally used for defining classes of basic objects encountered in crystallographic calculations. We start by presenting a consistent representation for the basic variable types encountered in crystallography (§§2[link] and 3[link]). Later, we discuss more complex applications and demonstrate how this notation works. This will include examples of defining view-ports for graphics display and transforming the anisotropic temperature factor. These rules apply to both real and recipro­cal space, including calculation of derivatives.

2. Crystallographic 4-vector notation

In this section, we present the 4-vector notation, which proves very useful for changing coordinate systems in crystallography. For the purposes of this section, it is enough to distinguish between vectors and covectors. A more detailed discussion of covariant and contravariant quantities will be presented in §3[link].

2.1. Real-space 4-vector notation

The real-space 4-vector notation is well known in crystallography (Hahn, 1995[Hahn, T. (1995). Editor. International Tables for Crystallography, Vol A. Dordrecht: Kluwer Academic Publishers.]; Hall, 1981[Hall, S. (1981). Acta Cryst. A37, 517-525.]) as well as in general computing (Bradley & Cracknell, 1972[Bradley, C. J. & Cracknell, A. P. (1972). The Mathematical Theory of Symmetry in Solids. Oxford: Clarendon Press.]; Seitz, 1936[Seitz, F. (1936). Ann. Math. 37, 17-28.]). Throughout the paper, we will write 3-vectors and 3-matrices in bold type and 4-vectors and 4-matrices in bold-italic type. Let

[{\bi x} = \left[\matrix{ {\bf x}\cr 1}\right], ]

where [{\bf x}] is a real-space vector. Let [{\bf S}_g] denote a crystallographic symmetry operator. Crystallographic symmetry operators are isometries. They can be represented as a superposition of a matrix [{\bf R}_g] (with [\det {\bf R}_g = \pm 1]) and a non-primitive translation by vector [{\bf t}_{g}]. Then, the symmetry operator [{\bf S}_g] transforms a vector [{\bf x}] in the real space as follows:

[{\bf S}_g({\bf x}) = {\bf R}_g{\bf x} + {\bf t}_g.]

One can represent the transformation [{\bf S}_g] as a 4×4 matrix [{\bi S}_g] as follows:

[{\bi S}_g = \left [\matrix{&\,\cr {\bf R}_g\,& {\bf t}_g\cr \,&\,\cr \matrix{ 0&0&0 } &1 } \right].]

In this notation, the action of [{\bi S}_g] is represented by multiplication only:

[{\bi S}_g {\bi x} = \left [\matrix {\,&\,\cr {\bf R}_g\, & {\bf t}_g\cr \,&\,\cr \matrix { 0&0&0 } &1 } \right] \left[\matrix{ x \cr y\cr z\cr 1}\right] = \left[\matrix{ {\bf R}_g{\bf x} + {\bf t}_g\cr1}\right].\eqno(1)]

The composition of two isometries is traditionally described by a somewhat complicated formula

[{\bi S}_{g_1}{\bi S}_{g_2}{\bf x} = {\bf R}_{g_1}{\bf R}_{g_2} {\bf x} + {\bf R}_{g_1}{\bf t}_{g_2}+{\bf t}_{g_1}. ]

In the 4-vector notation, a composition of isometry transformations is expressed as a multiplication of their corresponding 4×4 matrices:

[\eqalign{{\bi S}_{g_1g_2}{\bi x} &= {\bi S}_{g_1}\circ {\bi S}_{g_2}{\bi x} \cr&= {\bi S}_{g_1} \left({\bi S}_{g_2} \left[\matrix{ {\bf x}\cr1}\right] \right) = \left[\matrix{ {\bf R}_{g_1}{\bf R}_{g_2} {\bf x} + {\bf R}_{g_1}{\bf t}_{g_2}+{\bf t}_{g_1}\cr1}\right].}]

A consequence of this equation is another convenient feature of this notation:

[{\bi S}_{g^{-1}} = {\bi S}_{g}^{-1}, ]


[{\bi S}_{g}^{-1} = \left [\matrix{ \,&\,\cr ({\bf R}_g)^{-1}\,& -({\bf R}_g)^{-1}{\bf t}_g\cr \,&\,\cr \matrix{ 0&0&0 } &1 } \right].]

Note that [{\bf t}_{g^{-1}} = -({\bf R}_{g}){}^{-1}{\bf t}_{g}] and

[({\bi R}_g^{-1}){}^T = {\bi R}_g. \eqno(2)]


[\det {\bi S}_g = \det {\bf R}_g,]

which allows us to use the determinant of [\bi S] in place of the determinant of [\bf R], for example when distinguishing between rotations and reflections.

2.2. Reciprocal-space 4-vector notation

The convention presented in this subsection has been partially described by Bienenstock & Ewald (1962[Bienenstock, A. & Ewald, P. P. (1962). Acta Cryst. 15, 1253-1261.]) and was subsequently used by Ten Eyck (1973[Ten Eyck, L. (1973). Acta Cryst. A29, 183-191.]). However, they did not distinguish between vectors and covectors, and consequently the transposed form of the symmetry operator had to be used in the reciprocal space. We present a means of keeping the same form of the symmetry operator in both real and reciprocal space. The data in the real space, [f({\bf x})], are related to the reciprocal-space data [F({\bf h})] by the Fourier transform defined by

[F({\bf h}): = \textstyle\sum\limits_{{\bf x}} f({\bf x}) \exp (2\pi i \,{\bf h}\cdot {\bf x}). ]

In the reciprocal space, we will use a 4-vector notation as well. Vectors from reciprocal space transform differently to real-space vectors. To distinguish them, we will call reciprocal-space vectors (and any other vectors transforming in the same way) covectors and we will write vectors as columns and covectors as rows. A detailed discussion of vectors and covectors will follow in the next section. As in the real-space case, 3-covectors can be extended to 4-covectors. Unlike in the real space, the last entry in such a 4-covector is generally different from 1:

[\left[\matrix{ {\bf h} & \phi }\right] = \left[\matrix{ h& k & l & \phi }\right] .]

The symbol [\phi] denotes a phase angle associated with the vector [{\bf h}] (calculations involving [\phi] will be performed modulo 1). The meaning of the symbol [[{{\bf h} \,\,\, \phi }]] is the following:

[F\left(\left[\matrix{ {\bf h} & \phi }\right]\right): = \exp({2\pi i \phi}) F({\bf h}).\eqno(3)]

Note that this definition should be changed if a different Fourier transform definition is used. In this setting, the action of a symmetry operator [{\bf S}_g] (which corresponds to the action of [{\bf S}_g^{-1}] in the real space) in the reciprocal space can be described simply by multiplying a general 4-covector by the matrix of [{\bi S}_g], as introduced by (1)[link]:

[\left[\matrix{ {\bf h} &\phi }\right] {\bi S}_g = \left[\matrix{ {\bf h} {\bf R}_g &{\bf h}\cdot {\bf t}_g + \phi }\right] ,\eqno(4)]

where [{\bf h}\cdot {\bf t}_g] denotes the usual scalar product. Note that, owing to the special property of matrix [{\bf R}_g] [see equation (2[link])], one can use [({\bf R}_g^{-1}){}^T] instead of [{\bf R}_g] in equation (5). However, this cannot be done for non-orthogonal [{\bf R}_g] (see discussion in §3[link]). The symmetry operator [{\bi S}_g] in the reciprocal space is represented by the same matrix as in the real space (transposition not needed).

Let us show how our notation works with the Fourier transform. The symmetry operator [{\bf S}_g] acting on vectors in the real space induces a corresponding operator [{\bf S}^*_g] acting in the reciprocal space on the Fourier transforms of the real-space functions. Let [{\bf S}^*_g F({\bf h})] denote the Fourier transform of a function [f({\bi S}_g^{-1}{\bf x})]. Then (Bricogne, 1993[Bricogne, G. (1993). In International Tables for Crystallography, Vol. B. Dordrecht: Kluwer Academic Publishers.]; Rowicka et al., 2003[Rowicka, M., Kudlicki, A. & Otwinowski, Z. (2003). Acta Cryst. A59, 172-182.])

[{\bi S}^*_g F({\bf h}) = \exp (2\pi i {\bf h}\cdot {\bf t}_g)F({\bf h} {\bf R}_g).\eqno(5) ]

Using (5)[link] and (3)[link], we can compute

[\eqalign{{\bi S}^*_g F\left(\left[\matrix{ {\bf h} & \phi}\right]\right) &= \exp (2\pi i\phi){\bi S}^*_g F({\bf h}) \cr&= \exp (2\pi i\phi)\exp (2\pi i\phi {\bf h}\cdot {\bf t}_g) F({\bf h} {\bf R}_g).} ]


[\exp (2\pi i\phi)\exp (2\pi i\phi{\bf h}\cdot {\bf t}_g) F({\bf h} {\bf R}_g) = F\left(\left[\matrix{ {\bf h} {\bf R}_g &{\bf h}\cdot {\bf t}_g + \phi }\right]\right). ]

By (4)[link],

[F\left(\left[\matrix{ {\bf h} {\bf R}_g &{\bf h}\cdot {\bf t}_g + \phi }\right]\right) = F\left(\left[\matrix{ {\bf h} & \phi}\right] {\bi S}_g\right). ]

Thus we have shown that in our formalism the description of the interaction between crystallographic symmetry and the Fourier transform has the form

[{\bi S}^*_g F\left(\left[\matrix{ {\bf h} & \phi}\right]\right) = F\left(\left[\matrix{ {\bf h} & \phi}\right] {\bi S}_g\right),]

which is better suited for description of the composition of multiple affine transformations than the traditionally used equation (5)[link].

3. Covariant and contravariant quantities

Vectors and tensors in crystallography were quite extensively dealt with by Patterson (1959[Patterson, A. (1959). In International Tables for X-ray Crystallography, Vol. II. Birmingham: Kynoch Press.]) and Sands (1982[Sands, D. (1982). Vectors and Tensors in Crystallography. Reading, MA: Addison-Wesley.]). In this section, we outline the theory of transformation first, and then we show how to extend and apply that theory to the 4-vector notation.

3.1. Scalars, vectors and covectors

Depending on their transformation properties, objects encountered in crystallography can be classified as scalars, vectors, covectors, covariant or contravariant tensors etc. (see Tables 1[link] and 2[link]).

Table 1
Scalars, vectors, covectors

In the first row, we describe the notation, in the second row, we list transformation properties of these quantities, in the next row, we give general examples, in the last row, we give examples of specific physical quantities related to crystallography.

  Scalars Vectors Covectors
Notation a [ {\bf x} = x^i {\bf a}_i = \left[\matrix{ x^1\cr x^2\cr x^3}\right]] [{\bf h} = h_i\, {\bf a}^i = \left[\matrix{ h_1& h_2& h_3}\right]]
Transformation properties Invariant Contravariant, i.e. [ x^{\prime i} = f^i_{j} x^j] Covariant, i.e. [ x_i^{\prime} = h^j_{i} x_j]
Examples Physical invariants Real-space coordinates xyz (fractional, grid, PDB etc) Reciprocal-space coordinates (reflection indices hkl)
  Numbers Derivatives of a scalar with respect to reciprocal-space coordinates Derivatives of a scalar with respect to real-space coordinates
Crystallographic quantities [\rho] (electron density) [\!\left[\matrix{{{\partial F}/{\partial h}}\cr{{\partial F}/{\partial k}}\cr{{\partial F}/{\partial l}}}\right]] [\left[\matrix{{{\partial \rho}/{\partial x}}&{{\partial \rho}/{\partial y}}& {{\partial \rho}/{\partial z}}}\right]]
  F (structure factor)  
  I (intensity)  

Table 2
Second-order tensors

In the first row, we describe the tensor type, in the following rows, we provide examples.

  Tensors Tij Tensors Tij
Transformation properties [T^{\prime i j} = f_{k}^{i} f_{l}^{j} T^{kl}] [T_{ij}^{\prime} = h^{k}_{i} h^{l}_{j} T_{kl}]
Crystallographic examples [{{\partial \rho}/{\partial B^{ij}}}] [{{\partial \rho}/{\partial\, (B^{-1})_{ij}}}]
  Bij, Uij [atomic anisotropic displacement tensor (crystal system)] (B-1)ij, (U-1)ij [inverse of atomic anisotropic displacement tensor]
  gij (metric tensor in the reciprocal space) gij (metric tensor in the real space)

By definition, scalars are quantities that remain invariant during coordinate changes.

In the previous section, we were distinguishing between vectors and covectors with no thorough explanation, now we will discuss this subject in more detail.

The difference between a vector and a covector is in how they behave during coordinate changes. Let xi denote coordinates of a vector [{\bf x}] (such as a position vector of an atom), expressed in a certain basis (for example, in the crystallographic direct lattice basis [{\bf a}_1], [{\bf a}_2] and [{\bf a}_3]: [{\bf x} = ] [x^1{\bf a}_1+x^2{\bf a}_2+x^3{\bf a}_3]). Let us consider a coordinate change from the coordinates xi (i = 1,2,3) to the coordinates [ x^{\prime i}], given by functions fi,

[x^{\prime i }= f^i(x^1,x^2,x^3), \eqno(6)]

such that the coordinate change (6)[link] is invertible. Then, the relationship between the differentials of the new coordinates and the differentials of the old ones is the following:

[{\rm d}x^{\prime i} = \textstyle\sum\limits_{j = 1}^{3}f^i_{j} \,{\rm d}{ x}^j, \eqno(7)]

where [f^i_{j} = {{\partial f_i}/{\partial { x}^j}}]. From now on, we shall use the Einstein summation convention (Einstein, 1916[Einstein, A. (1916). Ann. Phys. (Leipzig), 49, 769.]): if an index appears twice in an expression, once as a subscript and once as a superscript, a summation over this index is thereby implied and the summation sign is suppressed. For example, within this convention, equation (7)[link] reads

[{\rm d}x^{\prime i} = f^i_{j} \,{\rm d}{ x}^j, \eqno(8)]

where the implicit sum is over j = 1,2,3. The repeating indices are often called dummy indices. In what follows, we will use the Einstein notation extensively, instead of using transposed matrices etc.

The components of a vector are transformed in the same way as differentials of coordinates [see equation (8)[link]]. By definition, such quantities are called contravariant and are denoted by superscripts. They transform as basis vectors of the dual base, that is in crystallography as the reciprocal-lattice basis vectors [{\bf a}^1], [{\bf a}^2] and [{\bf a}^3].

One can compute the derivatives [a_i=\partial a/\partial x_i] of a scalar a with respect to the new and old coordinates. Their relationship is the following:

[a_{i}^\prime = a_{j} h^j_{i} ,\eqno(9)]

where [hji] is the inverse of the matrix fij]:

Quantities transformed as derivatives with respect to coordinates are called covariant. Vectors whose components transform in the same way are called covectors. In crystallography, covariant quantities are reflection indices hkl. Covectors transform as the basis vectors, in crystallography as the direct-lattice basis vectors [{\bf a}_1], [{\bf a}_2] and [{\bf a}_3]. It is now obvious that derivatives of a scalar with respect to components of a vector form a covector.

Crystallographic examples and transformation properties of vectors and covectors are provided in Table 1[link].

3.2. Tensors

Let d be the dimensionality of the space. Objects consisting of dN components that transform as products of k covariant quantities and l contravariant quantities, where k+l = N, are called k-covariant l-contravariant Nth-order tensors. In general, many quantities may be viewed as tensors: scalars are tensors of order zero, vectors are contravariant tensors of order one, while covectors are covariant first-order tensors. Usually, the term tensor is applied only to tensors of order two or higher.

For example, a second-order contravariant tensor Tij would be transformed as

[T^{\prime i j} = f_{k}^{i} f_{l}^{j} T^{kl}. \eqno(10)]

The second-order covariant tensor Tij transforms as

[T_{ij}^{\prime} = h^{k}_{i} h^{l}_{j} T_{kl}. \eqno(11)]

The second-order tensor Tij with both covariant and contravariant components would transform as

[T^{\prime i}_{j} = h^{i}_{k} f^{l}_{j} T^k_{l}. \eqno(12)]

Crystallographic examples and transformation properties of second-order covariant and contravariant tensors are provided in Table 2[link].

3.3. Transformation of coordinates in 4-vector notation

In our notation, the fourth component of a vector is of a different nature to the other ones, in particular, in the real space it always equals 1. Therefore, in the real space, the only coordinate transformations that are allowed are such that preserve the fourth component. In the notation introduced in the previous section, this condition restricts the form of the coordinate changes to

[\eqalign{ x^{\prime 1}& = f_1(x^1,x^2,x^3,1)\cr x^{\prime 2}& = f_2(x^1,x^2,x^3,1)\cr x^{\prime 3}& = f_3(x^1,x^2,x^3,1)\cr x^{\prime 4}& = 1.}]

We need to introduce a convention to define a derivative with respect to this fourth coordinate. It is crucial that, with the assumed convention, the transformation properties of the fourth component are compatible with those of the first three coordinates. In this paper, we show that a good choice is to assume

[{{\partial f_i}\over{\partial {\bi x}}} = \left[{{\partial f_i}\over{\partial x^1}}, {{\partial f_i}\over{\partial x^2}}, {{\partial f_i}\over{\partial x^3}}, 0\right], \quad {\rm for} \quad i = 1,2,3, ]


[{{\partial f_4}\over{\partial x^i}} = \delta_{4i}. ]

The Kronecker symbol [\delta_{jk}] is defined as follows:

[\delta_{jk} = \delta^{j}_{k} = \delta^{jk} = \cases{ 1& for $ j = k$\cr 0& for $j\neq k$. }]

3.3.1. Affine transformations

Most coordinate systems used in crystallography are related by affine transformations.1 By affine transformation, we understand a transformation [{\bf S}] such that, for any 3-vector [{\bf x}],

[{\bf S}({\bf x}) = {\bf R}{\bf x} +{\bf t}.]

In the 4-vector notation, such an [{\bf S}] is given by

[{\bi S} = [S^\alpha_{\beta}] = \left[\matrix{ & \cr &{\bf R}& & {\bf t}\cr & \cr 0&0&0 & 1 }\right].\eqno(13)]

Here, in contrast to the crystallographic symmetry operator given by equation (1)[link], the matrix [{\bf R}] is a general invertible matrix. In particular, affine transformations may not preserve distances (i.e. be non-orthogonal) or they may not preserve angles (i.e. be non-conformal).

The 4-vector notation allows simplification of affine transformations of vectors and covectors. For a 4-vector [{\bi x}], its transformed coordinates [x^{\prime\alpha}] are related to the original coordinates [x^\alpha] by

[x^{\prime\beta} = S^\beta_{\gamma} x^\gamma, \eqno(14)]

where [{\bi S}] is given by equation (13)[link]. In the matrix form,

[{\bi x}^\prime = {\bi S}{\bi x} = \left[\matrix{ &&&\cr &{\bf R}&&{\bf t}\cr&&&\cr0&0&0&1}\right]\left[ \matrix{{\bf x}\cr 1}\right] = \left[\matrix{ {\bf R}{\bf x}+{\bf t} \cr1}\right] = \left[\matrix{ {\bf x}^\prime \cr 1}\right].]

On the other hand, a 4-covector [{\bi h}] transforms as follows:

[h^\prime_\beta = (S^{-1})_{\beta}^\kappa h_\kappa, \eqno(15)]


[{\bi S}^{-1} = [(S^{-1}){}^\alpha_{\beta}] = \left[\matrix{ & \cr &{\bf R}^{-1}& & -{\bf R}^{-1}{\bf t}\cr & \cr 0&0&0 & 1 }\right].\eqno(16)]

In the matrix form, the transformation of a covector [{\bi h}] reads

[\eqalign{{\bi h}^\prime = {\bi h} {\bi S}^{-1} &= \left[\matrix{ {\bf h}& \phi}\right] \left[\matrix{ &&&\cr&{\bf R}^{-1}&&-{\bf R}^{-1}{\bf t}\cr&&&\cr0&0&0&1} \right]\cr &= \vphantom{\Big[}\left[\matrix{ {\bf h}{\bf R}^{-1}& -{\bf h}{\bf R}^{-1}{\bf t}+\phi}\right] \cr &= \left[\matrix{ {\bf h}^\prime& \phi^\prime}\right].}]

Observe that, during an affine transformation of a covector, the fourth component of the transformed covector changes, in contrast to the case of vectors. The reason is that, in the covariant (reciprocal) space, the translational part of [{\bf S}] is not realized as translation of coordinates but as phase shift, in the sense of equations (3)[link], (4)[link] and (5)[link].

Many objects encountered in crystallography can be described by quadratic forms (cf. Table 2[link]). Affine transformations of symmetric tensors corresponding to quadratic forms can also be simplified by the 4-vector notation. A quadratic form [{\cal G}] is defined by

[{\cal G}({\bf x}): = {\bf x}^T{\bf G}{\bf x} = G_{ij}x^ix^j,]

where [{\bf G}] is a symmetric matrix. Provided that [{{\bf x}}] is a contravariant vector, the matrix [{\bf G}] transforms as a 2-order covariant tensor. In order to perform affine transformations of tensors conveniently, we switch to the 4-vector notation. This will involve extending 3×3 tensors to 4×4 tensors, compatible with the 4-vectors and 4-covectors introduced in §§2.1[link] and 2.2[link], respectively. Quadratic forms are commonly applied to describing quadratic surfaces. In three dimensions, the general equation of a quadratic surface centered at [{\bf p}] is given by

[({\bf x}-{\bf p}){}^T {\bf G} ({\bf x}-{\bf p}) = c,\eqno(17)]

where c is a real number.

We propose a simpler form of the general quadratic surface equation:

[{\bi x}^T {\bi G}{\bi x} = 0,]


[{\bi x} = \left[\matrix{ {\bf x}\cr 1}\right] \quad{\rm and}\quad {\bi G} = \left[\matrix{ {\bf G} & - {\bf G}{\bf p} \cr - ({\bf G}{\bf p})^T &{\bf p}^T {\bf G} {\bf p}-c }\right]. \eqno(18)]

Let [{\bi S}] be an affine transformation given by (13)[link]. Then [{\bi G}] will transform as follows:

[G^\prime_{\gamma\delta} = (S^{-1}){}^{\alpha}_{\gamma} (S^{-1}){}^{\beta}_{\delta} G_{\alpha\beta}.\eqno(19)]

Using formula (19)[link], one can compute that [{\bi G}^\prime] has the same form as [{\bi G}]. Namely,

[{\bi G}^\prime = \left[\matrix{ {\bf G}^\prime & - {\bf G}^\prime{\bf p}^\prime \cr - ({\bf G}^\prime{\bf p}^\prime)^T & ({\bf p}^\prime)^T {\bf G}^\prime {\bf p}^\prime-c }\right],]


[{\bf G}^\prime = ({\bf R}^{-1}){}^T{\bf G}{\bf R}^{-1}\quad{\rm and}\quad {\bf p}^\prime = {\bf R}{\bf p}+{\bf t} = {\bf S}({\bf p}).]

As expected, the 3×3 tensor [{\bf G}] transforms as a second-order covariant tensor. Observe also that the transformed quadratic form [{\cal G}^\prime] corresponds to a surface centered at [{\bf p}^\prime], that is the image of [{\bf p}], the center of the surface related to the original form [{\cal G}].

In some cases, the quantity of interest in (17)[link] is defined by the inverse of a given matrix. Then we can rewrite (17)[link] with [{\bf H}: = {\bf G}^{-1}]:

[({\bf x}-{\bf p}){}^T {\bf H}^{-1} ({\bf x}-{\bf p}) = c.]

In the 4-vector notation,

[\widetilde{\cal H}({\bi x}): = {\bi x}^T{\bi H}^{-1}{\bi x} = (H^{-1})_{\alpha\beta}x^\alpha x^\beta ]


[{\bi H}^{-1} = [(H^{-1})_{\alpha\beta}] = \left[\matrix{ {\bf H}^{-1} & - {\bf H}^{-1}{\bf p} \cr - ({\bf H}^{-1}{\bf p}){}^T &{\bf p}^T {\bf H}^{-1} {\bf p}-c }\right]. ]

It follows that

[{\bi H} = [H^{\alpha\beta}] = \left[\matrix{ {\bf H} -{{1}\over{c}}{\bf p} {\bf p} ^T & -{{1}\over{c}}{\bf p} \cr - {{1}\over{c}} {\bf p} ^T& - {{1}\over{c}} }\right]. ]

Observe that [{\bi H}] is a contravariant tensor, whereas [{\bi H}^{-1}] is a covariant one.

One can also define a quadratic form [{\cal F}] for a covector [{{\bf h}}] by

[{\cal F}({\bf h}): = {\bf h}{\bf F}{\bf h}^T.]

The corresponding matrix [{\bf F}] transforms as a 2-order contravariant tensor. However, in this case, there will be no quadratic surfaces centered at [{\bf q}\neq [0,0,0]]. The intuitive explanation is the same as in the case of the affinely transformed covector: in the covariant space (such as the reciprocal space, space of normal covectors or space of derivatives), translation of the coordinates is not possible. Therefore, the centers of the quadratic surfaces in the covariant space do not change during affine transformations. For simplicity, we consider in the reciprocal space only quadratic surfaces that are centered at [{\bf 0}: = [0,0,0]]. This leads to the following definition of the symbol [{\bi F}] in the 4-vector notation:

[{\bi F} = \left[\matrix{ {\bf F}& {\bf 0}^T\cr {\bf 0}&0}\right]. ]

The symbol [{\bi F}] encoding the form [{\cal F}] transforms as a contravariant second-order four-dimensional tensor

[F^{\prime \gamma\delta} = S_{ \alpha}^{\gamma} S_{\beta}^{\delta} F^{\alpha\beta}.\eqno(20)]

In matrix notation,

[{\bi F}^\prime = \left[\matrix{ {\bf F}^\prime&{\bf 0}^T \cr {\bf 0}& 0 }\right], ]


[{\bf F}^\prime = {\bf R}{\bf F}{\bf R}^T.]

4. Examples

Now we will show several examples of our notation facilitating issues encountered in practice.

4.1. 3D graphics view-port: definition and transformations

In graphical rendering programs, one has to define a view-port, that is a region of considered space that is displayed at a given moment. Below we discuss two widely used types of view-ports and show how easily one can perform affine (i.e. in general not orthogonal) transformation of them using our notation.

4.1.1. Polyhedral view-ports

The most commonly used type of view-port has the shape of a polyhedron, i.e. a volume delimited by a number of polygons. An example of a polyhedron specific to crystallography is the asymmetric unit. A convenient way of defining a polyhedral view-port is by listing a number of (usually six) cutting planes, with distinguishable sides. In fact, this is how the standard asymmetric units are defined in International Tables for Crystallography (Hahn, 1995[Hahn, T. (1995). Editor. International Tables for Crystallography, Vol A. Dordrecht: Kluwer Academic Publishers.]). For a plane [\pi], its positive side will be identified with the half-space [\pi_+], which contains the view-port. A point belongs to the view-port [\Xi] when it belongs to all half-spaces defining it,

[\Xi = \bigcap_{i = 1}^6 {\pi_i}_{+}.\eqno(21)]

The condition for a point [{\bf x} = (x^1,x^2,x^3)] to belong to a positive half-space [\pi_+] can be described by four numbers, a, b, c and d:

[a x^1 +b x^2 +c x^3+d \,\gt\, 0. \eqno(22)]

In particular, one can describe such a half-space by giving a point [{\bf p}] with coordinates (p1,p2,p3), belonging to the cutting plane, and providing three numbers a, b and c that specify the orientation of the plane. Then,

[a x^1 + b x^2 +c x^3- a p^1 -b p^2 -c p^3 \,\gt \,0. \eqno(23)]

From the above equation, it follows that a, b, c transform as components of a covector. Let us denote this three-dimensional covector by [{\bf n}]. Observe that [{\bf n}] is normal to the cutting plane [\pi] and it points towards the inside of the view-port.

We will now switch to 4-vector notation and demonstrate how easily affine transformations of the thus defined view-port can be performed within the 4-vector formalism. In this notation, [{\bi n}] is a 4-covector:

[{\bi n} = \left[\matrix{ a & b & c & (-a p^1 -b p^2 -c p^3) }\right]. \eqno(24)]

Now, the condition for a 4-vector [{\bi x}]

[{\bi x} = \left[\matrix{ x^1\cr x^2\cr x^3\cr 1}\right]]

to belong to the half-space [\pi_+] reads

[{n}_{\alpha} {x}^{\alpha} \,\gt \, 0, \eqno(25)]

where the implicit summation is over [\alpha = 1,2,3,4]. Let us transform the coordinates by an affine transformation [{\bi S}]. The transformed coordinates [{x^{\prime\alpha}}] are related to the original coordinates [x^\alpha] according to equation (14)[link], the coordinates of [{\bi n}] transform as in equation (15)[link]. Let us show that condition (25)[link] is preserved during this transformation:

[{n}^\prime_{\alpha} x^{\prime\alpha} = (S^{-1}){}_\alpha^\gamma n_\gamma S^\alpha_{\kappa} x^\kappa = \{ (S^{-1}){}_{\alpha}^\gamma S^\alpha_{\kappa} \} n_\gamma x^\kappa = \delta_{\kappa}^\gamma n_\gamma x^\kappa = n_\kappa x^\kappa. ]

This proves that the description of view-port cutting planes by points from these planes and normal covectors is invariant with respect to affine transformations.

To show how it works in practice, we shall now give a simple example of this procedure. Let us consider an affine transformation [{\bf S}] given for a point [{\bf x} = (x^1,x^2,x^3)] by

[{\bf S}\left[\matrix{ x^1\cr x^2\cr x^3}\right] = \left[\matrix{ 2x^1-3\cr x^2\cr x^3}\right]. ]

Let [\pi_+] be the half-space described by the point [{\bf p} = (1,0,0)] and the covector [{\bf n} = (1,1,0)] (see Fig. 1[link]), according to the inequality (23)[link]:

[x^1 + x^2 -1 \,\gt\,0. \eqno(26)]

In the 4-vector notation,

[{\bi x} = \left[\matrix{ 2x^1-3\cr x^2\cr x^3\cr 1}\right],\quad {\bi p} = \left[\matrix{ 1\cr 0\cr 0\cr 1}\right] \quad{\rm and}\quad {\bi S} = \left[\matrix{ 2&0&0&-3\cr 0&1&0&0\cr 0&0&1&0\cr 0&0&0&1}\right]. ]


[{\bi n} = \left[\matrix{ 1&1&0&-1}\right]. ]

To transform the covector [{\bi n}], we need to invert [{\bi S}] first:

[{{\bi S}^{-1}} = \left[\matrix{ \textstyle{1\over2}&0&0&{{3}\over{2}}\cr 0&1&0&0\cr 0&0&1&0\cr 0&0&0&1}\right]. ]

After the transformation by [{\bi S}], the half space [\pi_{+}^\prime] will be defined by the following 4-covector [{\bi n}^\prime]:

[{\bi n}^\prime = {\bi S^{-1}} {\bi n} = \left[\matrix{ \textstyle{1\over2}&1&0&\textstyle{1\over2}}\right]. ]

Observe that, from the fourth component of [{\bi n}], one can recover coordinates of points belonging to the transformed cutting plane (we need this to know where to anchor the normal covector [{\bf n}]). According to the formula (24)[link],

[-{\bf n}^\prime_i {\bf p}^{\prime i} = -p^1-p^2 = n_4 = \textstyle{1\over2}. ]

The above is satisfied in particular by

[{\bf p}^\prime = {\bf S p} = \left[\matrix{ -1\cr 0\cr 0}\right]. ]

The transformed [{\bf p}^\prime], [\pi_{+}^\prime] and [{\bf n}^\prime] are presented in the center panel of Fig. 1[link]. The lower panel shows the consequences of transforming [{\bf n}] incorrectly (that is as a contravariant vector instead of a covector).

[Figure 1]
Figure 1
Transformation of half-spaces (two-dimensional projections on the x1 x2 plane). Upper panel: half-space [\pi_+] and objects defining it; its normal covector [{\bf n}] and point [{\bf p}]. Center panel: transforming [{\bf n}] as a covector (CORRECT). Lower panel: transforming [{\bf n}] as a vector (WRONG, because the image of [{\bf n}] is no longer orthogonal to the image of [\pi]).

The above discussion is only an example of usage of covectors for defining planes. Another example, important in crystallography, is defining lattice planes by their Miller indices.

4.1.2. Spherical view-ports

In some cases, it is convenient to display objects located in the neighborhood of some point [{\bf p}]. Then, a natural choice for a view-port is a sphere centered at [{\bf p} = (p^1,p^2,p^3)], with a given radius r. In Cartesian coordinates, the condition for [{\bf x} = (x^1,x^2,x^3)] to belong to the spheri­cal view-port reads

[(x^1-p^1){}^2+(x^2-p^2){}^2+ (x^3-p^3){}^2\leq r^2]

or, in the Einstein notation,

[G_{ij} (x^i-p^i)(x^j-p^j) \leq r^2. \eqno(27)]

Here, the 3×3 second-order covariant tensor Gij is trivial, that is [ G_{ij} = \delta_{ij}]. The left-hand side of the definition of the sphere (27)[link] is a quadratic form in the contravariant variable [{\bf x}]. Hence, it can be encoded into a 4×4 covariant tensor, as in equation (18)[link]:

[{\bi G} = \left[\matrix{ 1 & 0 & 0 & -p^1\cr 0 & 1 & 0 & -p^2\cr 0 & 0 & 1& -p^3\cr - p^1 & -p^2 & -p^3 & (p^1){}^2+(p^2){}^2+(p^3){}^2-r^2}\right]. ]

Now the view-port can be defined as simply as:

[G_{\alpha\beta}x^\alpha x^\beta \leq 0. \eqno{(28)}]

The left-hand side of the view-port condition (28)[link] transforms as follows:

[G^\prime_{\alpha\beta}x^{\prime\alpha} x^{\prime\beta} = G_{\gamma\kappa}({ S}^{-1}){}_{\alpha}^\gamma ({ S}^{-1}){}_{\beta}^\kappa {S}^\alpha_{\mu}{S}^\beta_{\nu}x^\mu x^\nu, \eqno{(29)}]

where [[S^\alpha_{\mu}]] is an affine transformation given by equation (1)[link]. The transformed tensor [{\bi G}^\prime] defines the image of the sphere (27)[link] in the same manner as the original sphere is encoded in [{\bi G}]:

[G^\prime_{\alpha\beta}x^{\prime\alpha} x^{\prime\beta}\leq 0. \eqno{(30)}]

The sphere (27)[link] is expressed in the new coordinates by [[G_{\alpha\beta}^\prime]]:

[G_{\alpha\beta}^\prime = (S^{-1}){}^\gamma_{\alpha} (S^{-1}){}^\kappa_{\beta} G_{\gamma\kappa}. ]

Note that we have never used the fact that we are dealing with a sphere and not e.g. with an ellipsoid. This means that the above argument is valid for any quadratic surface.

4.1.3. Transformations of anisotropic atomic temperature factor

Let [{\bf y}], with crystallographic coordinates [[{\bf y}^i]], denote the equilibrium position of an atom. The measured atomic electron density [\rho_{\rm at} ({\bf y})] can be described (Giacovazzo et al., 1992[Giacovazzo, C., Monaco, H. L., Viterbo, D., Scordari, F., Gill, G., Zanotti, G. & Catti, M. (1992). Fundamentals of Crystallography. Oxford Science Publications.]) by the convolution of the probability distribution of the equilibrium position of the center of the atom, p, and of the atomic electron density relative to this position, [ \rho_{a}]:

[\rho_{\rm at} ({\bf y}) = \textstyle\int \rho_{a}({\bf y}-{\bf x}) p({\bf x}) \,{\rm d} {\bf x}. ]

The probability p is expressed in crystallographic coordinates relative to the center of the atom. In the first approximation of p, we consider only rigid-body thermal motions of an atom. These thermal motions result from many interactions. Therefore, from the central limit theorem, it follows that they can be well described by an anisotropic Gaussian distribution:

[p({\bf x}) = (2\pi){}^{-{{3}/{2}}}(\det {\bf U}){}^{-{{1}/{2}}} \exp [-\textstyle{1\over2} x^i{(U^{-1})}_{ij}x^j],\eqno(31)]

where [{\bf U} = [U^{ij}]] is the variance–covariance matrix, that is [ U^{ij} = \langle x^i x^j\rangle], where [ \langle x^i x^j\rangle] denotes mean values of xi xj. Since [{\bf U}] is expressed in coordinates relative to the center of the atom, clearly it does not change with translations (see also discussion in §3.3.1[link]). Under rotations, the tensor [{\bf U}] transforms as a contravariant tensor.

On the other hand, [{\bf U}^{-1}] is a covariant tensor and transforms according to (19)[link]. Note that the equation

[{\bf x}^T {\bf U}^{-1} {\bf x} = c\eqno(32)]

describes a quadratic surface of constant probability. Since we consider only localized atoms, the only allowed type of surface is an ellipsoid. Therefore, all eigenvalues of the matrix [(U-1)ij] must be positive, and so must the eigenvalues of the matrix [Uij].

The ellipsoids of constant probability, or vibrational ellipsoids, are often employed in the graphical description of thermal motions of atoms. The three-dimensional tensor [{\bf U}^{-1}] can be extended to the four-dimensional tensor [{\bi U}^{-1}] such that equation (32)[link] is preserved during the transformation. This is done as described in §3.3.1[link]. Namely, we extend [(U-1)ij] to [[(U^{-1})_{\alpha\beta}]] as follows:

[[(U^{-1})_{\alpha\beta}] = \left[\matrix{ & & & 0 \cr & {\bf U}^{-1} & & 0 \cr & & & 0 \cr 0 & 0 & 0 & 1 \cr }\right]\eqno(33)]

and transform under affine transformations [{\bf S} = ({\bf R},{\bf t})] given by (13)[link] according to (19)[link]. Namely, the resulting tensor [({\bi U}^{-1}){}^\prime] is

[({\bi U}^{-1}){}^\prime = \left[\matrix{ ({\bf U}^{-1}){}^\prime & - ({\bf U}^{-1}){}^\prime{\bf t}\cr - [({\bf U}^{-1}){}^\prime{\bf t}]{}^T & {\bf t}^T ({\bf U}^{-1}){}^\prime {\bf t}-c }\right],]

where [({\bi U}^{-1}){}^\prime = ({\bf R}^{-1}){}^T{{\bf U}^{-1}}{\bf R}^{-1}].

5. Discussion

The main objective of this paper is to summarize a formalism for efficient description of various tasks encountered in computational crystallography. The history of science shows that the right language is often important in the solution of a problem. The best known example is the derivation of Einstein's theory of relativity. The presented approach to describing coordinate system transformations will simplify both presentation and implementation of subjects such as ab initio phasing of macromolecules using non-crystallographic symmetry and application of the maximum-entropy principle to ensure positive definition of the atomic anisotropic temperature factors. This paper forms a foundation for designing object classes that will be a part of a versatile crystallographic library.


1Except for radial coordinate systems used in Bessel-function expansion, which will be treated elsewhere.


The authors are grateful to the referees for helpful suggestions. This research was supported by National Institute of Health grants GM 53163 and GM 62414.


First citationBienenstock, A. & Ewald, P. P. (1962). Acta Cryst. 15, 1253–1261. CrossRef CAS IUCr Journals Web of Science
First citationBradley, C. J. & Cracknell, A. P. (1972). The Mathematical Theory of Symmetry in Solids. Oxford: Clarendon Press.
First citationBricogne, G. (1993). In International Tables for Crystallography, Vol. B. Dordrecht: Kluwer Academic Publishers.
First citationEinstein, A. (1916). Ann. Phys. (Leipzig), 49, 769. CrossRef
First citationGiacovazzo, C., Monaco, H. L., Viterbo, D., Scordari, F., Gill, G., Zanotti, G. & Catti, M. (1992). Fundamentals of Crystallography. Oxford Science Publications.
First citationHahn, T. (1995). Editor. International Tables for Crystallography, Vol A. Dordrecht: Kluwer Academic Publishers.
First citationHall, S. (1981). Acta Cryst. A37, 517–525. CrossRef CAS IUCr Journals Web of Science
First citationPatterson, A. (1959). In International Tables for X-ray Crystallography, Vol. II. Birmingham: Kynoch Press.
First citationRowicka, M., Kudlicki, A. & Otwinowski, Z. (2003). Acta Cryst. A59, 172–182. Web of Science CrossRef CAS IUCr Journals
First citationSands, D. (1982). Vectors and Tensors in Crystallography. Reading, MA: Addison-Wesley.
First citationSeitz, F. (1936). Ann. Math. 37, 17–28.  CrossRef
First citationTen Eyck, L. (1973). Acta Cryst. A29, 183–191. CrossRef IUCr Journals Web of Science
First citationTrueblood, K. N., Bürgi, H.-B., Burzlaff, H., Dunitz, J. D., Gramaccioli, C. M., Schulz, H. H., Shmueli, U. & Abrahams, S. C. (1996). Acta Cryst. A52, 770–781. CrossRef CAS Web of Science IUCr Journals

© International Union of Crystallography. Prior permission is not required to reproduce short quotations, tables and figures from this article, provided the original authors and source are cited. For more information, click here.

ISSN: 2053-2733
Follow Acta Cryst. A
Sign up for e-alerts
Follow Acta Cryst. on Twitter
Follow us on facebook
Sign up for RSS feeds