Geometry and Space Groups - Laboratory of Molecular Biology Cooper... · Geometry and Space Groups...

38
Geometry and Space Groups [email protected] ECACOMSIG school 2013

Transcript of Geometry and Space Groups - Laboratory of Molecular Biology Cooper... · Geometry and Space Groups...

Page 1: Geometry and Space Groups - Laboratory of Molecular Biology Cooper... · Geometry and Space Groups richard.cooper@chem.ox.ac.uk ECACOMSIG school 2013 . ... uc_sym_mat3 const & reciprocal_metrical_matrix

Geometry and Space Groups

[email protected]

ECACOMSIG school 2013

Page 2: Geometry and Space Groups - Laboratory of Molecular Biology Cooper... · Geometry and Space Groups richard.cooper@chem.ox.ac.uk ECACOMSIG school 2013 . ... uc_sym_mat3 const & reciprocal_metrical_matrix

What will we learn to do?

• Convert crystal data to orthogonal coordinates

• Compute geometry in crystallographic coordinate systems

• Change coordinate systems (abc)

• Change coordinates (xyz)

• Change reflection indices (hkl / MTZ)

Page 3: Geometry and Space Groups - Laboratory of Molecular Biology Cooper... · Geometry and Space Groups richard.cooper@chem.ox.ac.uk ECACOMSIG school 2013 . ... uc_sym_mat3 const & reciprocal_metrical_matrix

Libraries (e.g. cctbx)

uc_sym_mat3 const & metrical_matrix () const

Access to metrical matrix.

uc_sym_mat3 const & reciprocal_metrical_matrix () const Access to reciprocal metrical matrix

uc_mat3 const & fractionalization_matrix () const

Matrix for the conversion of cartesian to fractional coordinates.

uc_mat3 const & orthogonalization_matrix () const

Matrix for the conversion of fractional to cartesian coordinates.

FloatType distance (fractional< FloatType > const &site_frac_1, fractional< FloatType > const &site_frac_2) const

uc_mat3 matrix_cart (sgtbx::rot_mx const &rot_mx) const unit_cell change_basis (sgtbx::rot_mx const &c_inv_r) const unit_cell change_basis (sgtbx::change_of_basis_op const &cb_op) const

Transformation (change-of-basis) of unit cell parameters.

Page 4: Geometry and Space Groups - Laboratory of Molecular Biology Cooper... · Geometry and Space Groups richard.cooper@chem.ox.ac.uk ECACOMSIG school 2013 . ... uc_sym_mat3 const & reciprocal_metrical_matrix

Bibliography / Further reading

• International Tables Volume A: Space-group symmetry (IUCr)

• IUCr Teaching Pamphlet #22: Matrices, mappings, and crytsallographic symmetry, Hans Wondratschek (IUCr, 1997); iucr.org/education/pamphlets/22

• Fundamentals of Crystallography 3rd ed., edited by

C. Giacovazzo (IUCr, 2006)

• Computing Methods in Crystallography, John Rollett (Pergamon Press, 1965)

Page 5: Geometry and Space Groups - Laboratory of Molecular Biology Cooper... · Geometry and Space Groups richard.cooper@chem.ox.ac.uk ECACOMSIG school 2013 . ... uc_sym_mat3 const & reciprocal_metrical_matrix

Notation

Very generally:

x italic lower case a scalar

a bold lower case a vector

M bold upper case a matrix

Page 6: Geometry and Space Groups - Laboratory of Molecular Biology Cooper... · Geometry and Space Groups richard.cooper@chem.ox.ac.uk ECACOMSIG school 2013 . ... uc_sym_mat3 const & reciprocal_metrical_matrix

COORDINATE SYSTEMS Orthogonalization

Page 7: Geometry and Space Groups - Laboratory of Molecular Biology Cooper... · Geometry and Space Groups richard.cooper@chem.ox.ac.uk ECACOMSIG school 2013 . ... uc_sym_mat3 const & reciprocal_metrical_matrix

Why orthogonalize?

• Compare two structures across a phase transition, or that have been published in different non-conventional settings.

• Relate macroscopic orthogonally described properties (e.g. elasticity, piezoelectricity, etc.) to the crystallographic coordinate system.

• Put part of a crystal structure into PDB format.

Page 8: Geometry and Space Groups - Laboratory of Molecular Biology Cooper... · Geometry and Space Groups richard.cooper@chem.ox.ac.uk ECACOMSIG school 2013 . ... uc_sym_mat3 const & reciprocal_metrical_matrix

Representing coordinates

• Crystallography typically uses fractional, non-Cartesian co-ordinates

– Good for symmetry and diffraction formulae

– Bad for geometrical calculation (distance, etc.)

