<<

research papers

Acta Crystallographica Section A Foundations of Coordinate transformations in modern Crystallography crystallographic computing ISSN 0108-7673 Malgorzata Rowicka, Andrzej Kudlicki, Jan Zelinka and Zbyszek Otwinowski* Received 7 January 2004 Accepted 13 July 2004 Department of Biochemistry, UT Southwestern Medical Center at Dallas, 5323 Harry Hines Boulevard, Dallas, TX 75390-9038, USA. Correspondence e-mail: [email protected]

A review of 4 4-matrix notation and of formalism focused on  # 2004 International Union of Crystallography crystallographic applications is presented. A discussion of examples shows how Printed in Great Britain ± all rights reserved this notation simpli®es tasks encountered in crystallographic computing.

1. Introduction presenting a consistent representation for the basic variable types encountered in crystallography ( 2 and 3). Later, we This paper presents a summary of tensor formalism, which is xx very important in crystallography, and especially in crystal- discuss more complex applications and demonstrate how this lographic computations. Most of the material described here is notation works. This will include examples of de®ning view- well known but was published in very old books and papers ports for graphics display and transforming the anisotropic (Einstein, 1916; Seitz, 1936; Bienenstock & Ewald, 1962; temperature factor. These rules apply to both real and Bradley & Cracknell, 1972; Hall, 1981 etc.). We feel that it is reciprocal space, including calculation of derivatives. high time to recall this formalism in a review focused on its application to crystallographic computing and adaptation to 2. Crystallographic 4-vector notation high-level programming languages. Crystallography deals with objects de®ned in various In this section, we present the 4-vector notation, which proves coordinate systems, e.g. the fractional (used very useful for changing coordinate systems in crystallography. for data or symmetry operators), the grid coordinate system For the purposes of this section, it is enough to distinguish (in which computations are done), the Protein Data Bank between vectors and covectors. A more detailed discussion of covariant and contravariant quantities will be presented in 3. (PDB) coordinate system, or the graphics coordinate system x (used to display data on a computer screen). Moreover, these objects may have different transformation properties. 2.1. Real-space 4-vector notation Distinguishing mathematical objects with respect to their The real-space 4-vector notation is well known in crystal- transformation properties is very important when writing lography (Hahn, 1995; Hall, 1981) as well as in general crystallographic software. In particular, keeping track of computing (Bradley & Cracknell, 1972; Seitz, 1936). coordinate systems and transformation properties of variables Throughout the paper, we will write 3-vectors and 3-matrices allows for more ef®cient and less error-prone programming. in bold type and 4-vectors and 4-matrices in bold-italic type. The importance of consistency in notation for further Let development of the ®eld has been recognized by the IUCr by x appointing the Commission on Crystallographic Nomen- x ; ˆ 1 clature. In one of their reports (Trueblood et al., 1996), a  uniform notation for atomic displacement parameters is where x is a real-space vector. Let Sg denote a crystallographic proposed, including distinguishing between contravariant and symmetry . Crystallographic symmetry operators are covariant quantities. The present article follows this recom- isometries. They can be represented as a superposition of a mendation by providing a review of a uniform notation for R (with det R 1) and a non-primitive translation g g ˆÆ coordinate changes for all crystallographic quantities. by vector tg. Then, the symmetry operator Sg transforms a A natural way of coupling program variables to their crys- vector x in the real space as follows: tallographic properties is the object-oriented programming S x R x t : style. With its use, one can implicitly de®ne operations allowed g †ˆ g ‡ g for each type of variable. Operations explicitly de®ned for one One can represent the transformation S as a 4 4 matrix S g  g coordinate system may be implicitly extended to other cases as follows: by the compiler. This is especially important when new func- tionality is added to an already existing application. In the Rg tg present paper, we recall a mathematical formalism, which can Sg 2 3: ˆ be naturally used for de®ning classes of basic objects 6 000 17 encountered in crystallographic calculations. We start by 6 7 4 5