Page 9: Geometry and Space Groups - Laboratory of Molecular Biology Cooper... · Geometry and Space Groups richard.cooper@chem.ox.ac.uk ECACOMSIG school 2013 . ... uc_sym_mat3 const & reciprocal_metrical_matrix

Representing coordinates

x = 0.7a y = 0.8b

a

b

Page 10: Geometry and Space Groups - Laboratory of Molecular Biology Cooper... · Geometry and Space Groups richard.cooper@chem.ox.ac.uk ECACOMSIG school 2013 . ... uc_sym_mat3 const & reciprocal_metrical_matrix

Representing coordinates

x = 0.4a y = 1.0b

a

b

Page 11: Geometry and Space Groups - Laboratory of Molecular Biology Cooper... · Geometry and Space Groups richard.cooper@chem.ox.ac.uk ECACOMSIG school 2013 . ... uc_sym_mat3 const & reciprocal_metrical_matrix

Representing coordinates

x = 0.2a y = 0.4b

a

b

Page 12: Geometry and Space Groups - Laboratory of Molecular Biology Cooper... · Geometry and Space Groups richard.cooper@chem.ox.ac.uk ECACOMSIG school 2013 . ... uc_sym_mat3 const & reciprocal_metrical_matrix

Basis vectors

• In the previous examples a and b are the basis vectors.

• They define coordinate axes for a particular reference frame.

• The molecule didn’t move. The way we refer to it changed.

• We can choose them to point wherever we like (provided they are linearly independent) – but some ways are more sensible than others.

Page 13: Geometry and Space Groups - Laboratory of Molecular Biology Cooper... · Geometry and Space Groups richard.cooper@chem.ox.ac.uk ECACOMSIG school 2013 . ... uc_sym_mat3 const & reciprocal_metrical_matrix

Lattices

• A three-dimensional lattice can be described by 3 basis vectors. If basis vectors begin and end on lattice points the coordinates remain the same from one cell to the next.

Page 14: Geometry and Space Groups - Laboratory of Molecular Biology Cooper... · Geometry and Space Groups richard.cooper@chem.ox.ac.uk ECACOMSIG school 2013 . ... uc_sym_mat3 const & reciprocal_metrical_matrix

Describing unit cell edges as vectors

General (triclinic) case. Construct a Cartesian coordinate system e1, e2, e3 for a, b, and c :

• e1 is (1,0,0); e2 is (0,1,0); e3 is (0,0,1)

• Express (a, b, c) as linear combinations of (e1, e2, e3):

a = k11 e1. + k12. e2 + k13. e3

b = k21. e1 + k22. e2 + k23. e3

c = k31.e1 + k32. e2 + k33. e3

(a,b,c)T = M-1 (e1,e2,e3)T

Express new axes in old system

Page 15: Geometry and Space Groups - Laboratory of Molecular Biology Cooper... · Geometry and Space Groups richard.cooper@chem.ox.ac.uk ECACOMSIG school 2013 . ... uc_sym_mat3 const & reciprocal_metrical_matrix

a

b

c

e1

e2

e3

e1 is parallel to crystallographic a axis . e2 is in ab plane,a perpendicular to e1: a b e1. e3 perpendicular to ab plane: a b

Page 16: Geometry and Space Groups - Laboratory of Molecular Biology Cooper... · Geometry and Space Groups richard.cooper@chem.ox.ac.uk ECACOMSIG school 2013 . ... uc_sym_mat3 const & reciprocal_metrical_matrix

a

b

c

e1

e2

e3

3

2

1

sinsinsin

coscoscossincos

0sincos

00

e

e

e

ab

Vcc

bb

a

c

b

a

Page 17: Geometry and Space Groups - Laboratory of Molecular Biology Cooper... · Geometry and Space Groups richard.cooper@chem.ox.ac.uk ECACOMSIG school 2013 . ... uc_sym_mat3 const & reciprocal_metrical_matrix

3

2

1

1

e

e

e

M

c

b

a

a

b

c

e1

e2

e3

3

2

1

sinsinsin

coscoscossincos

0sincos

00

e

e

e

ab

Vcc

bb

a

c

b

a

Page 18: Geometry and Space Groups - Laboratory of Molecular Biology Cooper... · Geometry and Space Groups richard.cooper@chem.ox.ac.uk ECACOMSIG school 2013 . ... uc_sym_mat3 const & reciprocal_metrical_matrix

3

2

1

sinsinsin

coscoscossincos

0sincos

00

e

e

e

ab

Vcc

bb

a

c

b

a

c

b

a

M

3

2

1

e

e

e

a

b

c

e1

e2

e3

3

2

1

1

e

e

e

M

c

b

a