542 doi: 10.1107/S0108767304017398 Acta Cryst. (2004). A60, 542±549 research papers

In this notation, the action of Sg is represented by multi- covectors will follow in the next section. As in the real-space plication only: case, 3-covectors can be extended to 4-covectors. Unlike in the real space, the last entry in such a 4-covector is generally x different from 1: Rg tg y Rgx tg Sgx 2 32 3 ‡ : 1 ˆ z ˆ 1 †  h  hkl : 6 000 176 1 7 ˆ 6 76 7 4 54 5 ÂÃÂà The composition of two isometries is traditionally described The symbol  denotes a phase angle associated with the vector by a somewhat complicated formula h (calculations involving  will be performed modulo 1). The meaning of the symbol h  is the following: S S x R R x R t t : ‰ Š g1 g2 g1 g2 g1 g2 g1 ˆ ‡ ‡ F h  : exp 2i F h : 3 In the 4-vector notation, a composition of isometry transfor- ˆ † † † mations is expressed as a multiplication of their corresponding Note that this de®nitionÁÂà should be changed if a different 4 4 matrices:  Fourier transform de®nition is used. In this setting, the action S x S S x of a symmetry operator Sg (which corresponds to the action of g1g2 g1 g2 1 ˆ  S in the real space) in the reciprocal space can be described x R R x R t t g g1 g2 g1 g2 g1 S S ‡ ‡ : simply by multiplying a general 4-covector by the matrix of Sg, ˆ g1 g2 1 ˆ 1  as introduced by (1): A consequence of this equation is another convenient feature h  S hR h t  ; 4 of this notation: g ˆ g Á g ‡ † 1 ÂÃÂà S 1 S ; where h tg denotes the usual . Note that, owing g ˆ g Á to the special property of matrix Rg [see equation (2)], one can where 1 T use R instead of R in equation (5). However, this cannot g † g be done for non-orthogonal Rg (see discussion in 3). The 1 1 x 1 Rg Rg tg symmetry operator Sg in the reciprocal space is represented by S 2 † † 3: g ˆ the same matrix as in the real space (transposition not 6 000 1 7 needed). 6 7 4 1 5 Let us show how our notation works with the Fourier Note that tg 1 Rg tg and ˆ † transform. The symmetry operator Sg acting on vectors in the 1 T Rg Rg: 2 real space induces a corresponding operator Sgà acting in the † ˆ † reciprocal space on the Fourier transforms of the real-space Moreover, functions. Let SgÃF h denote the Fourier transform of a 1 † det S det R ; function f S x . Then (Bricogne, 1993; Rowicka et al., 2003) g ˆ g g † which allows us to use the determinant of S in place of the SgÃF h exp 2ih tg F hRg : 5 determinant of R, for example when distinguishing between †ˆ Á † † † rotations and re¯ections. Using (5) and (3), we can compute

SÃF h  exp 2i SÃF h 2.2. Reciprocal-space 4-vector notation g ˆ † g † exp 2i exp 2ih t F hR : The convention presented in this subsection has been ÁÂÈ † Á g† g† partially described by Bienenstock & Ewald (1962) and was subsequently used by Ten Eyck (1973). However, they did not Furthermore, distinguish between vectors and covectors, and consequently exp 2i exp 2ih t F hR F hR h t  : the transposed form of the symmetry operator had to be used † Á g† g†ˆ g Á g ‡ in the reciprocal space. We present a means of keeping the By (4), ÁÂà same form of the symmetry operator in both real and reci- procal space. The data in the real space, f x , are related to the F hR h t  F h  S : g Á g ‡ g reciprocal-space data F h by the Fourier transform† de®ned by ˆ † Thus we haveÁÂà shown that in our formalismÁÂà the description of F h : f x exp 2i h x : † ˆ x † Á † the interaction between crystallographic symmetry and the Fourier transform has the form In the reciprocal space, weP will use a 4-vector notation as well.