Page 19: Geometry and Space Groups - Laboratory of Molecular Biology Cooper... · Geometry and Space Groups richard.cooper@chem.ox.ac.uk ECACOMSIG school 2013 . ... uc_sym_mat3 const & reciprocal_metrical_matrix

Transforming coordinates

• Coordinates transform differently to the cell axes:

b

a

b

a’

b’

Axes rotate 30 anti-clockwise from ab to a’b’.

Object stands still, but relative to axes it appears to have moved clockwise.

Page 20: Geometry and Space Groups - Laboratory of Molecular Biology Cooper... · Geometry and Space Groups richard.cooper@chem.ox.ac.uk ECACOMSIG school 2013 . ... uc_sym_mat3 const & reciprocal_metrical_matrix

Transforming coordinates

• Basis transforms covariantly; coordinates transform contravariantly

frac

frac

fracT

cart

cart

cart

z

y

x

z

y

x1

M

c

b

a

M

3

2

1

e

e

e

cart

cart

cart

T

frac

frac

frac

z

y

x

z

y

x

M

3

2

1

1

e

e

e

M

c

b

a

Page 21: Geometry and Space Groups - Laboratory of Molecular Biology Cooper... · Geometry and Space Groups richard.cooper@chem.ox.ac.uk ECACOMSIG school 2013 . ... uc_sym_mat3 const & reciprocal_metrical_matrix

Transforming X-ray data

Find matrix U to convert hkl vector to reciprocal Cartesian basis... Uh = h’

1. We know that hTx = . Therefore h’Tx’= .

2. If a matrix L transforms x to x’, then: h’Tx’ = (Uh)T L x = hTUT L x =

3. Therefore UTL = I and U = (LT)-1

Page 22: Geometry and Space Groups - Laboratory of Molecular Biology Cooper... · Geometry and Space Groups richard.cooper@chem.ox.ac.uk ECACOMSIG school 2013 . ... uc_sym_mat3 const & reciprocal_metrical_matrix

Transforming coordinates

frac

frac

fracT

cart

cart

cart

z

y

x

z

y

x1

M

c

b

a

M

3

2

1

e

e

e

cart

cart

cart

T

frac

frac

frac

z

y

x

z

y

x

M

3

2

1

1

e

e

e

M

c

b

a

l

k

h

l

k

h

c

c

c

M

c

c

c

l

k

h

l

k

h1

M

Reciprocal space coordinates transform in the same way as the cell vectors

Page 23: Geometry and Space Groups - Laboratory of Molecular Biology Cooper... · Geometry and Space Groups richard.cooper@chem.ox.ac.uk ECACOMSIG school 2013 . ... uc_sym_mat3 const & reciprocal_metrical_matrix

THE METRIC TENSOR

Page 24: Geometry and Space Groups - Laboratory of Molecular Biology Cooper... · Geometry and Space Groups richard.cooper@chem.ox.ac.uk ECACOMSIG school 2013 . ... uc_sym_mat3 const & reciprocal_metrical_matrix

The Metric Tensor

frac

frac

fracT

cart

cart

cart

z

y

x

z

y

x1

M

2222 dzyx

z

y

x

zyx cartcartcart

cart

cart

cart

cartcartcart

211 d

z

y

x

zyx

frac

frac

fracT

fracfracfrac

xxGMM

Page 25: Geometry and Space Groups - Laboratory of Molecular Biology Cooper... · Geometry and Space Groups richard.cooper@chem.ox.ac.uk ECACOMSIG school 2013 . ... uc_sym_mat3 const & reciprocal_metrical_matrix

The Metric Tensor

• Easy to calculate.

• Useful for computing.

• Easy to transform:

G’ = MGMT

c.cb.ca.c

b.cb.ba.b

a.ca.ba.a

G

ccbcac

bcbbab

acabaa

G

coscos

coscos

coscos

Page 26: Geometry and Space Groups - Laboratory of Molecular Biology Cooper... · Geometry and Space Groups richard.cooper@chem.ox.ac.uk ECACOMSIG school 2013 . ... uc_sym_mat3 const & reciprocal_metrical_matrix

The Metric Tensor

• G is very useful in programming – it is much less error prone that the explicit orthogonalisation matrix full of sines and cosines.

• The determinant of G is the volume of the unit cell squared.

• The inverse of G is denoted G*. • G transforms reciprocal (a*,b*,c*) to real lattice

directions (a,b,c), and G* does the reverse. • d2 = x G xT

Implementation comment from Prof Neder: if comparing many distances (e.g. all atoms pairwise, then it may be quicker (fewer operations) to convert all coordinates to orthogonal basis in one pass, then compute distances between pairs.

Page 27: Geometry and Space Groups - Laboratory of Molecular Biology Cooper... · Geometry and Space Groups richard.cooper@chem.ox.ac.uk ECACOMSIG school 2013 . ... uc_sym_mat3 const & reciprocal_metrical_matrix

TRANSFORMATIONS

Page 28: Geometry and Space Groups - Laboratory of Molecular Biology Cooper... · Geometry and Space Groups richard.cooper@chem.ox.ac.uk ECACOMSIG school 2013 . ... uc_sym_mat3 const & reciprocal_metrical_matrix

Transforming cells

• Classic example is changing space group P21/n to P21/c

• The space groups are the same.

Page 29: Geometry and Space Groups - Laboratory of Molecular Biology Cooper... · Geometry and Space Groups richard.cooper@chem.ox.ac.uk ECACOMSIG school 2013 . ... uc_sym_mat3 const & reciprocal_metrical_matrix

Transforming cells

• Classic example is changing space group P21/n to P21/c

• The space groups are the same.

a

c

P21/n

Page 30: Geometry and Space Groups - Laboratory of Molecular Biology Cooper... · Geometry and Space Groups richard.cooper@chem.ox.ac.uk ECACOMSIG school 2013 . ... uc_sym_mat3 const & reciprocal_metrical_matrix

Transforming cells

• Classic example is changing space group P21/n to P21/c

• The space groups are the same.

a' c'

P21/c

Page 31: Geometry and Space Groups - Laboratory of Molecular Biology Cooper... · Geometry and Space Groups richard.cooper@chem.ox.ac.uk ECACOMSIG school 2013 . ... uc_sym_mat3 const & reciprocal_metrical_matrix

Transforming cells

• Transform basis vectors from P21/n to P21/c

a

c'

c

Page 32: Geometry and Space Groups - Laboratory of Molecular Biology Cooper... · Geometry and Space Groups richard.cooper@chem.ox.ac.uk ECACOMSIG school 2013 . ... uc_sym_mat3 const & reciprocal_metrical_matrix

Transforming cells

• Transform basis vectors from P21/n to P21/c

a

c'

c

a’ = a b’ = b c‘ = a + c

Page 33: Geometry and Space Groups - Laboratory of Molecular Biology Cooper... · Geometry and Space Groups richard.cooper@chem.ox.ac.uk ECACOMSIG school 2013 . ... uc_sym_mat3 const & reciprocal_metrical_matrix

Transforming cells

• Transform basis vectors from P21/n to P21/c

a

c'

c

a’ = a b’ = b c‘ = a + c

a’ = 1.a + 0.b + 0.c b’ = 0.a + 1.b + 0.c c‘ = 1.a + 0.b + 1.c

Page 34: Geometry and Space Groups - Laboratory of Molecular Biology Cooper... · Geometry and Space Groups richard.cooper@chem.ox.ac.uk ECACOMSIG school 2013 . ... uc_sym_mat3 const & reciprocal_metrical_matrix

Transforming cells

• Transform basis vectors from P21/n to P21/c

Transform basis vectors from P21/n to P21/c

a

c'

c

a’ = a b’ = b c‘ = a + c

a’ = 1.a + 0.b + 0.c b’ = 0.a + 1.b + 0.c c‘ = 1.a + 0.b + 1.c

c

b

a

c'

b'

a

101

010

001'

Page 35: Geometry and Space Groups - Laboratory of Molecular Biology Cooper... · Geometry and Space Groups richard.cooper@chem.ox.ac.uk ECACOMSIG school 2013 . ... uc_sym_mat3 const & reciprocal_metrical_matrix

Transforming cells

• Transform metric tensor from P21/n to P21/c

• Avoids referring to cell vectors in Cartesian basis (a,b,c)

a c'

c

T

101

010

001

101

010

001

GG'

Page 36: Geometry and Space Groups - Laboratory of Molecular Biology Cooper... · Geometry and Space Groups richard.cooper@chem.ox.ac.uk ECACOMSIG school 2013 . ... uc_sym_mat3 const & reciprocal_metrical_matrix

Transforming cells

• Transform coordinates from P21/n to P21/c

a

c'

c

z

y

x

z'

y'

x'T

1

101

010

001

Page 37: Geometry and Space Groups - Laboratory of Molecular Biology Cooper... · Geometry and Space Groups richard.cooper@chem.ox.ac.uk ECACOMSIG school 2013 . ... uc_sym_mat3 const & reciprocal_metrical_matrix

Tutorials

Work through coordinate transform and geometry calculations in IPython notebook (or Python) using numpy matrices.

Page 38: Geometry and Space Groups - Laboratory of Molecular Biology Cooper... · Geometry and Space Groups richard.cooper@chem.ox.ac.uk ECACOMSIG school 2013 . ... uc_sym_mat3 const & reciprocal_metrical_matrix

Thanks

• See bibliography slide above

• Dr David Watkin

• ECACOMSIG delegates and organisers