Vectors from reciprocal space transform differently to real- SgÃF h  F h  Sg ; space vectors. To distinguish them, we will call reciprocal- ˆ space vectors (and any other vectors transforming in the same which is better suitedÁÂà for descriptionÁÂà of the composition of way) covectors and we will write vectors as columns and multiple af®ne transformations than the traditionally used covectors as rows. A detailed discussion of vectors and equation (5).

Acta Cryst. (2004). A60, 542±549 Rowicka et al.  Coordinate transformations in crystallographic computing 543 research papers

Table 1 Scalars, vectors, covectors. In the ®rst 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 speci®c physical quantities related to crystallography. Scalars Vectors Covectors x1 i 2 i Notation a x x ai x h hi a h1 h2 h3 ˆ ˆ 2 x3 3 ˆ ˆ Âà 4 5 i i j j Transformation properties Contravariant, i.e. x0 f x Covariant, i.e. x0 h x ˆ j i ˆ i j Examples Physical invariants Real-space coordinates xyz (fractional, Reciprocal-space coordinates (re¯ection grid, PDB etc) indices hkl) Numbers Derivatives of a scalar with respect to Derivatives of a scalar with respect to reciprocal-space coordinates real-space coordinates Crystallographic quantities  (electron density) @F=@h @=@x @=@y @=@z F (structure factor) @F=@k I (intensity) 2 @F=@l 3 Âà 4 5

Table 2 Second-order . In the ®rst row, we describe the tensor type, in the following rows, we provide examples.

ij Tensors T Tensors Tij

ij i j kl k l Transformation properties T0 f f T T0 h h T ˆ k l ij ˆ i j kl ij 1 Crystallographic examples @=@B @=@ B ij ij ij 1 † 1 B ; U [atomic anisotropic displacement tensor (crystal B ij; U ij [inverse of atomic anisotropic displacement system)] tensor]† † ij g ( in the reciprocal space) gij (metric tensor in the real space)

3. Covariant and contravariant quantities such that the coordinate change (6) is invertible. Then, the Vectors and tensors in crystallography were quite extensively relationship between the differentials of the new coordinates dealt with by Patterson (1959) and Sands (1982). In this and the differentials of the old ones is the following: section, we outline the theory of transformation ®rst, and then 3 i i j we show how to extend and apply that theory to the 4-vector dx0 fj dx ; 7 ˆ j 1 † notation. ˆ P where f i @f =@xj. From now on, we shall use the Einstein j ˆ i 3.1. Scalars, vectors and covectors convention (Einstein, 1916): if an index appears twice in an expression, once as a subscript and once as a Depending on their transformation properties, objects superscript, a summation over this index is thereby implied encountered in crystallography can be classi®ed as scalars, and the summation sign is suppressed. For example, within this vectors, covectors, covariant or contravariant tensors etc. (see convention, equation (7) reads Tables 1 and 2). By de®nition, scalars are quantities that remain invariant i i j dx0 f dx ; 8 during coordinate changes. ˆ j † In the previous section, we were distinguishing between where the implicit sum is over j 1; 2; 3. The repeating vectors and covectors with no thorough explanation, now we indices are often called dummy indicesˆ . In what follows, we will discuss this subject in more detail. will use the Einstein notation extensively, instead of using The difference between a vector and a covector is in how transposed matrices etc. they behave during coordinate changes. Let xi denote coor- The components of a vector are transformed in the same dinates of a vector x (such as a position vector of an atom), way as differentials of coordinates [see equation (8)]. By expressed in a certain (for example, in the crystal- de®nition, such quantities are called contravariant and are lographic direct lattice basis a , a and a : x 1 2 3 denoted by superscripts. They transform as basis vectors of the x1a x2a x3a ). Let us consider a coordinate change fromˆ 1 2 3 dual base, that is in crystallography as the reciprocal-lattice the coordinates‡ ‡ xi i 1; 2; 3 to the coordinates x i, given by 0 basis vectors a1, a2 and a3. functions f i, ˆ † One can compute the derivatives a @a=@x of a scalar a i ˆ i i i 1 2 3 with respect to the new and old coordinates. Their relationship x0 f x ; x ; x ; 6 ˆ † † is the following:

544 Rowicka et al.  Coordinate transformations in crystallographic computing Acta Cryst. (2004). A60, 542±549 research papers

j a0 a h ; 9 coordinates. In this paper, we show that a good choice is to i ˆ j i † j i assume where hi is the inverse of the matrix fj : Quantities‰ Š transformed as derivatives‰ Š with respect to @f @f @f @f i i ; i ; i ; 0 ; for i 1; 2; 3; coordinates are called covariant. Vectors whose components @x ˆ @x1 @x2 @x3 ˆ  transform in the same way are called covectors. In crystal- lography, covariant quantities are re¯ection indices hkl. and

Covectors transform as the basis vectors, in crystallography as @f4 4i: the direct-lattice basis vectors a1, a2 and a3. It is now obvious @xi ˆ that derivatives of a scalar with respect to components of a The Kronecker symbol  is de®ned as follows: vector form a covector. jk

Crystallographic examples and transformation properties of j 1 for j k   jk ˆ vectors and covectors are provided in Table 1. jk ˆ k ˆ ˆ 0 for j k.  6ˆ 3.2. Tensors 3.3.1. Affine transformations. Most coordinate systems Let d be the dimensionality of the space. Objects consisting used in crystallography are related by af®ne transformations.1 of dN components that transform as products of k covariant By af®ne transformation, we understand a transformation S quantities and l contravariant quantities, where k l N, are such that, for any 3-vector x, called k-covariant l-contravariant Nth-order‡ tensors.ˆ In general, many quantities may be viewed as tensors: scalars are S x Rx t: tensors of order zero, vectors are contravariant tensors of †ˆ ‡ order one, while covectors are covariant ®rst-order tensors. In the 4-vector notation, such an S is given by Usually, the term tensor is applied only to tensors of order two or higher. Rt ij S S 2 3: 13 For example, a second-order contravariant tensor T would ˆ‰ Šˆ † be transformed as 6 00017 6 7 ij i j kl T0 f f T : 10 4 5 ˆ k l † Here, in contrast to the crystallographic symmetry operator given by equation (1), the matrix R is a general invertible The second-order covariant tensor Tij transforms as k l matrix. In particular, af®ne transformations may not preserve T0 h h T : 11 ij ˆ i j kl † (i.e. be non-orthogonal) or they may not preserve i angles (i.e. be non-conformal). The second-order tensor Tj with both covariant and contra- variant components would transform as The 4-vector notation allows simpli®cation of af®ne trans- formations of vectors and covectors. For a 4-vector x, its i i l k T0 h f T : 12 j ˆ k j l † transformed coordinates x0 are related to the original coor-

Crystallographic examples and transformation properties of dinates x by second-order covariant and contravariant tensors are x0 S x ; 14 provided in Table 2. ˆ † where S is given by equation (13). In the matrix form, 3.3. Transformation of coordinates in 4-vector notation In our notation, the fourth component of a vector is of a Rtx Rx t x0 x0 Sx 2 3 ‡ : different nature to the other ones, in particular, in the real ˆ ˆ 1 ˆ 1 ˆ 1   space it always equals 1. Therefore, in the real space, the only 6 00017 6 7 coordinate transformations that are allowed are such that 4 5 preserve the fourth component. In the notation introduced in On the other hand, a 4-covector h transforms as follows: the previous section, this condition restricts the form of the 1  h0 S h ; 15 coordinate changes to ˆ †  † 1 1 2 3 where x0 f1 x ; x ; x ; 1 2 ˆ 1 2 3 † x0 f2 x ; x ; x ; 1 3 ˆ 1 2 3 † 1 1 x0 f x ; x ; x ; 1 1 1 R R t 3 S S 2 3: 16 4 ˆ † ˆ‰ † Šˆ † x0 1: ˆ 6 000 17 6 7 We need to introduce a convention to de®ne a derivative with 4 5 In the matrix form, the transformation of a covector h reads respect to this fourth coordinate. It is crucial that, with the assumed convention, the transformation properties of the 1 Except for radial coordinate systems used in Bessel-function expansion, fourth component are compatible with those of the ®rst three which will be treated elsewhere.

Acta Cryst. (2004). A60, 542±549 Rowicka et al.  Coordinate transformations in crystallographic computing 545 research papers

image of p, the center of the surface related to the original 1 1 form . 1 R R t h0 hS h  2 3 G ˆ ˆ In some cases, the quantity of interest in (17) is de®ned by 6 7 the inverse of a given matrix. Then we can rewrite (17) with ÂÃ6 000 17 1 6 7 H : G : 1 4 1 5 ˆ hR hR t  T 1 ˆ ‡ x p H x p c: h0 0 : † †ˆ ˆ Âà In the 4-vector notation, Observe that, duringÂà an af®ne transformation of a covector, T 1 1 the fourth component of the transformed covector changes, in x : x H x H x x H † ˆ ˆ † contrast to the case of vectors. The reason is that, in the and covariant (reciprocal) space, the translational part of S is not e 1 1 realized as translation of coordinates but as phase shift, in the 1 1 H H p H H 1 T T 1 : sense of equations (3), (4) and (5). ˆ‰ † Šˆ H p p H p c Many objects encountered in crystallography can be  † described by quadratic forms (cf. Table 2). Af®ne transfor- It follows that mations of symmetric tensors corresponding to quadratic H 1 ppT 1 p H H c c : forms can also be simpli®ed by the 4-vector notation. A ˆ‰ Šˆ 1 pT 1 quadratic form is de®ned by  c c G 1 Observe that H is a contravariant tensor, whereas H is a x : xT Gx G xixj; G † ˆ ˆ ij covariant one. One can also de®ne a quadratic form for a covector h by where G is a symmetric matrix. Provided that x is a contra- F variant vector, the matrix G transforms as a 2-order covariant h : hFhT : tensor. In order to perform af®ne transformations of tensors F † ˆ conveniently, we switch to the 4-vector notation. This will The corresponding matrix F transforms as a 2-order contra- involve extending 3 3 tensors to 4 4 tensors, compatible variant tensor. However, in this case, there will be no quad- with the 4-vectors and 4-covectors introduced in 2.1 and 2.2, ratic surfaces centered at q 0; 0; 0 . The intuitive 6ˆ ‰ Š respectively. Quadratic forms are commonlyxx applied to explanation is the same as in the case of the af®nely trans- describing quadratic surfaces. In three , the general formed covector: in the covariant space (such as the reciprocal equation of a quadratic surface centered at p is given by space, space of normal covectors or space of derivatives), translation of the coordinates is not possible. Therefore, the x p T G x p c; 17 † †ˆ † centers of the quadratic surfaces in the covariant space do not where c is a real number. change during af®ne transformations. For simplicity, we We propose a simpler form of the general quadratic surface consider in the reciprocal space only quadratic surfaces that equation: are centered at 0 : 0; 0; 0 . This leads to the following de®- nition of the symbolˆ‰F in theŠ 4-vector notation: xT Gx 0; ˆ F0T where F : ˆ 0 0  x G Gp x and G T : 18 The symbol F encoding the form transforms as a contra- ˆ 1 ˆ Gp pT Gp c † F   † variant second-order four-dimensional tensor Let S be an af®ne transformation given by (13). Then G will   F0 S S F : 20 transform as follows: ˆ †

1 1 In matrix notation, G 0 S S  G : 19 ˆ † † † T F0 0 Using formula (19), one can compute that G0 has the same F0 ; ˆ 0 0 form as G. Namely,  where G0 G0p0 G0 T T ; T ˆ G0p0 p0 G0p0 c F0 RFR :  † † ˆ where

1 T 1 G0 R GR and p0 Rp t S p : ˆ † ˆ ‡ ˆ † As expected, the 3 3 tensor G transforms as a second-order 4. Examples covariant tensor. Observe also that the transformed quadratic Now we will show several examples of our notation facilitating form 0 corresponds to a surface centered at p0, that is the issues encountered in practice. G

546 Rowicka et al.  Coordinate transformations in crystallographic computing Acta Cryst. (2004). A60, 542±549 research papers

4.1. 3D graphics view-port: definition and transformations to the view-port Ä when it belongs to all half-spaces de®ning In graphical rendering programs, one has to de®ne a view- it, port, that is a region of considered space that is displayed at a 6 given moment. Below we discuss two widely used types of Ä i : 21 ‡ ˆ i 1 † view-ports and show how easily one can perform af®ne (i.e. in \ˆ general not orthogonal) transformation of them using our The condition for a point x x1; x2; x3 to belong to a posi- notation. tive half-space  can be describedˆ by† four numbers, a, b, c 4.1.1. Polyhedral view-ports. The most commonly used and d: ‡ type of view-port has the shape of a polyhedron, i.e. a volume ax1 bx2 cx3 d > 0: 22 delimited by a number of polygons. An example of a poly- ‡ ‡ ‡ † hedron speci®c to crystallography is the asymmetric unit. A In particular, one can describe such a half-space by giving a convenient way of de®ning a polyhedral view-port is by listing point p with coordinates p1; p2; p3 , belonging to the cutting a number of (usually six) cutting planes, with distinguishable plane, and providing three numbers†a, b and c that specify the sides. In fact, this is how the standard asymmetric units are orientation of the plane. Then, de®ned in International Tables for Crystallography (Hahn, ax1 bx2 cx3 ap1 bp2 cp3 > 0: 23 1995). For a plane , its positive side will be identi®ed with the ‡ ‡ † half-space  , which contains the view-port. A point belongs ‡ From the above equation, it follows that a, b, c transform as components of a covector. Let us denote this three-dimen- sional covector by n. Observe that n is normal to the cutting plane  and it points towards the inside of the view-port. We will now switch to 4-vector notation and demonstrate how easily af®ne transformations of the thus de®ned view-port can be performed within the 4-vector formalism. In this notation, n is a 4-covector: n abc ap1 bp2 cp3 : 24 ˆ † † Now, the conditionÂà for a 4-vector x x1 x2 x 2 3 ˆ x3 6 1 7 6 7 4 5 to belong to the half-space  reads ‡ n x > 0; 25 † where the implicit summation is over 1; 2; 3; 4. Let us transform the coordinates by an af®ne transformationˆ S.The

transformed coordinates x0 are related to the original coor- dinates x according to equation (14), the coordinates of n transform as in equation (15). Let us show that condition (25) is preserved during this transformation:

1  1    n0 x0 S n S x S S n x  n x n x : ˆ †  ˆf †  g ˆ  ˆ  This proves that the description of view-port cutting planes by points from these planes and normal covectors is invariant with respect to af®ne transformations. To show how it works in practice, we shall now give a simple example of this procedure. Let us consider an af®ne trans- formation S given for a point x x1; x2; x3 by ˆ † x1 2x1 3 S x2 x2 : Figure 1 2 x3 3 ˆ 2 x3 3 Transformation of half-spaces (two-dimensional projections on the x1x2 4 5 4 5 plane). Upper panel: half-space  and objects de®ning it; its normal Let  be the half-space described by the point p 1; 0; 0 covector n and point p. Center panel:‡ transforming n as a covector and the‡ covector n 1; 1; 0 (see Fig. 1), accordingˆ to the† (CORRECT). Lower panel: transforming n as a vector (WRONG, ˆ † because the image of n is no longer orthogonal to the image of ). inequality (23):

Acta Cryst. (2004). A60, 542±549 Rowicka et al.  Coordinate transformations in crystallographic computing 547 research papers

x1 x2 1 > 0: 26 100 p1 ‡ † 010 p2 In the 4-vector notation, G 2 3: ˆ 001 p3 2x1 3 1 200 3 6 p1 p2 p3 p1 2 p2 2 p3 2 r2 7 6 † ‡ † ‡ † 7 x2 0 010 0 4 5 x 2 3; p 2 3 and S 2 3: Now the view-port can be de®ned as simply as: ˆ x3 ˆ 0 ˆ 001 0

6 1 7 6 1 7 6 000 17 G x x 0: 28 6 7 6 7 6 7  † 4 5 4 5 4 5 Moreover, The left-hand side of the view-port condition (28) transforms as follows: n 110 1 : ˆ 1 1    G 0 x0 x0 G  S S SS x x ; 29 To transform the covectorÂÃn, we need to invert S ®rst: ˆ † † †

where S is an af®ne transformation given by equation (1). 1 3 ‰ Š 2 002 The transformed tensor G0 de®nes the image of the sphere 1 0100 S : (27) in the same manner as the original sphere is encoded in G: 2 00103 ˆ 6 00017 G 0 x0 x0 0: 30 6 7  † 4 5 The sphere (27) is expressed in the new coordinates by G0 : After the transformation by S, the half space 0 will be ‡ ‰ Š 1 1  de®ned by the following 4-covector n0: G0 S S G : ˆ † †  1 1 1 n0 S n 10 : ˆ ˆ 2 2 Note that we have never used the fact that we are dealing with Observe that, from the fourthÂà component of n, one can a sphere and not e.g. with an ellipsoid. This means that the recover coordinates of points belonging to the transformed above argument is valid for any quadratic surface. 4.1.3. Transformations of anisotropic atomic temperature cutting plane (we need this to know where to anchor the i normal covector n). According to the formula (24), factor.Lety, with crystallographic coordinates y , denote the equilibrium position of an atom. The measured‰ Š atomic elec- i 1 2 1 n0p0 p p n : tron density  y can be described (Giacovazzo et al., 1992) i ˆ ˆ 4 ˆ 2 at by the convolution † of the probability distribution of the The above is satis®ed in particular by equilibrium position of the center of the atom, p, and of the

1 atomic electron density relative to this position, a: p0 Sp 0 :  y  y x p x dx: ˆ ˆ 2 0 3 at †ˆ a † † 4 5 The probability p is expressedR in crystallographic coordinates The transformed p0, 0 and n0 are presented in the center relative to the center of the atom. In the ®rst approximation of ‡ panel of Fig. 1. The lower panel shows the consequences of p, we consider only rigid-body thermal motions of an atom. transforming n incorrectly (that is as a contravariant vector These thermal motions result from many interactions. There- instead of a covector). fore, from the central limit theorem, it follows that they can be The above discussion is only an example of usage of well described by an anisotropic Gaussian distribution: covectors for de®ning planes. Another example, important in 3=2 1=2 1 i 1 j p x 2 det U exp x U x ; 31 crystallography, is de®ning lattice planes by their Miller †ˆ † † ‰ 2 †ij Š † indices. where U Uij is the variance±covariance matrix, that is 4.1.2. Spherical view-ports. In some cases, it is convenient Uij xixjˆ‰, whereŠ xixj denotes mean values of xixj. Since U to display objects located in the neighborhood of some point is expressedˆh i in coordinatesh i relative to the center of the atom, p. Then, a natural choice for a view-port is a sphere centered clearly it does not change with translations (see also discussion 1 2 3 at p p ; p ; p , with a given radius r. In Cartesian coordi- in 3.3.1). Under rotations, the tensor U transforms as a nates,ˆ the condition† for x x1; x2; x3 to belong to the x ˆ † contravariant tensor. spherical view-port reads 1 On the other hand, U is a covariant tensor and transforms x1 p1 2 x2 p2 2 x3 p3 2 r2 according to (19). Note that the equation † ‡ † ‡ †  T 1 x U x c 32 or, in the Einstein notation, ˆ † G xi pi xj pj r2: 27 describes a quadratic surface of constant probability. Since we ij † † † consider only localized atoms, the only allowed type of surface 1 Here, the 3 3 second-order covariant tensor G is trivial, is an ellipsoid. Therefore, all eigenvalues of the matrix U  ij ‰ †ijŠ that is Gij ij. The left-hand side of the de®nition of the must be positive, and so must the eigenvalues of the sphere (27)ˆ is a quadratic form in the contravariant variable x. matrix Uij . Hence, it can be encoded into a 4 4 covariant tensor, as in The ellipsoids‰ Š of constant probability, or vibrational ellip- equation (18):  soids, are often employed in the graphical description of

548 Rowicka et al.  Coordinate transformations in crystallographic computing Acta Cryst. (2004). A60, 542±549 research papers

1 thermal motions of atoms. The three-dimensional tensor U temperature factors. This paper forms a foundation for 1 can be extended to the four-dimensional tensor U such that designing object classes that will be a part of a versatile equation (32) is preserved during the transformation. This is crystallographic library. 1 done as described in 3.3.1. Namely, we extend U ij to 1 x ‰ † Š U as follows: ‰ † Š The authors are grateful to the referees for helpful 0 suggestions. This research was supported by National Institute 1 1 U 0 of Health grants GM 53163 and GM 62414. U 2 3 33 ‰ † Šˆ 0 † 6 00017 6 7 4 5 and transform under af®ne transformations S R; t given ˆ † 1 References by (13) according to (19). Namely, the resulting tensor U 0 is † Bienenstock, A. & Ewald, P. P. (1962). Acta Cryst. 15, 1253±1261. Bradley, C. J. & Cracknell, A. P. (1972). The Mathematical Theory of 1 1 1 U 0 U 0t Symmetry in Solids. Oxford: Clarendon Press. U 0 1† T T 1 † ; Bricogne, G. (1993). In International Tables for Crystallography, Vol. † ˆ U 0t t U 0t c ‰ † Š † B. Dordrecht: Kluwer Academic Publishers. 1 1 T 1 1 where U 0 R U R . Einstein, A. (1916). Ann. Phys. (Leipzig), 49, 769. † ˆ † Giacovazzo, C., Monaco, H. L., Viterbo, D., Scordari, F., Gill, G., Zanotti, G. & Catti, M. (1992). Fundamentals of Crystallography. 5. Discussion Oxford Science Publications. Hahn, T. (1995). Editor. International Tables for Crystallography,Vol The main objective of this paper is to summarize a formalism A. Dordrecht: Kluwer Academic Publishers. for ef®cient description of various tasks encountered in Hall, S. (1981). Acta Cryst. A37, 517±525. computational crystallography. The history of science shows Patterson, A. (1959). In International Tables for X-ray Crystal- lography, Vol. II. Birmingham: Kynoch Press. that the right language is often important in the solution of Rowicka, M., Kudlicki, A. & Otwinowski, Z. (2003). Acta Cryst. A59, a problem. The best known example is the derivation of 172±182. Einstein's theory of relativity. The presented approach to Sands, D. (1982). Vectors and Tensors in Crystallography. Reading, describing coordinate system transformations will simplify MA: Addison-Wesley. both presentation and implementation of subjects such as ab Seitz, F. (1936). Ann. Math. 37, 17±28. Ten Eyck, L. (1973). Acta Cryst. A29, 183±191. initio phasing of macromolecules using non-crystallographic Trueblood, K. N., BuÈrgi, H.-B., Burzlaff, H., Dunitz, J. D., symmetry and application of the maximum-entropy principle Gramaccioli, C. M., Schulz, H. H., Shmueli, U. & Abrahams, S. C. to ensure positive de®nition of the atomic anisotropic (1996). Acta Cryst. A52, 770±781.

Acta Cryst. (2004). A60, 542±549 Rowicka et al.  Coordinate transformations in crystallographic computing 549