Commission on Crystallographic Computing

International Union of Crystallography
http://www.iucr.org/iucr-top/comm/ccom/

Newsletter No. 7, November 2006
(6th June 2008: updated least-squares article)

This issue:"Understanding Crystal Structures"
http://www.iucr.org/iucr-top/comm/ccom/newsletters/

Table of Contents(This issue’s editors: Simon Parsons and Lachlan Cranswick)(Warning – unless you want to kill 166 pages worth of forest – DO NOT press the “print” button. For hardcopies – you may
like to only print out the articles of personal interest.)
IUCr Commission on Crystallographic Computing

2

Advert for the Seventh Canadian Powder Diffraction
Workshop3

VisualGraphic
Library
VGLIB5for
Crystallographic Programs on Windows PCs
120
Kenji Okada, Ploenpit Boochatum, Keiichi Noguchi
and Kenji Okuyama

Understanding Crystal Structures :Multipurpose crystallochemical analysis with theprogram package TOPOS
Vladislav A. Blatov
The XPac Program for Comparing Molecular
Packing
Thomas Gelbrich
The Pixel module of the OPiX computer program
package: affordable calculation of intermolecularinteraction energies for large organic moleculesand crystalsrdAngelo Gavezzotti (updated 3 March 2007)

4

39

45

Quantifying the Similarity of Crystal Structures
René de Gelder

59

Topological analysis of crystal structures
Oleg V. Dolomanov70

On the Detection of Solvent Accessible Voids in
Crystal Structures with PLATON/SOLV
Anthony (Ton) L. Spek

79

Other Articles :The charge flipping algorithm: a powerful anduniversal tool for the a priori solution of crystal
structures in any dimension
Gervais Chapuis and Lukas Palatinus
cctbx news
Ralf W. Grosse-Kunstleve, Peter H. Zwart, Pavel V.
Afonine, Thomas R. Ioerger and Paul D. Adams

85
92

An integrated three-dimensional visualization
system VESTA using wxWidgets
106
Koichi Momma and Fujio Izumi

Notes on the calculation of the derivatives forleast-squares crystal structure refinement
129
th
Riccardo Spagna (updated 6 June 2008)
Call for Contributions to the Next CompComm
Newsletter
166

THE IUCR COMMISSION ON CRYSTALLOGRAPHIC COMPUTING - TRIENNIUM 2005-2008
Chairman: Professor Dr. Anthony L. Spek
Director of National Single Crystal Service Facility,
Utrecht University,
H.R. Kruytgebouw, N-801,
Padualaan 8, 3584 CH Utrecht,
the Netherlands.
Tel: +31-30-2532538
Fax: +31-30-2533940
E-mail: a.l.spek@chem.uu.nl
WWW: http://www.cryst.chem.uu.nl/spea.html
WWW: http://www.cryst.chem.uu.nl/platon/
Lachlan M. D. Cranswick
Canadian Neutron Beam Centre (CNBC),
National Research Council of Canada (NRC),
Building 459, Station 18, Chalk River Laboratories,
Chalk River, Ontario, Canada, K0J 1J0
Tel: (613) 584-8811 ext: 3719
Fax: (613) 584-4040
E-mail: lachlan.cranswick@nrc.gc.ca
WWW: http://neutron.nrc-cnrc.gc.ca/peep_e.html#cranswick

Dr Ralf W. Grosse-Kunstleve
Lawrence Berkeley National Laboratory
One Cyclotron Road, BLDG 64R0121,
Berkeley, California, 94720-8118, USA.
Tel: (510) 486-5929
Fax: (510) 486-5909
E-mail: RWGrosse-Kunstleve@lbl.gov
WWW: http://cctbx.sourceforge.net/
WWW: http://www.phenix-online.org/
WWW: http://cci.lbl.gov/~rwgk/

Professor Alessandro Gualtieri
Università di Modena e Reggio Emilia,
Dipartimento di Scienze della Terra,
Via S.Eufemia, 19,41100 Modena, Italy
Tel: +39-059-2055810
Fax: +39-059-2055887
E-mail: alex@unimore.it
WWW: http://www.terra.unimo.it/en/personaledettaglio.php?user=alexProfessor Luhua Lai
Institute of Physical Chemistry,
Peking University,
Beijing 100871, China.
Fax: +86-10-62751725.
E-mail: lhlai@pku.edu.cn
WWW: http://mdl.ipc.pku.edu.cn/

Dr Airlie McCoy
Structural Medicine,
Cambridge Institute for Medical Research (CIMR)
Wellcome Trust/MRC Building,
Addenbrooke's Hospital,
Hills Road, Cambridge CB2 2XY, UK
Tel: +44 (0) 1223 217124
Fax: +44 (0) 1223 217017
E-mail: ajm201@cam.ac.uk
WWW: http://www.haem.cam.ac.uk/
WWW: http://www-structmed.cimr.cam.ac.uk/

Professor Atsushi Nakagawa
Research Center for Structural and Functional Proteomics,
Institute for Protein Research, Osaka University,
3-2 Yamadaoka, Suita, Osaka, 565-0871, Japan
Tel: +81-(0)6-6879-4313
Fax: +81-(0)6-6879-4313
E-mail: atsushi@protein.osaka-u.ac.jp
WWW: http://www.protein.osaka-u.ac.jp/rcsfp/supracryst/

Dr. Simon Parsons
School of Chemistry
Joseph Black Building,West Mains Road,
Edinburgh, Scotland, EH9 3JJ, UK
Tel: +44 131 650 5804
Fax: +44 131 650 4743
E-mail: s.parsons@ed.ac.uk
WWW: http://www.crystal.chem.ed.ac.uk/

Dr Harry Powell
MRC Laboratory of Molecular Biology,
Hills Road, Cambridge, CB2 2QH, UK.
Tel: +44 (0) 1223 248011
Fax: +44 (0) 1223 213556
E-mail: harry@mrc-lmb.cam.ac.uk
WWW: http://www.mrc-lmb.cam.ac.uk/harry/

Consultants
Professor I. David Brown
Brockhouse Institute for Materials Research,
McMaster University,
Hamilton, Ontario, Canada
Tel: 1-(905)-525-9140 ext 24710
Fax: 1-(905)-521-2773
E-mail: idbrown@mcmaster.ca
WWW:
http://www.physics.mcmaster.ca/display.php4?page=sw://lists/Minibio_2004.
php4?ID=4

Professor Eleanor Dodson
York Structural Biology Laboratory,
Department Of Chemistry,
University of York, Heslington, York, UK, YO10 5YW
Tel: +44 (1904) 328253
Fax: +44 1904 328266
E-mail: e.dodson@ysbl.york.ac.uk
WWW: http://www.ysbl.york.ac.uk/people/6.htm

Dr David Watkin
Chemical Crystallography,
Oxford University,
9 Parks Road,
Oxford, OX1 3PD, UK.
Tel: +44 (0) 1865 272600
Fax: +44 (0) 1865 272699
E-mail: david.watkin@chemistry.oxford.ac.uk
WWW: http://www.chem.ox.ac.uk/researchguide/djwatkin.html

Page 1

Septième
atelier dediffraction sur
poudreSeventh Canadian Powder
Diffraction Workshop
Du mercredi 16 au vendredi 18 mai 2007 - Wednesday 16th to Friday 18th of May 2007
Université du Québec à Trois-Rivières, Trois-Rivières, Québec
http://www.cins.ca/cpdw/(L’atelier se déroulera en anglais / Workshop will be in english)

À qui s’adresse l’atelier ?

Lecture Titles Include:

Tous ceux qui s’intéressent ou qui utilisentla diffraction X et la diffraction neutronique
sur poudre. Ouvert aux étudiants gradués,
techniciens et chercheurs qui utilisent ladiffraction X sur poudre et qui désirent sefamiliariser avec l’analyse Rietveld.

• Introduction to Powder Diffraction and
Powder Diffraction Hardware• Introduction to the basics of
crystallography• Sample preparation, data collection
and phase identification using
powder X-ray diffraction• Introduction to Powder Profile
Refinement• Synchrotron and Neutron Experiments• Freely available powder diffraction
software• Profile Refinement with GSAS
• Beyond the Bragg peaks or why do
we care about total scattering?
• What to do with your PDF: Modelingof disordered structures

Who should attend ?
Anyone interested in or currently using
powder X-ray or neutron diffraction. Opento graduate students, technicians andresearchers who use X-ray and neutron
diffraction and who would like to learn
Rietveld analysis.

Détails / DetailsCoûts d’inscription /Registration costs
Universitaire / University
based: 200 $ CAN
Régulier / Régular : 450 $ CAN(Incluant les dîners et les taxes /Including lunchs and taxes)

Chair :
• Prof. Jacques Huot (UQTR)

Hébergement / Housing
Forfait 2 nuits sur le campus: 90$ CAN
2 nights on campus package: 90$ CAN

Speakers :• Dr Robert Von Dreele (ANL, USA)
• Dr Angus Wilkinson (Georgia Tech, USA)
• Dr Thomas Proffen (Los Alamos, USA)
• Dr Ian Swainson and Lachlan Cranswick(NRC-CNRC, Canada)

Date limite d’inscription /Registration deadline :13 avril 2007 / April 13, 2007
Plus d’information sur le site web :Check out the following web site :http://www.cins.ca/cpdw/

Page 2

3

Multipurpose crystallochemical analysis with the program package
TOPOS
Vladislav A. Blatov
Samara State University, Ac.Pavlov Street. 1, Samara 443011, Russia. E-mail: blatov@ssu.samara.ru ;WWW: http://www.topos.ssu.samara.ru/blatov.html ; TOPOS website: http://www.topos.ssu.samara.ru/

Abbreviation list
CIF
CN
CS
CSD
DBMS
EPINET
ES
ICSD
MCN
MOF
MPT
PDB
RCSR
SBU
TTD
VDP
VS

Crystallographic Information File
Coordination number
Coordination sequence
Cambridge Structural Database
Database Management System
Euclidean Patterns in Non-Euclidean Tilings
Extended Schläfli symbol for circuits
Inorganic Crystal Structure Database
Molecular coordination number
Metal-organic framework
Maximal proper tile
Protein Databank
Reticular Chemistry Structure Resource
Secondary building unit
TOPOS Topological Database
Voronoi-Dirichlet polyhedron
Vertex symbol

1. Introduction
At present, the data for more than 400,000 chemical compounds are collected in world-wide
crystallographic databases CSD, ICSD, PDB and CrystMet. Processing of such a large amount of
information is a great challenge for modern crystal chemistry. Traditional visual analysis of crystal
structures becomes insufficient to reveal the common principles of the spatial organization of threedimensional nets and packings in long series of chemical compounds of various composition andstoichiometry. Rapidly developing interdisciplinary branches of science, such as crystal engineering andsupramolecular chemistry, require the development of new computer methods to process and classify the
crystallographic information, and to search for general crystallochemical regularities.
When developing the program package TOPOS we pursued two main goals:• to create a computer system that would enable one to perform comprehensive crystallochemical
analysis of any crystal structure irrespective of its chemical nature and complexity;• to implement new methods for crystallochemical analysis of large amounts of chemical compounds tofind the regularities in their structure organization in an automated mode.
TOPOS has been developed since 1989 and has several versions being exploited so far. The MS DOS
versions 3.0, 3.1 and 3.2 were developed until 2003 and now are not supported. The current Windowsbased TOPOS 4.0 Professional started in 2001 and now is the main program product in the TOPOS
family. Its periodically updated beta-version is available for free at the TOPOS website:
http://www.topos.ssu.samara.ru/. It is the version that will be considered in detail and below it will becalled TOPOS for short.

Page 3

4

TOPOS is created using Borland Delphi 7.0 environment and works under Windows
95/98/Me/NT/2000/XP operating systems. Its current size is less than 3 M (without topological databases)
so it is easily distributed as a self-extracted zipped file. The system requirements are minimal; really
TOPOS can work on any IBM PC computer under Windows. The main file topos40.exe is an
integrated interactive multiwindow system (Fig. 1) that is based on DBMS intended to input, edit, searchand retrieve the crystal structure information stored in TOPOS external databases. TOPOS includes anumber of applied programs (Table 1), all of which (except StatPack) are integrated into TOPOS system.
Table 1: A brief description of TOPOS applied programs
Program name
ADS (Automatic Description of Structure)

AutoCN
DiAn
Dirichlet
HSite
IsoCryst
IsoTestStatPack

Destination
Revealing structural groups, determining their composition, orientation, dimensionality
and binding in various structure representations
Calculating topological invariants (coordination sequences, Schläfli and vertex symbols) and performing topological classification
Constructing molecular VDPs and calculating their geometric characteristics
Constructing tilings for 3D nets
Searching for and classifying entanglements of 1D, 2D or 3D extended structures
Identifying and classifying interatomic contacts
Determining coordination numbers of atoms
Calculating and storing the adjacency matrix
Calculating interatomic distances and bond angles
Constructing VDPs for atoms and voids
Calculating geometric characteristics of atom and void domains
Searching for void positions and channel systems
Generating positions of hydrogens
Visualizing crystal structure
Calculating geometric parameters of crystal structure
Arranging crystal structures into topological and structure types
Comparative analysis of atomic nets and packings
Statistical processing of the data files generated by the programs Dirichlet and ADS

All TOPOS constituents can exchange the data and should usually be applied in a certain sequence when
performing a complicated crystallochemical analysis. Scheme 1 shows the logical interconnections within
the TOPOS system when exchanging the data streams. The main data stream is directed from the top to
the bottom of Scheme 1, since all TOPOS applied programs use the crystallographic information from
DBMS. However, ADS, AutoCN, Dirichlet, HSite and IsoTest programs can produce new data that can be
stored in TOPOS databases, so there is an inverse data stream.
Crystal structure database in the TOPOS VER 2.02 format includes five files:
File type
File destination*.adm
contains adjacent matrices of crystal structures (optional file)*.cmp
contains chemical formulae of compounds*.cd
contains other data on crystal structures*.its
contains the information on the topology of the graphs of crystal structures (optional file)*.itlcontains the information on the topology of atomic sublattices (optional file)
DBMS identifies the database using the *.cmp file; it is the file that is loaded in the DBMS window. Any
number of databases can be loaded at once. In addition a number of index files *.idx ('x' is a lettercharacterizing the content of the index file) can be created using the DBMS Distribution utility.

Page 45

Figure 1: General view of the program package TOPOS.

Scheme 1: Interaction of constituents and main data stream paths within the TOPOS system.

Page 56

In addition TOPOS forms and supports the following auxiliary databases:•

TTD collection that is a set of *.ttd files in a special binary format containing the information on
topological types of simple 2D or 3D nets. The TTD collection is used for automatic determining crystal structure topology with the ADS program. At present the TTD collection includes four databases:
Database

Numberof records

TOPOS&RCSR.ttd 1606•

binary.ttd

1597

polytypes.ttd

694

epinet.ttd

14380

Description
Data on idealized nets from RCSR,1 framework zeolites,2 spherepackings (see, e.g. Sowa & Koch, 2005), and two-dimensional
nets
Data on binary framework compounds
Data on topologies of polytypic close packings, SiC, NiAs, andother layered polymorphs up to 12-layered
Data on all new topological types of the periodic nets generated
within the EPINET project3

library of combinatorial-topological types of finite polyhedra containing the information on the edge
nets of polyhedra in the files *.edg, *.pdt, *.vec. This library is used by the Dirichlet and ADS
programs to identify the combinatorial topology of VDPs and tiles.

The methods of inputting the information into the TOPOS databases are shown in Scheme 2. The main
distinction of the content of the TOPOS databases in comparison with other crystallographic databanks isthat the 3D graph of interatomic bonds is completely stored in the *.adm file. Using this information
TOPOS can produce other important data on the crystal structure topology. Thus, the main TOPOS
peculiarity is its orientation to topological characteristics that clarifies its name.

Scheme 2: Methods to produce data in TOPOS databases.

2. Topological information in TOPOS1

http://okeeffe-ws1.la.asu.edu/RCSR/home.htm
http://www.iza-structure.org/databases/3
http://epinet.anu.edu.au/
2Page 67

2.1. Adjacency matrix
TOPOS uses the concept of labelled quotient graph (Chung et al., 1984) to make the infinite 3D periodic
graph of crystal structure suitable for computer storage. The adjacency matrix of the labelled quotientgraph contained in the *.adm file carries all necessary information about the system of interatomic
contacts. The format of data for each contact of the basic 'central' atom with a surrounding atom is given
below.4 The CSym and translation fields contain encoded symmetry operation and translation
vector, which transforms the jth basic atom into surrounding atom connected with the ith central one. This
information is sufficient to describe the labelled quotient graph and the topology of the whole net. Other
parameters characterize the kind and strength of the contact.
recordi,j:integer numbers of central and surrounding atom
CSym:integer symmetry codetranslation:array[1..3]of integer translation vector
m:integer type of the contact{m=0 - not a contact
m=1 - valence bond
m=2 - specific (secondary) interaction
m=3 - van der Waals bonding
m=4 - hydrogen bonding
m=5 - agostic bonding}R,SA:float contact parameters (interatomic distance, VDP solid
angle, etc.)
end;
The program AutoCN is intended for automated computing and storing adjacency matrix. Since TOPOS
can work with periodic nets of various nature, including idealized or artificial nets, AutoCN uses several
algorithms to determine contacts between nodes of the net.
Three main AutoCN algorithms, called Using Rsds, Sectors and Distances, are designed for crystal
structures of real chemical compounds and based on constructing Voronoi-Dirichlet polyhedra,5 VDPs,
for all atoms. For applications of VDPs in crystal chemistry see Blatov (2004). The VDP constructionuses very effective 'gift wrapping' algorithm (Preparata & Shamos, 1985) of computing a convex hull fora set of image points with coordinates (2xi/Ri2, 2yi/Ri2, 2zi/Ri2), where (xi, yi, zi) are the Cartesian
coordinates of the surrounding atoms, and Ri is the distance from the VDP atom to the ith neighbouringatom. In this algorithm for each edge E of face F belonging to the convex hull, the point (Pk)corresponding to the third vertex of a face adjacent to F and joined to it at the same edge is determinedfrom the maximum dihedral angle ϕ (Fig. 2a). Cotangents of ϕ angles are calculated with the formula
UP2
v ⋅a
(1)
cot ϕ = −=− k ,
UVvk ⋅ nwhere n is the unit normal vector to the face F in a half-space containing the VDP atom, and a is the unit
vector normal to both E and n (Fig. 2b).

As a result, VDP of an atom in the crystal space is a convex polyhedron whose faces are perpendicular tosegments connecting the central atom of VDP and the other surrounding atoms (Fig. 3a). VDPs of all
atoms form Voronoi-Dirichlet partition of crystal space (Fig. 3b). Each face divides the corresponding
segment by half and ordinarily the face and segment intersect each other. Otherwise (Fig. 3c) the
surrounding atom is called 'indirect neighbour' according to O’Keeffe (1979). All the three AutoCN
4
5

Hereafter a Pascal-like pseudocode is used to describe TOPOS algorithms and data structure.
Hereafter all bold italic terms are explained in TOPOS Glossary (Appendix).
Page 78

algorithms consider only the contacts with direct VDP neighbours as potential bonds. The differences arein consequent arranging of the contacts.
P5
a

V

b
Pk

U

P4

P7

P6

n
E
F

P2

vk

P1

P1
P2

ϕ

a

E
F
P3

P3

Figure 2: (a) Determination of a point forming the VDP face (P6) in the 'gift wrapping' algorithm. The
P1P2P6 half-plane forms the maximum angle with the P1P2P3 (F) half-plane containing previously foundpoints. (b) Calculation of cotϕ according to formula (1). P1P2 (E) is the VDP edge.

a

b

c

Figure 3: (a) Voronoi–Dirichlet polyhedron (VDP) and surrounding atoms, (b) Voronoi-Dirichlet
partition for a body-centred cubic lattice; (c) VDP and surrounding atoms of an oxygen atom in the
crystal structure of ice VIII. Valence, H bond, and non-valence interatomic contacts are coloured red,green, and black, respectively. Indirect contacts are dotted.

The Using Rsds algorithm is rested upon the so-called method of intersecting spheres (Serezhkin et al.,1997). In this method the interatomic contacts are determined as a result of calculating the number ofoverlapping pairs of internal and external spheres circumscribed around the centre of either atom of thepair (Fig. 4). Normally, the internal and external spheres have atomic Slater's radius, rs, and radius of
spherical domain, Rsd, respectively. If more than one pair of such spheres intersect each other (overlaps
Π2, Π3 or Π4) then the contact is assumed to be a chemical bond and is added to atomic CN. If only
external spheres overlap, the contact is assumed to be specific, otherwise van der Waals. With additional
geometrical criteria the algorithm can separate hydrogen or agostic bonding from specific contacts. In
fact, the method of intersecting spheres assumes the shape of the atomic domain to be practicallyspherical in the crystal structure. This assumption works well for many inorganic compounds, but in thecase of organic or coordination compounds it requires considering anisotropy of atomic domains.
Page 8

9

Π0

Π1

Π2

Π3

Π4

Figure 4: Schematic representation of basic types of overlaps (Πn) for atoms within the method ofintersecting spheres. The radii of solid and dotted spheres are equal rs and Rsd, respectively. Theintersections are shaded of the spheres that causes a given type of overlap. The n value is equal to thenumber of pair overlaps (Serezhkin et al., 1997).

The Sectors algorithm uses an improved method of intersecting spheres designed by Peresypkina andBlatov (2000) for organic and metal-organic compounds and called method of spherical sectors. In thismethod sphere of Rsd radius is replaced with a set of spherical sectors corresponding to interatomic
contacts (Fig. 5a). The radius (rsec) of the ith sector is determined by the formula1⎛ 3V ⎞ 3
rsec = ⎜ i ⎟ ,⎝ Ωi ⎠(2)

where Vi and Ωi are volume and solid angle of a pyramid with basal VDP face corresponding tointeratomic contacts and with the VDP atom in the vertex (Fig. 5b). The Sectors algorithm also allows
user to reveal non-valence bonding.

B

C

A
a

b

Figure 5: (a) An example of identification of interatomic contacts with the Sectors algorithm in a twodimensional lattice. Bold lines confine VDPs; dashed lines show boundaries of pyramids (triangles in 2Dcase) based on the VDP faces corresponding to the direct interatomic contacts. Dashed circles have rs
radius; solid arcs of rsec radius confine spherical sectors and show atomic boundaries in a crystal field.
The A and B atoms form a valence contact, to which the triple overlap rsec(A)–rs(B), rs(A)–rsec(B) andrsec(A)–rsec(B) corresponds; the contact between A and C atoms is non-valence because the only overlap
rsec(A)–rs(B) corresponds to it. (b) VDP of an atom in a body-centred cubic lattice. The solid angle (Ω) of
the VDP pyramid based on the shaded face is equal to the shaded segment of the unit sphere cut off by the
pyramid with the VDP atom at the vertex and the face in the base.

The Distance algorithm is an attempt to combine the Voronoi-Dirichlet approach and traditional methods
that use atomic radii and interatomic distances. The contact between the VDP atom and surrounding atom

Page 910

is considered valence bonding if the distance between them is shorter that the sum of their Slater's radii
increased by a shift to be specified by user (0.3 Å by default).
With these algorithms (Sectors by default) user can compute adjacency matrices in an automated modethat is very important for the analysis of large numbers of crystal structures. Their main advantage isindependence of the nature of bonding and of kind of interacting atoms; Slater's system of radii is used in
all cases. They were tested for all compounds from CSD and ICSD, and showed a good agreement withchemical models.
To work with artificial nets TOPOS has two additional algorithms, where no atomic radii and the conceptof direct neighbour are used:
Solid Angles, where Ωi value is the only criterion to select connected net nodes from surrounding ones;
Ranges, where the nodes are considered connected if the distance between them falls into specified
range(s); no VDPs are constructed in this case.

The general AutoCN procedure with use of one of the VDP algorithms for a crystal structure with
NAtoms atoms in asymmetric unit is given below. The procedure results in saving AdjMatr array
containing adjacency matrix.
procedure AutoCN(output AdjMatr)for i:=1 to NAtoms docall VDPConstruction(i, output NVDPFaces)
k:=0
for i:=1 to NAtoms do for j:=1 to NVDPFaces[i] do
begin
k:=k+1
call CalcContactParam(i, j, output Dist, Omega, Overlap, Direct, HBond, Agostic)
AdjMatr[k].i:=i
AdjMatr[k].j:=j
AdjMatr[k].R:=Dist
AdjMatr[k].SA:=Omega
if Omega>OmegaMin thenbegin
if Method=Solid_Angles then AdjMatr[k].m:=1 else
if Direct thenbegin
if (Method=Using_Rsds)or(Method=Sectors) thenif Overlap=0 then AdjMatr[k].m:=3
if Overlap=1 thenif HBond then AdjMatr[k].m:=4 else
if Agostic then AdjMatr[k].m:=5 else AdjMatr[k].m:=2
if Overlap>1 then AdjMatr[k].m:=1
if Method=Distances thenif Dist<r[i]+r[j]+Shift then AdjMatr[k].m:=1 else AdjMatr[k].m:=0
end else AdjMatr[k].m:=0
end else AdjMatr[k].m:=0
end
call StoreInDatabase(AdjMatr)

Adjacency matrix is used by all TOPOS applied programs; ADS and IsoTest produce other data for the
database derived from the adjacency matrix.

Page 1011

2.2. Reference databases of topological types
The ADS program produces textual *.nnt (New Net Topology) files that contain important topologicalinvariants of nets and can be converted to binary TTD databases. The format of an *.nnt file entry isgiven below. For detailed information on coordination sequences, total and extended Schläfli symbols(ES) and vertex symbols (VS) see Delgado-Friedrichs & O’Keeffe (2005). The CS+ES+VS combinationof topological invariants unambiguously determines the topology of any net found in real crystal
structures; about additional invariants see part 3.2.1. The binary *.ttd equivalents of *.nnt files areused as libraries of standard reference nets (topological types) to be compared with the nets in real crystal
structures.
An *.nnt entry example'$sqc691','{6^2;8}{6^4;8^2}{6^5;10}','3 8 18 40 65 100 140 184 234 294','[6(2).6(2).8(2)]','[6(2).6(2).8(2)]','4 10 24 44 74 104 144 190 240 296','[6.6.6.6.6(2).10(8)]','[6.6.6.6.6(2).10(6)]','4 12 24 46 72 106 144 190 240 298','[6(2).6(2).6(2).6(2).8(2).8(2)]','[6(2).6(2).6(2).6(2).8(2).*]',

Detailed description:'$sqc691',

Name of the record with ‘$’ prefix'{6^2;8}{6^4;8^2}{6^5;10}',

Total Schläfli symbol for the whole net: {628}{6482}{6510}. In this case the numbers of the three
non-equivalent nodes are the same: 1:1:1. Otherwise, indices will be given after each ‘}’
bracket.
'3 8 18 40 65 100 140 184 234 294',

Coordination sequence (CS)'[6(2).6(2).8(2)]',

Extended Schläfli symbol for circuits (ES): [62.62.82]'[6(2).6(2).8(2)]',The same for rings (VS)
Similar triples for other non-equivalent nodes'4 10 24 44 74 104 144 190 240 296','[6.6.6.6.6(2).10(8)]','[6.6.6.6.6(2).10(6)]','4 12 24 46 72 106 144 190 240 298','[6(2).6(2).6(2).6(2).8(2).8(2)]','[6(2).6(2).6(2).6(2).8(2).*]',‘*’ means that there are no rings in this angle, it is equivalent to the ‘∞’ symbol: [62.62.62.62.82.∞]

Page 1112

2.3. Topological information on crystal structure representations
The IsoTest program forms two kinds of database files. The file *.its contains topological invariants(CS+ES+VS) for all possible net representations of a given crystal structure. A hierarchical sequence ofthe crystal structure representations is based on the complete representation, where all the contacts stored
in the adjacency matrix are taken into account. Each contact (graph edge) has a colour corresponding to
its type (the m field of adjacency matrix), and weight determining by interatomic distance (Dist field) or
solid angle (SA field). All other representations may be deduced as the subsets of the complete
representation by the following three-step algorithm.
(i) Graph edges of the same colour are taken into account, other edges are either ignored or consideredirrespective of their weights. In most cases, the chemical interactions of only one type are of interest; as arule, those are strong bonds. If two or more types of bonds are to be analyzed, the bonds of only one type
are to be considered at a given pass of the procedure. Then an array of the weights is formed for all the
one-coloured edges.
(ii) The entire array of weights is divided into several groups by a clustering algorithm. TOPOS have useda simple approach when two weights belong to the same group if their difference is smaller than a given
value. Thus, n distinct coordination spheres are separated in the atomic environment. Then different topologies are generated by successive rejecting the farthest coordination sphere. As a result, n–1 additional
representations of the crystal structure are produced from the complete one. It is important that no 'best'
representations are chosen at this step, but all levels of interatomic interaction are clearly distinguished
for further analysis, depending on the matter in hand.
(iii) Each of the n representations is used to generate a set of subrepresentations according to the scheme
proposed by Blatov (2006). Every subrepresentation is unambiguously determined by an arrangement of
the set {NAtoms} of all atoms from asymmetric unit into four subsets: origin {OA}, removed {RA},contracted {CA}, and target {TA} atoms. The two operations are defined on the subsets to derive a graphof the subrepresentation from the graph of an initial ith representation: contracting an atom to other atoms
keeping the local connectivity, when the atom is suppressed, but all graph paths passing through it are retained (Figs. 6a,b), and removing an atom together with all its bonds (Figs. 6c,d). The four-subset arrangement is determined by the role of atoms in those operations. Namely, origin atoms form a new netthat characterizes the subrepresentation topology; removed atoms are eliminated from the initial net by
the removing operation; contracted atoms merge with target atoms, passing the bonds to them.
All the sets {OA}, {RA}, {CA}, and {TA} form a collection ({OA}, {RA}, {CA}, {TA}) that, together
with the initial representation, unambiguously determines the subrepresentation topology (Figs. 6a-d).
With the concept of collection, the successful enumeration of the significant subrepresentations becomes
easily formalizable as a computer algorithm implemented into IsoTest. Firstly, any collection has a number of properties reflecting the crystal structure relations that can be formulated in terms of set theory.
(i) {OA}∩{RA}=∅; {OA}∩{CA}=∅, {RA}∩{CA}=∅, because an atom cannot play more than onerole in the crystal structure.
(ii) {OA}∪{RA}∪{CA}={NAtoms}, i.e. every atom must have a crystallochemical role.
(iii) {OA}≠∅, other sets may be empty. This property arises because only the origin atoms are nodes in
the graph of the crystal structure subrepresentation; other atoms determine the graph topology. Obviously,
the collection ({OA}, ∅, ∅, ∅) means that {OA}={NAtoms}; it describes the initial representation.
(iv) {TA}⊆{OA}, because the target atoms are always selected from the origin atoms; unlike other origin
atoms they are the centres of complex structural groups.
(v) {TA}≠∅ ⇔ {CA}≠∅, because the target and contracted atoms together form the structural groups.

Page 12

13

Secondly, the collections, together with the topological operations, map onto all the crystal structuretransformations applied in crystallochemical analysis. Namely, origin atoms correspond to the centres ofstructural groups in a given structure consideration. If a structural group has no distinct central atom, apseudo-atom (PA) coinciding with group's centroid should be added to the {NAtoms} set; this case istypical to the analysis of molecular packings. Removed atoms are atoms to be ignored in the current
crystal structure representation, as atoms of interstitial ions and molecules in porous substances or, say,alkali metals in framework coordination compounds. Contracted atoms, together with target atoms, form
complex structural groups, but the contracted atoms are not directly considered; they merely provide thestructure connectivity whereas the target atoms coincide with the groups' centroids. The difference
between origin and target atoms is that the target atoms always correspond to polyatomic structuralgroups whereas the origin atoms symbolize all structural units, both mono- and polyatomic.

ab

Figure 6: γ-CaSO4 crystal structure: (a) complete representation ({Ca, S, O}, ∅, ∅, ∅), and its
subrepresentations (b) ({Ca, S}, ∅, {O}, {S}) with origin Ca and S atoms, contracted oxygen atoms, andtarget sulfur atoms (the sma6 topology); (c) ({Ca, O}, {S}, ∅, ∅) with origin Ca and O atoms, andremoved sulfur atoms; (d) ({Ca}, {S}, {O}, {Ca}) with origin and target Ca atoms, removed sulfur atoms,
and contracted oxygen atoms (the qtz topology).

6

The bold three-letter codes indicate the net topology according to the RCSR nomenclature (http://okeeffews1.la.asu.edu/RCSR/home.htm ).
14
Page 13

If, say, there are two atoms of different colours, A and B, {A, B}={NAtoms}, the following four
subrepresentations are possible for the initial representation ({A, B}, ∅, ∅, ∅):(i) ({A}, {B}, ∅, ∅), i.e. the subnet of A atoms;(ii) ({A}, ∅, {B}, {A}), i.e. the net of A atoms with the A–B–A bridges (B atoms are spacers);(iii) ({B}, {A}, ∅, ∅); (iv) ({B}, ∅, {A}, {B}) are the same nets of B atoms.
IsoTest enumerates all possible collections and successively writes down them into *.its file in thefollowing format:
OA, RA, CA, TA: array of integer
atomic numbers for atoms in the {OA}, {RA}, {CA}, {TA} sets
CS, ES, VS: array of integer topological invariants for all OA atoms...

Another IsoTest algorithm enables user to compute topological invariants for sublattices of, generally
speaking, non-bonded atoms, and to save them in the *.itl file. Actually, the *.itl file contains the
topological information on all possible packings of atoms. There are two principal distinctions in thisalgorithm in comparison with the analysis of nets:(i) adjacency matrix is calculated using the Solid Angles algorithm because no real chemical bonds, but
packing contacts, are analyzed;(ii) all atoms in the collection are considered origin or removed, no contraction is used because of thesame reason.
Thus, in the case of an AB compound three packing representations ({OA}, {RA}) will be considered:({A}, {B}), ({B}, {A}) and ({A, B}, ∅). The formats of *.its and *.itl files are similar, but there
are no CA and TA arrays in the *.itl file.

2.4. Library of combinatorial types of polyhedra
Two TOPOS programs, Dirichlet and ADS, can store the data on polyhedral units in a library consistingof three files: *.pdt (polyhedron name and geometrical parameters); *.edg (data on polyhedron edges
in the format: V1, V2: integer, where V1 and V2 are the numbers of polyhedron vertices); *.vec(Cartesian coordinates of vertices and face centroids). Using the polyhedron adjacency matrix from the*.edg file Dirichlet and ADS can unambiguously identify combinatorial topology of VDPs and tiles. A
standard algorithm of searching for isomorphism of two finite ordinary graphs is used for this purpose.

3. Basic algorithms of crystallochemical analysis in TOPOS
In accordance to the content of databases there are two principal ways of crystallochemical analysis in
TOPOS. They can be conditionally called geometrical and topological, because the former one rests upon
the ordinal crystallographic data from *.cd file (cell dimensions, space group, atomic coordinates),
whereas the latter one uses the topological information from *.adm, *.its, *.itl *.ttd, *.edg
files. As is seen from the previous part these two ways are not completely independent, because all the
topological data are initially produced from crystallographic information. However, these two methods
depend on different algorithms, and we need to describe them separately.

Page 1415

3.1. Geometrical analysis: general scheme
Here we consider in detail only original TOPOS features that distinguish it from well known
crystallochemical software such as Diamond, Platon, ICSD or CSD tools. In addition, the IsoCryst andDiAn programs let user compute all standard geometrical parameters (interatomic distances, bond andtorsion angles, RMS lines and planes, etc.) with ordinal algorithms. The general scheme of geometricalanalysis of a crystal structure is shown in Scheme 3.

3.1.1. Computing atomic and molecular Voronoi-Dirichlet polyhedra
Geometrical analysis in TOPOS is based on VDP as an image of an atomic domain in the crystal field
and on Voronoi-Dirichlet partition as an image of crystal space that is a good approach even in the case ofcomplex compounds (Blatov, 2004). The main advantage of this approach over the traditional model of aspherical atom is its independence of any system of atomic radii and validity for describing chemicalcompounds of different nature, from elementary substances to proteins. The programs Dirichlet and
IsoCryst compute the following geometrical and topological VDP parameters, each of which has a clear
physical meaning (Blatov, 2004; Table 2):••

VDP volume (VVDP) and Rsd.
VDP dimensionless normalized second moment of inertia (G3), generally defined as:
R 2 dVVDP∫
1
G3 = VDP,(3)5
3 VVDP 3
however, Dirichlet uses a simpler formula for an arbitrary (not necessarily convex) solid that can be
subjected to simplicial subdivision:∑V j I j
1 j
G3 =
(4)
5 ,
3 V 3
VDP
where summation is performed over all simplexes, Vj is the volume of the jth simplex, and Ij is thenormalized second moment of inertia of a simplex with respect to the centre of the VDP:.

(5)

Scheme 3: Geometrical analysis of a crystal structure in TOPOS.
Page 1516

In (5), summation is performed over all simplex vertices, ║vk║ is the norm of the radius vector of the kth
vertex of the simplex, and P v P is the norm of the radius vector of the simplex centroid in the coordinate
system with the origin in the centre of the VDP.
• Solid angles of VDP faces (Ωi) to be computed according to Fig. 5.
• Displacement of an atom from the centroid of its VDP (DA).
• Number of VDP faces (Nf).

A number of parameters of Voronoi-Dirichlet partition to be computed with Dirichlet are crucial at
crystallochemical analysis (Table 2):•

Standard deviation for 3D lattice quantizer (Convay and Sloane, 1988):
NAtoms1G3 =3

1
NAtoms∑ ∫ R dV
i =1

2

VDP ( i )VDP ( i )5

⎧ 1 NAtoms⎫3⎨ NAtoms ∑ VVDP( i ) ⎬
i =1
⎩
⎭

,

(6)

or, with (4)NAtoms∑∑j V j I j
1
i =1
G3 =
(7)
5 ,
3
NAtoms3⎧⎫1⎨ NAtoms ∑ VVDP( i ) ⎬
i =1⎩⎭
i.e. <G3> is averaged over G3 values of all inequivalent atomic VDPs.
• Coordinates of all VDP vertices and lengths of VDP edges.
• Other geometrical parameters of VDP vertices and edges important at the analysis of voids andchannels (see part 3.2.2).
1
NAtomsTable 2: Physical meaning of atomic VDP, molecular VDP and Voronoi-Dirichlet partition parameters
Parameter
Atomic VDP parameters
VVDP
Rsd
G3

Dimensionality

MeaningÅ3ÅDimensionlessΩiDA

Percentage of 4π steradianÅ

NfDimensionless

Relative size of atom in the crystal field
Generalized crystallochemical atomic radius
Sphericity degree for nearest environment of the atom; theless G3, the closer the shape of coordination polyhedron tosphereStrength of atomic interaction
Distance between the centres of positive and negative
charges in the atomic domain
Number of atoms in the nearest environment of the VDP
atom

Molecular VDP parameters
Å3
VVDP(mol)Å
Rsd(mol)
Dimensionless
G3(mol)
MCN, Number of faces ofDimensionlesssmoothed molecular VDP

Ωimol

Relative size of secondary building unit in the crystal field
Effective radius of secondary building unit
Sphericity degree of secondary building unit
Number of SBUs contacting with a given one
Strength of intermolecular interaction

Percentage of sum of Ωimol

Number of faces of lattice
Dimensionlessmolecular VDP
Voronoi-Dirichlet partition parameters
Dimensionless<G3>
Coordinates of VDP vertiFractions of unit cell dimensions
ces
Lengths of VDP edges
Å

Number of SBUs surrounding a given one in idealized packing of spherical molecules
Uniformity of crystal structure
Coordinates of void centres
Lengths of channels between the voids

Page 16

17

Uniting atomic VDPs TOPOS constructs secondary building units in the form of molecular VDP (Figs.
7a-c). Molecular VDP is always non-convex, however, VDPs of all secondary building units (SBU) in the
crystal structure still form the Voronoi-Dirichlet partition of the crystal space. The program IsoCrystvisualizes molecular VDPs, and the program ADS determines the following parameters (Table 2):••••

Molecular VDP volume (as a sum of volumes of atomic VDPs), VVDP(mol) and Rsd(mol).
Normalized second moment of inertia of molecular VDP, G3(mol), to be computed according to (4),but the summation is provided over simplexes of all atomic VDPs composing the molecular VDP, andthe centroid of the molecule is taken as origin.
Molecular coordination number (MCN) as a number of molecular VDP faces.
Solid angles of molecular VDP faces ( Ωimol ) to be computed by the formula (8)
Ω

∑Ω

ij

j

⋅100% ,
(8)ΩΣ
where Ωij are solid angles of the molecular VDP facets composing the ith molecular VDP face;ΩΣ = ∑∑ Ωij is the sum of solid angles of all nonbonded contacts formed by atoms of the molecule.
mol
i

=

i

•

j

Cumulative solid angles corresponding to different kinds of intermolecular contacts in MOFs:
Valence solid angles of a ligand ( ΩVL ) and a complex ( ΩVLΣ ) to be calculated as
ΩVL = ∑ Ω ( M − X i ) ,(9)iwhere valence contacts between the complexing M atom and donor Xi atoms of a ligand L were only
taken into consideration, andΩVLΣ = ∑ ( ΩVL ) ,
(10)
I

I

where all ligands connected with the M atom are included in the sum.
Total solid angles of a ligand ( ΩTL ) and a complex ( ΩTLΣ ):ΩTL = ∑ Ω ( M − X i ) ,(11)

ΩTLΣ = ∑ ( ΩTL ) ,

(12)

i

I

I

where, unlike (9), the index i enumerates all (including non-valence) contacts VDP atom–ligand, even
if the ligand is non-valence bonded with the complexing atom and only shields it, while the index I, asin (10), enumerates all the ligands in complex, which are valence bonded with the complexing atom.
ag
Agostic solid angles of a ligand ( Ω ag
L ) and a complex ( Ω LΣ ). These values are to be calculated by theformulae analogous to (11) and (12), but with merely the solid angles of atomic VDPs corresponding
to agostic contacts M…H–X.

Residual solid angles of a ligand (δ= ΩTL − ΩVL ) and a complex (Δ= ΩTLΣ – ΩVLΣ ).
In addition to molecular VDPs the ADS program constructs two types of VDPs for SBU centroids:(i) The Smoothed molecular VDP is constructed by flattening the boundary surfaces of a molecular VDP(Fig. 7d). Smoothed molecular VDPs characterize the local topology of molecular packing andoccasionally do not form a partition of space.
(ii) The Lattice molecular VDP is constructed by using molecular centroids only (Fig. 7e). Lattice
molecular VDPs characterize the global topology of a packing as a whole and form a partition of space,but the number of faces of such a VDP is not always equal to MCN.
Page 1718

In both cases the only VDP parameter, number of faces, has clear crystallochemical meaning (Table 2).

F

F
S

S
N
F

N

N

S
S

N

F

S

F

S
N

N
S

N
S
F

F

a

F

c

b

e

d

Figure 7: (a) A molecule N4S4F4; (b) VDP of a nitrogen atom; (c) molecular VDP (dotted lines confine
boundary surfaces); (d) smoothed and (e) lattice molecular VDPs.

3.1.2. Generating hydrogen positions
Parameters of atomic VDPs are used in the program HSite intended for the calculation of the coordinatesof H atoms connected to X atoms (X = B, C, N, O, Si, P, S, Ge, As, Se) depending on their nature,hybridization type and arrangement of other atoms directly non-bonded with the X atoms. In comparison
with known similar programs HSite has some additional features:(i) At the determination of the hybridization type of an atom X the Me…X contacts of different type (σ orπ) between metal (Me) and X atoms are taken into account.
(ii) During the generation of H atoms in groups with rotational degrees of freedom, the search for an
optimal orientation of the group is fulfilled depending on the arrangement and size of the surrounding
atoms. In turn, the sizes of these atoms are approximated by their Rsd values. In the determination of the
optimal orientation the effects of repulsion in H…H contacts are considered and the possibility of theappearance of hydrogen bonds O(N)–H …O(N) is taken into account.
The HSite algorithm includes the following steps:(i) Searching for X atoms, which can be potentially linked with hydrogen atoms.
(ii) Determination of the hybridization (sp, sp2 or sp3) of these atoms in accordance with the following
criteria:• B, Si and Ge atoms may have the sp3 hybridization only.
• O, P, S, As and Se atoms may have the sp2 or sp3 hybridization only.
• C and N atoms may have any type of hybridization.

Page 18

19

••

Bonds with metal atoms are taken into account at the determination of hybridization only if they form
σ-bonds with X atoms. HSite automatically determines the type of Me–X bonds (σ or π) using the following criterion: a pair of X atoms is involved into a π bonding with a Me atom if they are also linked
X X
together, i.e. there is a triple Me .
The types of hybridization are distinguished depending on the parameters of valence bonds formed by
X atoms with other L atoms:
Total number of X–L
bonds
any
1
1
1
2
2
2
3

Number of bonds with
L=C, N, O, S, Se
0
1
1
1
1, 2
1, 2
1, 2
1, 2, 3

3

1, 2, 3

Numerical criterion

Hybridizationnone
R(X-L)≤Rmax(sp)R(X-L)≤Rmax(sp2)
R(X-L >Rmax(sp2)∠ L–X–L ≥ ∠min(sp)R(X-L1)+R(X-L2)<RΣ(sp3)
R(X-L1)+R(X-L2)≥RΣ(sp3)∠ L1–X–L2 + ∠ L1–X–L3+ ∠ L2–X–L3 > ∠Σ(sp2)∠ L1–X–L2 + ∠ L1–X–L3+ ∠ L2–X–L3 ≤ ∠Σ(sp2)

sp3
sp
sp2
sp3
sp
sp2
sp3
sp2
sp3

The criteria Rmax(sp), Rmax(sp2), RΣ(sp3) have the default values 1.30, 1.40 and 2.90 Å for X, L= C, N andO, respectively. If X or L atom is of the 3rd or the 4th period, then the Rmax(sp2) criterion is increased by
0.4 or 0.5 Å, respectively, and RΣ(sp3) is increased by 0.8 or 1.0 Å. If a boron atom participates in thebond, all values increase by 0.11 Å.
(iii) The site symmetry of X and L positions is taken into account. If necessary, the type of hybridizationof X atom and the number of hydrogen atoms to be added are corrected. For example, if the above
mentioned criteria show that a carbon atom is in sp3 hybridization and should form a methyl group, but itssite symmetry is C2, then its true hybridization is assumed to be sp2 and it really forms a planar CH2
group.
(iv) Positions of hydrogen atoms are determined with the following geometric criteria:• Bond angles ∠H-X-H depend only on the type of hybridization of the X atom and are equal to 180,
120 and 109.47° for sp-, sp2 and sp3 hybridization, respectively.
• For the sp2 hybridization in the group L2XH the condition ∠L1–X–H = ∠L2–X–H must hold.
• For the sp3 hybridization in the group L2XH2 two additional hydrogen atoms must lie in the plane perpendicular to the plane passing through the L1, L2 and X atoms. In the case of the group L3XH the
condition ∠L1-X-H = ∠L2-X-H = ∠L3-X-H must hold.
• Lengths of the bonds O-H, N-H and C-H are equal 0.96, 1.01 and 1.09 Å by default and may bechanged. If the X atom is of the 3rd or the 4th period the bond length will be additionally increased by
0.4 or 0.5 Å, respectively. For example, the length of Se–H bond will be 1.46 Å.
• If the atomic group has rotational degrees of freedom, its optimal orientation is searched in the following way: the group rotates with a small step (5° by default), for each orientation the minimum distance(Rmin) is found from hydrogen atoms of the group to other atoms except of the atom X itself, normalized by the Rsd values for these atoms. The orientation with maximum Rmin assumes to be optimal. For
isolated groups (H2O, NH4+, CH3–, etc.) all possible orientations of the primary axis of inertia are additionally verified by scanning an independent region of the spherical coordinate system; the sphericalcoordinates ϕ and θ vary also with the 5° step. If the H bonds are considered, they take priority at thedetermination of the orientation. The conditions R(H…X)≤Rmax(HBond) and ∠X–H…X >Page 1920

•∠min(HBond) are used for distinguishing H bonds. A mandatory condition during searching for theorientation is that the distances between hydrogen atoms and other atoms, except the atoms participating in H bonds, must be more than 2 Å (by default). If this condition cannot be obeyed, the program
error 'Atom X is invalid' is generated. The orientation of bridge groups XHn binding several metal atoms is a special case. At that the orientation of the primary axis of inertia of the group is consideredpassing through the centroid of the set of metal atoms and through the X atom itself. The exception is
the planar CH3+ cation whose orientation may be different taking into account the aforesaid criteria.
Boron atoms are assumed to be in the composition of carboran or borohydride ions. The generation ofhydrogens is not provided for boranes.

(v) If there are 'pseudo-bonds' Me–X the parameter Rmax(Me) (5 Å by default) may be useful whichcorresponds to maximum allowable length of the Me–X bonds to be considered at the determination of
the geometry and orientation of the XHn group. To avoid the 'pseudo-bonds' the Rmax(Me) may bedecreased.
(vi) By default all groups assume to be electroneutral; the valence of the X atoms supposes to be standard
and equal to 8 minus number of corresponding group of Periodic Table. If a group is an ion (for example,
X-NH3+ or OH–), it may be taken into account by setting corresponding HSite options('Hydroxide/amide-anions' or 'Hydroxonium/ammonium-cations').

3.2. Topological analysis: general scheme
Topological analysis is the main TOPOS destination; many modern methods have recently been
implemented, and new features appear every year. Below the general scheme of the analysis (Scheme 4)
and basic algorithms are considered.

Scheme 4: Topological analysis of a crystal structure in TOPOS.

As follows from Scheme 4 there are three representations of crystal structure in TOPOS: as an atomic net,
as a net of voids and channels, and as an atomic packing. The main branch of the scheme begins withgenerating atomic net as a labelled quotient graph (part 2.1). The subsequent analysis should be
performed with program ADS.

3.2.1. Analysis of atomic and molecular nets
To analyze the adjacency matrix of the labelled quotient graph ADS uses the sets of origin {OA},
removed {RA}, contracted {CA}, and target {TA} atoms (part 2.3) to be specified by user. There are twomodes of the analysis: Atomic net ({OA}≠∅) and Molecular net ({OA}=∅). The algorithm of the firstmode consists of the following steps:(i) All {RA} are removed from the adjacency matrix.
Page 20

21

procedure Remove_RA(output AdjMatr)for i:=1 to NAtoms do
begin
if Atoms[i] ∈ {RA} then atom must be removed
repeatlooking for AdjMatr[k1].i=i or AdjMatr[k1].j=i
AdjMatr[k1].m:=0 'not a contact' flag
until no AdjMatr[k1].i=AdjMatr[k].j or AdjMatr[k1].j=i
end(ii) All {CA} form ligands.
procedure Form_Ligands(output Ligands)
for i:=1 to NAtoms do
begin
if Atoms[i]∈{CA} and Atoms[i]∉{Ligands} then atom forms new ligand
begin
new Ligands[j]add Atoms[i] to Ligands[j]for Atoms[k] ∈ Ligands[j] dorepeatlooking for AdjMatr[k1].i=k
if Atoms[AdjMatr[k1].j]∈{CA} then add Atoms[AdjMatr[k1].j] to Ligands[j]until no AdjMatr[k1].i=k
end
end(iii) All {CA} are contracted to {TA}. A simplified net is obtained as a result.
procedure Contract_CA_to_TA(output AdjMatr)for i:=1 to NAtoms do
begin
if Atoms[i] ∈ {TA} then target atom is foundrepeatlooking for AdjMatr[k].i=i, i.e. the record corresponding to Atoms[i]if Atoms[AdjMatr[k].j] ∈ {CA} then surrounding atom must be contracted
repeatlooking for AdjMatr[k1].i=AdjMatr[k].j
AdjMatr[k1].i:=AdjMatr[k].i
looking for AdjMatr[k2].j=AdjMatr[k].j
AdjMatr[k2].j:=AdjMatr[k].iuntil no AdjMatr[k1].i=AdjMatr[k].jdelete AdjMatr[k]until no AdjMatr[k].i=i
end

The second mode differs from the first one by additional procedure of determining molecular units to be
fulfilled after the first step. In this case initially {OA}={CA}={TA}=∅, but there should be at least two
different kinds of bond in adjacency matrix: intramolecular and intermolecular. A typical situation iswhen the intramolecular bonds are valence (AdjMatr[k].i=1) and intermolecular bonds arehydrogen, specific or/and van der Waals (AdjMatr[k].i=2,3,4). As a result of the additional (ia)step, all atoms fall into {CA} set, and molecular centroids ('pseudo-atoms', PA) are input into {OA} and{TA} sets. Subsequent passing the steps (ii) and (iii) results in the connected net of molecular centroids.
(ia) Searching for molecular units (Molecular net mode).
procedure Form_Molecules(output Molecules, AdjMatr)for i:=1 to NAtoms do
Page 2122

beginif Atoms[i]∉{CA} and Atoms[i]∉{Molecules} then atom forms new molecule
begin
new Molecules[j]add Atoms[i] to Molecules[j]add Atoms[i] to {CA}for Atoms[k] ∈ Molecules[j] dorepeatlooking for AdjMatr[k1].i=k
if AdjMatr[k1].m=1 thenbegin
add Atoms[AdjMatr[k1].j] to Molecules[j]add Atoms[AdjMatr[k1].j] to {CA}end
until no AdjMatr[k1].m=1
call Calc_Centroid(Molecules[j], output PA[j])add PA[j] to {OA}
add PA[j] to {TA}NAtoms:=NAtoms + 1
Atoms[NAtoms]:=PA[j]for Atoms[k] ∈ Molecules[j] do
begin
new AdjMatr[k1]AdjMatr[k1].i:=NAtoms
AdjMatr[k1].j:=k
AdjMatr[k1].m:=1
looking for AdjMatr[k2].i=k
AdjMatr[k2].j:=NAtoms
end
end
end

Both modes result in a simplified network array corresponding to the structural motif at a given crystal
structure representation encoded by the collection ({OA}, {RA}, {CA}, {TA}) (cf. part 2.3). The net
nodes are formed by the {OA} set; the resulted and initial nets are the same if {RA}={CA}={TA}=∅ in
the Atomic net mode.
The network array may consist of several nets of the same or different dimensionality (0D–3D). Before
topological classification ADS distinguishes all molecular (0D) groups, chain (1D), layer (2D) andframework (3D) nets in the array as is shown in the output for ODAHEG7.
For each net ADS computes basic topological indices CS+ES+VS and several additional ones using
original algorithms based on successful analysis of coordination shells. The algorithms have a number ofadvantages over described in the literature (Goetzke & Klein, 1991; O’Keeffe & Brese, 1992; Yuan &Cormack, 2002; Treacy et al., 2006):
•
•
•
•
•

No distance matrix D×D is used, so the calculation is not memory-limited.
There are no limits to the node degree (CN).
Smallest circuits are computed along with smallest rings.
All rings, not only smallest, can be found within a specified ring size.
Strong rings can be computed.

An example of TOPOS output with dimensionalities of structural groups in ODAHEG########################################################################################
5;RefCode:ODAHEG:(C48 H60 CU1 N8 O6)N, 2N(C32 H42 CU1 N5 O4 +), 2N(N1 O3 -), N(C2 H6 O1)
Author(s): PLATER M.J.,FOREMAN M.R.ST.J.,GELBRICH T.,HURSTHOUSE M.B.
Journal: CRYSTAL ENGINEERING Year: 2001 Volume: 4 Number: Pages: 319
7

The CSD Reference Code.
Page 2223

#########################################################################################------------------------Structural group analysis------------------------------------------------Structural group No 1------------------------Structure consists of chains [ 0 1 0] with CuO6N8C48H56
2-c net------------------------Structural group No 2------------------------Structure consists of chains [ 0 0 1] with CuO4N5C32H422-c netElapsed time: 6.36 sec.

By computing all rings user can distinguish topologically different nets with the same CS+ES+VS
combination. At present such examples are revealed only among artificial nets. The output has thefollowing format:
An example of TOPOS output with all-ring Vertex symbols for rutile
Vertex symbols for selected sublattice-------------------------------------O1 Schlafli symbol:{4;6^2}
With circuits:[4.6(2).6(2)]Rings coincide with circuits
All rings (up to 10): [(4,6(2)).(6(2),8(6)).(6(2),8(6))]-------------------------------------Ti1 Schlafli symbol:{4^2;6^10;8^3}With circuits:[4.4.6.6.6.6.6.6.6.6.6(2).6(2).8(2).8(4).8(4)]With rings:[4.4.6.6.6.6.6.6.6.6.6(2).6(2).*.*.*]All rings (up to 10):[4.4.(6,8(3)).(6,8(3)).(6,8(3)).(6,8(3)).(6,8(3)).(6,8(3)).(6,8(3)).(6,8(3)).6(2).6(2).*.*.*]ATTENTION! Some rings * are bigger than 10, so likely no rings are contained in that angle-------------------------------------Total Schlafli symbol: {4;6^2}2{4^2;6^10;8^3}

In this case all rings were constructed up to 10-ring. So possibly larger rings exist - TOPOS
does not know this!
The notation
All rings (up to 10): [(4,6(2)).(6(2),8(6)).(6(2),8(6))]

means that not only 4- (or 6-) rings, but also longer 8-rings meet at the same angle of the first
non-equivalent node (oxygen atom, cf. ES or VS). There is still no conventional notation; it mightlook as: [(4,62).(62,86).(62,86)].

Resting upon the CS+ES+VS combination ADS searches for the net topological type in the TTD
collection (part 2.2). Besides these basic indices, all rings and strong rings can be used for more detailed
description of the net topology. A fragment of ADS output with the computed indices and the conclusion
about the net topology is given below.
##################
63;RefCode:nbo:nbo
Author(s): Bowman A L,Wallace T C,Yarnell J L,Wenzel R G
Journal: Acta Crystallographica (1,1948-23,1967) Year: 1966 Volume: 21 Number:##################
Topology for C1-------------------Atom C1 links by bridge ligands and has
Common vertex with
C 1
0.00000.50000.0000(-1 0 0)C 1
0.00000.50001.0000(-1 0 1)

R(A-A)
1.000A
1.000A

Page 23

Pages: 843

1
1

24

C
C

1
1

0.00000.00000.00001.00000.50000.5000( 0-1 0)( 0 0 0)1.000A
1.000A

1
1

Coordination sequences---------------------C1: 1 2 3 4
5
6
7
8
9
10
Num 4 12 28 50 76 110 148 194 244 302
Cum 5 17 45 95 171 281 429 623 867 1169---------------------TD10=1169
Vertex symbols for selected sublattice-------------------------------------C1 Schlafli symbol:{6^4;8^2}With circuits:[6(2).6(2).6(2).6(2).8(6).8(6)]With rings:[6(2).6(2).6(2).6(2).8(2).8(2)]All rings (up to 10): [(6(2),8).(6(2),8).(6(2),8).(6(2),8).8(2).8(2)]All rings with types: [(6(2),8).(6(2),8).(6(2),8).(6(2),8).8(2).8(2)]-------------------------------------Total Schlafli symbol: {6^4;8^2}4-c net; uninodal net
Topological type: nbo NbO; 4/6/c2 {6^4;8^2} - VS [6(2).6(2).6(2).6(2).8(2).8(2)]bases)(18802 types in 6 data-

Strong rings (MaxSum=6): 6
Non-strong ring: 8=6+6+6+6
Elapsed time: 1.00 sec.

4
3

B

1
A
2

a

b

c

d

Figure 8: (a) Intersecting 8-rings (Hopf link) in self-catenating coesite; one of the rings is triangulated.
(b) Two orientations (positive and negative) of the same 4-ring in body-centred cubic lattice determinedas cross-products A×B and B×A. The black ball is the ring centroid. The direction of the ring tracing(1234) coincides with the A direction. (c) Non-Hopf link between 6- and 10-ring in self-catenating ice II.
(d) Double link between 8-rings in interpenetrating array of two quartz-like nets.

If there are more than one nets in the array ADS determines the type of their mutual entanglement(polythreading, polycatenation, interpenetration and self-catenation) according to principles described by
Carlucci et al. (2003), Blatov et al. (2004). Analysis of 0D–2D (low-dimensional) entanglements is basedon searching for the intersections of rings by bonds not belonging to these rings. Since, generally
speaking, the rings are not flat, they are represented as a facet surface by a barycentric subdivision(triangulation, Fig. 8a). The ring surface has two opposite orientations (positive and negative), and thering boundary has a distinct direction of tracing (Fig. 8b). Let us call the ring intersection positive if thebond making an intersection within the boundary of the ring is directed to the same half-space as thevector of positive ring orientation, and negative otherwise. If there is the single ring intersection (positiveor negative) the link between rings is always true (Hopf, Fig. 8a). If the numbers of positive and negativeintersections are the same, the link can be unweaved (it is false, non-Hopf link, Fig. 8c), if the difference
between the numbers is more than a unity, the link is multiple (Fig. 8d). ADS determines the link types;
the real entanglement exists if there is at least one true (Hopf or multiple) link. Then ADS outputs the typeof the entanglement (see Example 1). A special case is the entanglement of several 3D nets (3Dinterpenetration), when the information is output about Class of interpenetration (Blatov et al., 2004) andsymmetry operations relating different 3D nets (Example 2).
Example 1. 2D+2D, inclined polycatenation (Fig. 9a)########################################
6;RefCode:LETWAI:C24 H24 Cu4 F12 N12 Si2Page 24

25

Author(s): Macgillivray L.R.,Subramanian S.,Zaworotko M.J.
Journal: CHEM.COMMUN. Year: 1994 Volume: Number: Pages: 1325########################################
Topology for Cu1-------------------Atom Cu1 links by bridge ligands and has
Common vertex with
R(A-A)
Cu 1
0.7063-0.20630.0000( 1 0 0)6.937ACu 1
0.20630.2937-0.5000( 0 0-1)
6.685ACu 1
0.20630.29370.5000( 0 0 0)6.685A------------------------Structural group analysis------------------------------------------------Structural group No 1------------------------Structure consists of layers ( 1 1 0); ( 1-1 0) with CuN3C6H6

f
1
1
1

Vertex symbols for selected sublattice-------------------------------------Cu1 Schlafli symbol:{6^3}With circuits:[6.6.6]-------------------------------------Total Schlafli symbol: {6^3}3-c net----------------------Non-equivalent circuits----------------------Circuit No 1; Type=6; Centroid: (0.500,0.000,0.500)-----------------------------Atomxyz-----------------------------Cu1
0.2937 0.2063 1.0000
Cu1
0.7063 -0.2063 1.0000
Cu1
0.7937 -0.2937 0.5000
Cu1
0.7063 -0.2063 0.0000
Cu1
0.2937 0.2063 0.0000
Cu1
0.2063 0.2937 0.5000
Crossed with bonds-----------------------------------------------------------------------------------------------No | Atomxyz
| Atomxyz|Dist. | N Cycles-----------------------------------------------------------------------------------------------1 | Cu1
0.2937 -0.2063 0.5000 | Cu1
0.7063 0.2063 0.5000 |
6.937 | 6/inf 6/inf-----------------------------------------------------------------------------------------------Ring links-----------------------------------------------------Cycle 1 | Cycle 2 | Chain | Cross | Link | Hopf | Mult-----------------------------------------------------6 |6 | inf. |
1 |
1 |
* |
2
-----------------------------------------------------Polycatenation-------------Groups
1: 2D, CuN3C6H6 (Zt=1); (1,1,0); (1,-1,0)
Types---------------------------------------------------Group 1 | Orient. | Group 2 | Orient. | Type---------------------------------------------------1 |1,1,0 |
1 | 1,-1,0 | 2D+2D, inclined---------------------------------------------------Elapsed time: 2.14 sec.

Page 25

26

Figure 9: (a) Entangled 2D layers in the crystal structure of LETWAI. The nets are simplified at{OA}={TA}={Cu}. (b) Interpenetrating 3D nets in the cuprite (Cu2O) crystal structure.
Example 2. Interpenetration of two 3D nets in cuprite, Cu2O (Fig. 9b)####################
7;RefCode:63281:Cu2O
Author(s): Restori R,Schwarzenbach D
Journal: Acta Crystallographica B (39,1983-) Year: 1986 Volume: 42 Number:####################

Pages: 201-208------------------------Structural group analysis------------------------------------------------Structural group No 1------------------------Structure consists of 3D framework with Cu2O
There are 2 interpenetrated nets
FIV: Full interpenetration vectors---------------------------------[0,1,0] (4.27A)[0,0,1] (4.27A)[1,0,0] (4.27A)---------------------------------PIC: [0,2,0][0,1,1][1,1,0] (PICVR=2)
Zt=2; Zn=1
Class Ia

Z=2

Vertex symbols for selected sublattice-------------------------------------O1 Schlafli symbol:{12^6}
With circuits:[12(2).12(2).12(2).12(2).12(2).12(2)]-------------------------------------Cu1 Schlafli symbol:{12}With circuits:[12(6)]-------------------------------------Total Schlafli symbol: {12^6}{12}22,4-c net with stoichiometry (2-c)2(4-c)----------------------Non-equivalent circuits----------------------Circuit No 1; Type=12; Centroid: (0.000,0.500,0.500)-----------------------------Atomxyz-----------------------------O1
0.2500 0.2500 1.2500
Cu1
0.5000 0.5000 1.0000
O1
0.7500 0.7500 0.7500
Cu1
0.5000 1.0000 0.5000
O1
0.2500 1.2500 0.2500
Cu1
0.0000 1.0000 0.0000
O1-0.2500 0.7500 -0.2500
Cu1-0.5000 0.5000 0.0000
O1-0.7500 0.2500 0.2500
Cu1-0.5000 0.0000 0.5000
O1-0.2500 -0.2500 0.7500
Cu1
0.0000 0.0000 1.0000
Crossed with bonds-----------------------------------------------------------------------------------------------No | Atomxyz
| Atomxyz|Dist. | N Cycles-----------------------------------------------------------------------------------------------1 | O1
-0.2500 0.7500 0.7500 | Cu1
0.0000 0.5000 0.5000 |
1.848 | 12/inf 12/inf
12/inf 12/inf 12/inf 12/inf
1 | O10.2500 0.2500 0.2500 | Cu1
0.0000 0.5000 0.5000 |
1.848 | 12/inf 12/inf
12/inf 12/inf 12/inf 12/inf-----------------------------------------------------------------------------------------------Ring links-----------------------------------------------------Cycle 1 | Cycle 2 | Chain | Cross | Link | Hopf | Mult-----------------------------------------------------12 |12 | inf. |
1 |
1 |
* |
6
------------------------------------------------------

Page 26

27

Elapsed time: 5.75 sec.

ADS uses the information about ring intersections to construct natural tiling (Delgado-Friedrichs &O’Keeffe, 2005) that carries the net. Although the definition for natural tiling has been well known, there
was no strict algorithm of its construction. The main problem is that not all strong rings (Fig. 10a) arenecessary the faces of the tiles, but only essential ones (Delgado-Friedrichs & O’Keeffe, 2005; Fig. 10b).
At the same time no criteria were reported to distinguish essential strong rings, so they can be determined
only after constructing the natural tiling.

a

b

c

Figure 10: (a) Closed sum of strong 5,6-rings (magenta) and non-strong 18-ring (yellow) in fullerene. (b)Two tiles, essential (green) and inessential (red) strong rings in the natural tiling of body-centred cubic
net. (c) Two intersecting equivalent inessential rings (red and yellow) in the tile.

ADS uses the following definition of essential strong ring: this is strong ring that intersects no otheressential strong rings. There are two types of such intersections: homocrossing and heterocrossing, when
the intersecting rings are equivalent (Fig. 10c) or inequivalent. The rings participating in a homocrossing
are always inessential, the rings participating in only heterocrossings can be essential in an appropriate
ring set, otherwise the ring is always essential. Thus, the algorithm of searching for essential rings
consists of the following steps:(i) Compute all rings within a given range. Because even the rings of the same size are not always
symmetrically equivalent, TOPOS can distinguish them by assigning types. The types are designated by
one or more letters: a-z, aa-az, ba-bz, etc., for example, 4a, 12ab, 20xaz. As a result a typed all-ringVertex symbol is calculated:

Page 2728

An example of TOPOS output with typed all-ring Vertex symbols for rutile
Vertex symbols for selected sublattice-------------------------------------O1 Schlafli symbol:{4;6^2}
With circuits:[4.6(2).6(2)]Rings coincide with circuits
All rings (up to 10): [(4,6(2)).(6(2),8(6)).(6(2),8(6))]
All rings with types: [(4,6(2)).(6(2),8a(4),8b(2)).(6(2),8a(4),8b(2))]-------------------------------------Ti1 Schlafli symbol:{4^2;6^10;8^3}With circuits:[4.4.6.6.6.6.6.6.6.6.6(2).6(2).8(2).8(4).8(4)]With rings:[4.4.6.6.6.6.6.6.6.6.6(2).6(2).*.*.*]All rings (up to 10):[4.4.(6,8(3)).(6,8(3)).(6,8(3)).(6,8(3)).(6,8(3)).(6,8(3)).(6,8(3)).(6,8(3)).6(2).6(2).*.*.*]All rings with types:[4.4.(6,8a(2),8b).(6,8a(2),8b).(6,8a(2),8b).(6,8a(2),8b).(6,8a(2),8b).(6,8a(2),8b).(6,8a(2),8b).(6,8a(2),8b).6(2).6(2).*.*.*]ATTENTION! Some rings * are bigger than 10, so likely no rings are contained in that angle-------------------------------------Total Schlafli symbol: {4;6^2}2{4^2;6^10;8^3}

For example, the first angle for the first node (oxygen atom) contains two non-equivalent 8rings. There is no conventional notation for typed all-ring Vertex symbol. We propose thefollowing one: [(4,62).(62,8a4,8b2).(62,8a4,8b2)].

(ii) Select strong rings. All non-strong rings are output as sums of smaller rings:
An example of TOPOS output with strong and non-strong rings for zeolite MTF
Strong rings (MaxSum=8): 4,5a,5b,5c,5d,6a,6b,6c,6d,8a,8b
Non-strong ring: 7=5d+6c+6d
Non-strong ring: 12=4+5a+5a+5b+5b+6a+8a+8b(iii) Find all rings intersected by bonds (in entangled structures) and reject them. This condition isrequired because tile interior must be empty.
(iv) For all remaining rings find their intersections.
(v) Reject all rings participating in homocrossings.
(vi) Arrange all remaining rings into the sets, where no intersecting rings exist. The sets are maximal, i.e.
no other ring can be added to the set to avoid heterocrossings.
Each of the sets obtained is then checked to produce a natural tiling. Starting from the first ring of the set
and taking one of two possible ring orientations (Fig. 8b) ADS adds another ring to an edge of the initialring to get a ring sum. For instance, three pentagonal and three hexagonal rings can be added to thecentral hexagonal ring in Fig. 10a. In 3D nets several (at least three) rings are adjacent to any edge, so
there is an ambiguity at this step. To get over this problem and to speed up the calculation the dihedral
angles are computed between each of the trial rings and the initial ring. Really these are the angles
between normals to ring facets (triangles) based on the edge of the initial ring (Fig. 11a). Since the facets
are oriented, the angles vary in the range 0-360°. Let us consider two facets of two trial rings 1 and 2(candidates to be the tile face) with different angles ϕ1 and ϕ2; ϕ2>ϕ1. Obviously, if we choose the ring 2,
this means that the tile intersects another tile to which the ring 1 belongs. So, the target ring for natural
tile can be unambiguously chosen at each step as the ring with minimal dihedral angle ϕmin. Then the next
ring is added to any of free, i.e. belonging to only one ring, edge of the sum. The procedure repeats until
no free edges remain, i.e. sum becomes closed (Fig. 10a). The closed ring sum is one of the natural tiles.
Then the procedure starts again for the opposite orientation of the initial ring. As a result the initial ring
becomes shared between two natural tiles (Fig. 11b). Then ADS considers all other inequivalent rings in
the same way. Thus, all tiles forming the natural tiling are obtained with the following algorithm.
Page 28

29

procedure Natural_Tiling(output Tiles)
NumTiles:=0
for i:=1 to NStrongRings do
begin
NumTiles:=NumTiles + 1
add StrongRings[i] to Tiles[NumTiles] initialize new tilefor j:=1 to 2 do j is an orientation number for the first ring of the tile
begin
repeatcall AddRing(j, output Tiles[NumTiles]) add new ring to the tile
until no new ring is added to Tiles[NumTiles]
end
end

Figure 11: (a) Some 4-rings sharing the same (red) edge in body-centred cubic net. The grey facet is the
facet of the initial ring; the yellow one has smaller ϕ than the green one. The black balls are the rings
centroids. (b) 4-ring (red) shared between two natural tiles. (c) Two natural tiles shared by red face in an
MPT of the idealized net bcw.

Then ADS determines a number of geometrical and topological characteristics of tiles and tiling(Delgado-Friedrichs & O’Keeffe, 2005). The resulted output looks as shown below (the sodalite net
example).
The physical meaning of the tiles is that they correspond to minimal cages in the net. Using these ‘bricks’
ADS can construct larger tiles by summarizing natural tiles (merging them by faces). In this way, maximal
proper tiles (MPT) and tiling can be obtained representing maximal cages allowed by a given net
symmetry (Fig. 11c).
Resting upon the tiling ADS can construct dual net, whose nodes, edges, rings and tiles map onto tiles,
rings, edges and nodes of the initial net (Delgado-Friedrichs & O’Keeffe, 2005). In particular, nodes andedges of the dual net describe the topology of the system of cages and channels in the initial net (Fig. 12).
The data on the dual net are stored in a TOPOS database, so the dual net can be studied as an ordinal net
including generation of dual net (‘dual dual net’).

Figure 12: Initial net (cyan balls) and dual net (yellow sticks) in sodalite.

Page 2930

An example of TOPOS output for natural tiling in sodalite net#################
3;RefCode:sod:sod#################
Topology for C1-------------------Atom C1 links by bridge ligands and has
Common vertex with
C 1
0.50000.00000.2500( 1 0 0)C 1
0.50000.00000.7500( 1 0 1)C 1
0.00000.25000.5000( 0 0 1)C 1
0.0000-0.2500
0.5000( 0 0 1)

R(A-A)
0.707A
0.707A
0.707A
0.707A

1
1
1
1

Vertex symbols for selected sublattice-------------------------------------C1 Schlafli symbol:{4^2;6^4}
With circuits:[4.4.6.6.6.6]
Rings coincide with circuits
Rings with types: [4.4.6.6.6.6]-------------------------------------Total Schlafli symbol: {4^2;6^4}4-c netEssential rings by homocrossing: 4,6
Inessential rings by homocrossing: none----------------------------Primitive proper tiling No 1----------------------------Essential rings by heterocrossing: 4,6
Inessential rings by heterocrossing: none
Natural tiling24/14:[4^6.6^8]; Centroid:(0.500,0.500,0.500); Volume=4.000; G3=0.078543------------------------------Atomxyz------------------------------C1
0.5000 0.2500 0.0000
C1
0.5000 0.0000 0.2500
C1
0.7500 0.0000 0.5000
C1
0.2500 0.0000 0.5000
C1
0.5000 0.0000 0.7500
C1
0.5000 0.2500 1.0000
C1
0.0000 0.2500 0.5000
C1
0.2500 0.5000 0.0000
C1
0.0000 0.5000 0.2500
C1
0.7500 0.5000 0.0000
C1
0.5000 0.7500 0.0000
C1
1.0000 0.2500 0.5000
C1
1.0000 0.5000 0.2500
C1
0.7500 0.5000 1.0000
C1
1.0000 0.5000 0.7500
C1
1.0000 0.7500 0.5000
C1
0.0000 0.7500 0.5000
C1
0.0000 0.5000 0.7500
C1
0.2500 0.5000 1.0000
C1
0.5000 0.7500 1.0000
C1
0.5000 1.0000 0.2500
C1
0.7500 1.0000 0.5000
C1
0.5000 1.0000 0.7500
C1
0.2500 1.0000 0.5000
Tiling: [4^6.6^8]
Transitivity: [1121]
Simple tiling
All proper tilings (S=simple; I=isohedral)-----------------------------------------------------------Tiling| Essential rings | Transitivity | Comments | Tiles-----------------------------------------------------------PPT 1/NT | 4,6| [1121]| MPT SI| [4^6.6^8]-----------------------------------------------------------Elapsed time: 2.55 sec.

Page 3031

3.2.2. Analysis of systems of cavities and channels
Quite another way to get the system of cages and channels is to consider Voronoi-Dirichlet partition (part2.1) and to analyze the net of VDP vertices and edges, Voronoi-Dirichlet graph (Fischer, 1986). The
principal difference between tiling and Voronoi-Dirichlet approaches is that the former approach is purely
topological and derives the cages and channels from the topological properties of the initial net, whereas
the latter one treats the geometrical properties of crystal space for the same purpose. Here the geometricaland topological parts of TOPOS are combined with each other.
The main notions of the Voronoi-Dirichlet approach are elementary void and elementary channel. Some
their important properties to be used in TOPOS algorithms follow from the properties of VoronoiDirichlet partition.
Elementary void properties(i) The elementary void is equidistant to at least four noncoplanar atoms (tetrahedral void) since no lessthan four VDPs meet in the same vertex (Fig.13a). There are two types of elementary voids: major, if its
centre is allocated inside the polyhedron, whose vertices coincide with the atoms forming the elementary
void (for instance, inside the tetrahedron for a tetrahedral void, Fig.13a); and minor, if its centre lies
outside or on the boundary of the polyhedron (Fig.13b).
(ii) There are additional atoms at longer distances than the atoms of elementary void that can strongly influence the geometrical parameters of the elementary void. To find these parameters, one should construct
the void VDP taking into account all atoms and other equivalent elementary voids (Fig.13c). Let us callthe atoms and voids participating in the VDP formation environmental. Obviously, the atoms forming theelementary void are always environmental.
(iii) Radius of elementary void (Rsd) is the radius of a sphere, whose volume is equal to the volume of thevoid VDP constructed with consideration of all environmental atoms and voids.
(iv) Shape of elementary void is estimated by G3 value for the void VDP constructed with allenvironmental atoms and voids (Fig.13c).

a

b

c

Figure 13: (a) Four VDPs meeting in the same vertex (red ball) in the body-centred cubic lattice. (b) A
minor void (ZC2) allocated outside the tetrahedron of the three yellow oxygen atoms and zirconium atom
forming this void in the crystal structure of NASICON, Na4Zr2(SiO4)3. All distances from ZC2 to theoxygen and zirconium atoms are equal 1.722 Å. (c) The form of an elementary void in the NaCl crystal
structure. All environmental atoms and one void are yellow; Rsd =1.38 Å, G3=0.07854.

Page 31

32

Elementary channel properties(i) The elementary channel is formed by at least three noncollinear atoms since in the Voronoi-Dirichlet
partition each VDP edge is shared by no less than three VDPs. The plane passing through these atoms isperpendicular to the line of the elementary channel (Fig. 14a).
(ii) Section of the elementary channel is a polygon whose vertices are the atoms forming the channel; thesection always corresponds to the narrowest part of the channel. The line of the elementary channel isalways perpendicular to its section; ordinarily, the channel section and channel itself are triangular (Figs.
14a, b). The elementary channel can be of two types: major, if its line intersects its section (Fig. 14a), andminor, if the line and section have no common points, or one of the line ends lies on the section (Fig.
14b).
(iii) Radius of the elementary channel section is estimated as a geometric mean for the distances from theinertia centre of the elementary channel section to the atoms forming the channel. The atom can freely
pass through the channel if the sum of its radius and an averaged radius of the atoms forming the channel
does not exceed the channel radius.
(iv) Length of elementary channel is a distance between the elementary voids connected by the channel,
i.e. is the length of corresponding VDP edge.

ab

Figure 14: (a) Section of a triangular major elementary channel in the crystal structure of α-AgI. The
channel line is red. The atoms forming the channel are in the vertices of the triangular section intersecting
the channel line in the black ball. (b) A fragment of the channel system in the crystal structure of
NASICON. The line of a minor elementary channel is red, the oxygen atoms forming this channel are
yellow. Other minor elementary channels are shown by dotted lines.

The Voronoi-Dirichlet approach is implemented into the program Dirichlet as the following generalalgorithm:(i) constructing VDPs for all independent framework atoms, i.e. a Voronoi-Dirichlet partition of thecrystal space (interstitial particles including mobile ions or solvate molecules are ignored);(ii) determining the coordinates for all independent vertices of atomic VDPs, and, as a result, thecoordinates of all elementary voids;(iii) determining all independent VDP edges, and, hence, all elementary channels;(iv) calculating the numerical parameters of elementary voids and channels.
Page 32

33

The information on the resulted conduction pattern is stored as a three-level adjacency matrix of theVoronoi-Dirichlet graph (Fig. 15).
The first level contains the information on a (central) elementary void. A major elementary void isdesignated as ZA, a minor one is marked as ZB or ZC if it lies respectively on the boundary or outside thepolyhedron of the atoms forming the void. The void radius (Rsd, Å) and second moment of inertia of its
VDP (G3) are also shown.
The second level includes the information on other elementary voids connected with a given (central) one
by channels, and on the atoms of its near environment. Every elementary void is characterized by thelength (R, Å) of the elementary channel connecting it with the central one, by the number of channel
atoms (Chan), and by the channel radius (Rad, Å). If a channel is major, the text is marked bold,otherwise a normal font is applied. Every environmental atom of the central void is characterized by the
distance to the void centre (R, Å), and by the solid angle of corresponding VDP face (SA, in percentageof 4π steradian); the greater SA, the more significant the contact atom–void.
The third level contains the information on the atoms forming the channel; the distances between theatoms and the centre of the channel section are also given.

Figure 15: A TOPOS window containing the information on the adjacency matrix of theVoronoi-Dirichlet graph for α-AgI.

In contrast to the tiling approach, resting upon the adjacency matrix of Voronoi-Dirichlet graph TOPOS
can compute a number of geometrical parameters of cages and channels to be important to predict somephysical properties of the substance, in particular, ionic conductivity and ion-exchange capacity. Note
that, in general, the Voronoi-Dirichlet graph does not coincide with the dual net. The dual net has always
the same topology for any spatial embedding of the initial net, whereas the topology of the VoronoiDirichlet graph depends on the geometrical properties of the crystal space. The physical meanings of theVoronoi-Dirichlet graph parameters are summarized in Table 3; recall that the graph nodes and edges
correspond to elementary voids and channels.
Page 33

34

Table 3: Physical meaning of Voronoi-Dirichlet graph parameters

Parameter
Rsd of nodeG3 of nodeRadius of edge
Length of edge
Connected subgraph
A set of all connected
subgraphs

Meaning
The radius of an atom that can be allocated in the void under the influenceof the crystal field distorting the spherical shape of the atom
Sphericity degree for the nearest environment of the void; the less G3, thecloser the void shape to a sphere
Effective radius of the channel between two voids
Length of the channel between two voids
Migration path, a set of the elementary voids and channels available formobile particles
Conduction pattern of the substance. The dimensionality of the conduction
pattern determines the dimensionality of conductivity (1D, 2D, or 3D)

3.2.3. Analysis of packings
Besides the model of atomic net, TOPOS can use the structure representation as a packing of atoms or
atomic groups. In this case the adjacency matrix of the crystal structure contains interatomic contacts, notbonds. This representation can be obtained running AutoCN in the Solid Angles mode (part 2.1). The
program IsoTest internally uses this mode to enumerate all possible atom packings to be selected in the
crystal structure. IsoTest forms all subsets of the {NAtoms} set of all kinds of atom and generates thepacking net (cf. part 2.3) by considering all faces of atomic VDPs constructed within a given subset. For
instance, for NaCl, there will be considered three ion packings corresponding to the subsets {Na}, {Cl}and {Na, Cl}. For each of them IsoTest computes topological indices and performs topological analysis
according to Scheme 4.

3.2.4. Hierarchical topological analysis
At the highest level of the topological analysis (Scheme 4) IsoTest analyzes all graph representations withthe algorithm described in part 2.3. Simultaneously, IsoTest arranges the compounds by structure types
using the definition of Lima-de-Faria et al. (1990). The results are output into a textual *.it2 file asshown below for comparing simple sulfates with binary compounds.
-----------------Isotypic compounds----------------------------Topological type of 1:Li2(SO4)----------------------------(SO4)+Li
3:CaF2: F+Ca----------------------------Topological type of 6:CaSO4----------------------------(SO4)+Ca
1:NaCl: Na+Cl----------------------------Topological type of 7:ZnSO4----------------------------Structure Type of 34:SiO2 S+Zn<->Si O<->O
Zn+(SO4)
5:ZnS: Zn+S----------------------------Topological type of 17:MgSO4----------------------------(SO4)+Mg
2:NiAs: Ni+As

Page 34

35

In particular, the results show that Li2SO4 relates to the fluorite, CaF2, if sulfate ion is considered as awhole, with the oxygen atoms contracted to the sulfur atom. The similar relations are observed for thepairs CaSO4↔NaCl; ZnSO4↔ZnS; MgSO4↔NiAs. However, ZnSO4 has one more relation tocristobalite, SiO2, if Zn and S atoms correspond to Si atoms.
Thus, the general scheme starts with the analysis of a single net or packing consisting of atoms, ions,molecules, voids, and finishes by the consideration of all possible topological motifs.

4. Processing large amounts of crystal structure data
Most of TOPOS procedures and applied programs can work in two modes, Manual or Continuous,corresponding to handling the single compound or large groups of crystal structures, respectively. The
only exception is IsoCryst, where the Continuous mode is not available. The Continuous mode is not
restricted to the number of entries; the largest world-wide databases, CSD, ICSD, CrystMet, may beprocessed at one computational cycle using the CIF interface. The data obtained in the Continuous modeare output to external files to be handled with TOPOS or other programs. The main Continuous
operations available in TOPOS are listed below.
Operation
DBMS
Copying, moving, deleting, undeleting, searching, retrieving, exporting,importing database entries
Determining chemical composition, searching for errors in data and disordering, transforming adjacency matrix, generating crystal structure representations
ADS
Simplifying atomic net
Computing CS, ES, VS, determining net topology
Determining net entanglements and structure group dimensionality
Selecting molecular crystal structure groups, constructing molecular VDPs,
determining methods of ligand coordination
Constructing tiles, computing parameters of natural tiling
Determining combinatorial types of tile
Constructing dual net
AutoCN
Computing adjacency matrix
DiAn
Computing interatomic distances and bond angles
Dirichlet
Computing atomic VDP parameters
Determining combinatorial types of VDP

Output file format
TOPOS database, textual
files
TOPOS database

TOPOS databasetextual *.nnt, Microsoft Excel-oriented*.txt
Microsoft Excel-oriented*.txt
binary StatPack *.bin
textual *.cgd
binary *.edg, *.pdt,*.vec
TOPOS database
TOPOS databasetextual *.dia, *.ang

Constructing Voronoi-Dirichlet graph
HSite
Determining positions of hydrogen atoms
IsoTestGenerating crystal structure representations, computing CS, ES, VS
Comparing atomic and packing net topologies
Determining structure types
Page 35

binary StatPack *.bin
binary *.edg, *.pdt,*.vec
TOPOS database
TOPOS database
TOPOS databasetextual *.it2
textual *.ist36

5. Outlook
Crystallochemical analysis is still mainly based on the analysis of local geometrical properties of crystal
structures, such as interatomic distances and bond angles. In this manner, crystal chemistry remains to be
stereochemistry to a great extent. Discovering genuine crystallochemical regularities that manage global
properties of crystal structures, such as atomic and molecular net topologies, types of atomic andmolecular packings, sizes and architecture of cages and channels, require new theoretical approaches,computer algorithms and programs. To find these regularities crystal chemists need first to systematize
huge amounts of crystal data collected in the world-wide electronic databases. This job can be done only
by using automated computer methods, and TOPOS is intended to actualize them. The transformation of
crystal chemistry into crystal chemistry notably began 15-20 years ago, but has already given rise to novel
scientific branches, such as supramolecular chemistry, reticular chemistry, crystal engineering and crystal
design. TOPOS program package evolves together with crystal chemistry; new algorithms and procedures
are implemented every year. In this way, the current TOPOS state described above should not be
considered as something completed, but as a foundation for further development.

Acknowledgements
The TOPOS applied programs Dirichlet, IsoCryst and StatPack were mainly written by Dr. A.P.
Shevchenko. I am indebted to my former scientific advisor Prof. V.N. Serezhkin, who initialized theTOPOS project at the end of 1980s and stimulated its development for a long time. I am grateful to Prof.
D.M. Proserpio, who opened my eyes to a lot of crystallochemical problems to apply TOPOS.
Discussions with Prof. M. O'Keeffe, Dr. S.T. Hyde, Dr. O. Delgado-Friedrichs have highly promoted thedevelopment of TOPOS topological algorithms. My PhD students I.A. Baburin, E.V. Peresypkina, M.V.
Peskov spent a lot of time testing novel TOPOS features; their painstaking work enabled me to fix manybugs and provided high TOPOS stability.

References
Blatov, V. A. (2004). Cryst. Rev. 10, 249-318.
Blatov, V. A. (2006). Acta Cryst. A62, 356-364.
Blatov, V. A., Carlucci, L., Ciani, G. & Proserpio, D. M. (2004). CrystEngComm, 6, 377–395.
Carlucci, L., Ciani, G. & Proserpio, D. M. (2003). Coord. Chem. Rev. 246, 247–289.
Chung, S. J., Hahn, Th. & Klee, W. E. (1984). Acta Cryst. A40, 42-50.
Conway, J.H. & Sloane, N.J.A. (1988). Sphere Packings, Lattices and Groups, New York: Springer Verlag.
Delgado-Friedrichs, O. & O’Keeffe, M. (2005). J. Solid State Chem. 178, 2480-2485.
Fischer, W. (1986). Cryst. Res. Technol. 21, 499-503.
Goetzke, K. & Klein, H.-J. (1991). J. Non-Cryst. Solids. 127, 215-220.
Lima-de-Faria, J., Hellner, E., Liebau, F., Makovicky, E. & Parthé, E. (1990). Acta Cryst. A46, 1-11.
O’Keeffe, M. (1979) Acta Cryst. A35, 772-775.
O’Keeffe, M. & Brese, N.E. (1992). Acta Cryst. A48, 663-669.
Peresypkina, E.V. & Blatov, V.A. (2000). Acta Cryst. B56, 1035-1045.
Preparata, F. P. & Shamos, M. I. (1985). Computational Geometry. New York: Springer-Verlag.
Serezhkin, V. N., Mikhailov, Yu. N. & Buslaev, Yu. A. (1997). Russ. J. Inorg. Chem. 42, 1871-1910.
Sowa, H. & Koch, E. (2005). Acta Cryst. A61, 331-342.
Treacy, M.M.J., Foster, M.D. & Randall, K.H. (2006). Microp, Mes. Mater. 87, 255–260.
Yuan, X. & Cormack, A.N. (2002). Comput. Mater. Sci. 24, 343-360.

Page 3637

Appendix - TOPOS Glossary
Atomic domain is a region, which 'belongs' to an atom in crystal space. The notion 'belongs' may be understooddifferently, depending on the task to be solved.
Atomic Voronoi-Dirichlet polyhedron (VDP, Voronoi polyhedron, Dirichlet domain) is a convex polyhedron
whose faces are perpendicular to segments connecting the central atom of VDP (VDP atom) and other(surrounding) atoms; each face divides corresponding segment by half. VDPs of all atoms form normal (face-toface) Voronoi-Dirichlet partition of crystal space.
Circuit (cycle) is a closed chain of connected atoms.
Coordination sequence (CS) {Nk} is a set of sequential numbers N1, N2, … of atoms in 1st, 2nd, etc. coordination
spheres of an atom in the net. The first ten coordination spheres are usually considered at the topologicalclassification. The coordination number is equal to N1, and the graph node is called N1-connected or N1coordinated.
Elementary channel is a free space connecting a couple of elementary voids; the channel corresponds to a VDP
edge for the atom forming either of the voids. Such an edge is called line of the elementary channel. Accordingly,
the atoms forming the elementary channel are the atoms whose VDPs have common edge coinciding with thechannel line.
Elementary void is a region of crystal space with the centre in a vertex of an atomic VDP. The atoms, whose VDPs
meet in the centre of a given elementary void, are referred to as atoms forming the elementary void.
Extended Schläfli symbol (ES) contains a detailed description of all shortest circuits for each angle at each nonequivalent atom. Total Schläfli symbol summarizes all the Schläfli symbols for the non-equivalent atoms withstoichiometric coefficients.
Indirect neighbours are contacting atoms, the segment between which does not intersect the VDP face separatingthese atoms (minor VDP face). Otherwise atoms are called direct neighbours and the corresponding VDP face iscalled major.
Lattice quantizer is a multilattice embedded into space in such a way that any point of the space is rounded to thenearest node of the quantizer.
Molecular Voronoi-Dirichlet polyhedron is a union of VDPs of atoms composing a molecular (0D) structuralgroup. Facet is a face of the VDP of an atom belonging to a molecular structure group. All facets corresponding tocontacts between two molecules form faces (boundary surfaces) of adjacent molecular VDPs. Smoothed molecular
VDP is a convex polyhedron derived from the molecular VDP by flattening their faces.
Natural tiling is such subdivision of space by tiles that (i) preserves the symmetry of the net, (ii) has strong rings astile faces, (iii) contains the tiles as small as possible.
Radius of spherical domain (Rsd) is the radius of a sphere of VDP volume.
Ring is the circuit without shortcuts, i.e. chains between two ring nodes that are shorter than any chain between thenodes that belongs to the circuit.
Strong ring is the ring that is not a sum of smaller rings.
Tile is a 3D solid (generalized polyhedron) bounded by rings (faces) in such a way that any ring edge is shared
between two rings.
Vertex symbol (VS) gives similar information as extended Schläfli symbol, but for rings.
Voronoi-Dirichlet graph is the graph consisting of all vertices and edges of all VDPs in the Voronoi-Dirichlet
partition.
Page 37

38

The XPac Program for Comparing Molecular Packing
Thomas Gelbrich
School of Chemistry, University of Southampton, Highfield, Southampton, SO17 1BJ, UK. E-mail:gelbrich@soton.ac.uk ; WWW: http://www.ncs.chem.soton.ac.uk/thomas.htm

Introduction
The lack of suitable automated procedures has been a major obstacle in investigations of packing
relationships in molecular crystals. Potential applications are not only the study of polymorphic forms,
multiple-component crystals and close analogues of a given molecule, but also the comparison of sets ofpredicted structures. In a recent publication,1 we have reported a method for the identification of similar
packing components which is implemented in the program XPac. Its effectiveness was demonstrated in a
number of case studies.1 More recently, we have reported another application involving a larger series of
25 structures based on the carbamazepine molecule,2 and more examples have been publishedelsewhere.3−6 We found that packing similarities are commonplace across a wide range of structures. In
the present paper, we will take a closer look at the techniques employed by XPac. We will begin with abrief summary of the basic ideas.

Concept
The unit cell parameters, the space group and a list of atomic coordinates provide data for a concise
description of the arrangement of molecules in a crystal structure. Another, more expansive, possibility is
the construction of the first coordination environment around each independent molecule. We call such an
assembly of molecules a representative cluster of the crystal structure. It consists of a central molecule orkernel surrounded by m molecules forming a shell. The spatial arrangement of molecules in a given
cluster can be described with internal coordinates. Thus, the clusters of two crystal structures containing
molecules of a similar shape and size are immediately comparable. This applies regardless of the crystal
systems, space groups and Z' parameters (number of crystallographically independent molecules)
involved.
Furthermore, a systematic comparison of the sub-units of two clusters will ultimately reveal if theunderlying structures have any packing component in common. Such a component, termed a
supramolecular construct (SC), is either extended in one, two or three dimensions or it is a discretebuilding block, and its representation in a cluster is called a seed. Hence, we compare two crystal
structures by comparing their representative clusters, enabling us to identify an SC via its seed.

Representative cluster
After obtaining the crystal structure parameters from a cif-file, all Z' representative clusters of a structure
are computed by investigation of a block of 3 × 3 × 3 unit cells. A shell molecule contains at least one
atom for which the conditiond k , s < (rk + rs + d )is satisfied (dk,s = distance between this atom and one atom belonging to the kernel molecule; rk, rs= vander Waals radii of these two atoms; d = cut-off parameter). The parameter d is adjustable and has adefault value of 1.5 Å. The possible inclusion of unnecessary molecules does not compromise subsequentcalculations. A structure with Z' = 2 contains two overlapping clusters. The following demonstration will
be restricted to two crystal structures A and B with Z' = 1. The same rules apply also to Z' > 1 cases,
though the treatment becomes more complex.

Page 38

39

Corresponding Sets of Points
A set of points, derived from atomic positions, is assigned to the molecules of A and B, respectively. It
will be used later for the generation of internal parameters. The positions chosen here will therefore
determine the character of this investigation. Normally, one would aim to represent the shape of themolecule and avoid, if possible, arrangements that are coplanar or even collinear. However, for someinvestigations it is necessary to choose points that define just a particular region of the molecule.1a
The application of XPac is only sensible if it is possible to establish corresponding ordered sets of points(COSP) for the molecules of structures A and B. This means, each molecule is represented by an ordered
set of N points (OSP), say K = {P1, P2,...PN} for structure A and K = {P1, P2, ....PN} for structure B andthere is a relation or correspondence, between each point Pi and each point Pi where 1 ≤ i ≤ N.
Figure 1a shows a typical choice of six non-hydrogen positions. Note that this arrangement is not affectedby rotation of the benzene rings about the N−C and the S−C bond, respectively. This makes it more likelythat a geometrically consistent COSP will be generated. All subsequent test procedures rely on
differences in corresponding internal parameters computed from the COSP. These arise from two main
sources: from the actual difference in molecular packing, which is the desired information, and from any
inconsistencies in the COSP, which should be minimised. We can obtain a rough measure for theconsistency of a COSP by calculating the mean absolute difference between all corresponding angles∠(Pi, Pj, Pk) and ∠(Pi, Pj, Pk) with 1 ≤ i, j, k ≤ N and i ≠ j, i ≠ k, j ≠ k.

Fig. 1: Corresponding points for two crystal structures. a) Scheme showing the order of points. b)
Generation of two corresponding sets of points from the differently ordered atom list of structures A (left)
and B (right). c) The resulting corresponding sets of points.

Sub-units of Clusters
The clusters of structures A and B contain m and n shell molecules, respectively. The two cluster kernels are
represented by sets of points, K and K, as defined in the previous step. Now we compute the shell for the firststructure by applying the appropriate symmetry operations on K so that m new OSP, S1, S2, ...Sm are obtained. The
shell S1, S2, ...Sn of the cluster of B is computed in the same fashion. We have now obtained a representation foreach complete cluster,C = {K, S1, S2, ...Sm}andC = {K, S1, S2, ...Sn}.

Next we consider subsets of C and C that are composed of the kernel and at least one shell molecule. We haveargued earlier that the presence of a similar packing arrangement leads to similar cluster fragments, i.e. two cluster
subsets E and E of C and C, respectively, containing a similar spatial arrangement of points (molecules). We use
the "~" sign to indicate geometrical similarity, E ~ E.

Page 3940

E is then the seed of a sub-cluster (SC) in cluster C, and E is its counterpart in C. Both contain x shell molecules(and the kernel) and each element of E corresponds to one particular element of E and vice versa. Furthermore,seeds that contain more than one shell molecule, i.e.
E = {K, S1, S2….Sx} and E = {K, S1, S2….Sx} where 1 < x ≤ min (m, n),can be divided into x2 − x / 2 overlapping triple sub-units (composed of two shell molecules and the kernel), and allthese corresponding triple sub-units must be similar,{K, Si, Sj} ~ { K, Si, Sj } for all i, j with 1 ≤ i, j ≤ x and i ≠j .
Furthermore, we base our strategy on the assumption that, in order to show that E ~ E, it is sufficient to show that
this condition is satisfied for all pairs of corresponding constituent triple sub-units. Thus, we will first establish
whether C and C contain any similar double sub-units, {K, S} ~ {K, S}. Then, the SC will be built gradually fromsuch pairs of double sub-units via triple sub-units and the seed.
First, we divide C and C into m and n double sub-units, {K, S} and {K, S}, respectively, each consisting of thekernel and one shell molecule, as illustrated in Fig. 2b. These are also the smallest packing fragments that two
structures can have in common. We use three different types of parameter for the parameterisation of the spatial
arrangement in {K, S}. The first type, ang, is the angle ∠(A, B, C) where either (A, B ∈ K; C ∈ S) or (A ∈ K; B,
C ∈ S). The second type, dhd, is computed from five points A, B, C, D, E. It is the angle between the normal
directions of the two planes defined by points (A, B, C) and (C, D, E), respectively, where (A, B, C ∈ K and D, E
∈ S) or (A, B ∈ K and C, D, E ∈ S). The third type, tor, is the torsion angle obtained from four points A, B, C, D.
It is the complement of the angle between two planes defined by (A, B, C) and (B, C, D) where (A, B, C ∈ K and D∈ S) or (A, B ∈ K and C, D ∈ S) or (A ∈ K and B, C, D ∈ S). The use of other parameters or combinations ofparameters is possible, distance parameters are not employed in the current version of the program.
A list of parameters, which is divided into three sections (ang, dhd and tor) and has a sufficiently large number of
entries is compiled in exactly the same fashion for each {K, S} and each {K, S} sub-unit. Thus, all list entries withthe same index correspond to one another.

Fig. 2: a) Representation of the clusters of two structures. The cluster C of structure A consists of thekernel molecule and 14 shell molecules. The cluster C of structure B contains 13 shell molecules. b)
Generation of double sub-units {K, D} and {K, S}. c) 14 × 13 = 182 pairings of double sub-units areinvestigated, and d) six of these actually exhibit geometrical similarity.

In order to establish whether any of the m double sub-units of the first structure is similar to any of the mdouble sub-units of the second structure, we generate all m × n possible pairs, as illustrated in Fig. 2c.
Page 40

41

Each pair are tested by computing all absolute difference between corresponding entries xi and xi in theirparameter lists. A schematic representation of this procedure is shown in Fig. 3. The sign of a torsion
angle changes when the fragment is inverted. Thus, in order to account for the accidental choice of themolecule in structures with centres of inversion and/or mirror planes, we also calculate the absolute sumof corresponding entries in the tor lists.
These four lists of differences are then used to compute mean values δang, δdhd, δtor/δtor* which as a whole
give an impression of the dissimilarity of the two double sub-units {K, S} and {K, S}. The generalformula isMδ = 1 / M ∑ xi − x i ,i =1

where xi and xi are the i-th entries of the parameter lists for {K, S} and {K, S}, respectively, and M is thetotal number of list entries. The δ values are compared against adjustable cut-off parameters ∆ang, ∆dhd and∆tor, and we consider two double sub-units to be similar if(δang < ∆ang) ∧ (δdhd < ∆dhd) ∧ [(δtor < ∆tor) ∨ (δtor* < ∆tor)] ⇒ {K, S} ~ {K, S}.

Fig. 3: Comparison of the cluster sub-units {K, S} and {K, S}. a) List A with angles, dihedral and torsion
angles representing {K, S}. b) The corresponding list B for {K, S}. c) The absolute difference for eachpair of corresponding entries of lists A and B is computed. d) The mean values δ for each part of the list
are computed and e) compared with cutoff parameters.

The three panels in Fig. 4 show a typical distribution of δ values.1b Each data point corresponds to one of
196 sub-unit combinations (m, n = 14). The green points near 0° derived from six combinations thatsatisfy condition (2), all other combinations are represented by blue or red points.
In general, either of the following three cases will occur at this stage:
1. no similar double sub-units found ⇒ the two structures exhibit no packing similarity ⇒ thecomparison is finished
2. a single similar double sub-unit found ⇒ this sub-unit is identical with the SC itself ⇒ thecomparison is also finished
3. a set of similar double sub-units found ⇒ we need to establish whether they are actually partsof a larger seed
We continue in the next section with the treatment of case 3.

Page 4142

Fig. 4: Distribution of δ values calculated for 196 combinations of double sub-units.1b The green data
points near 0° belong to six pairs with a {K, S} ~ {K, S} relationship, data points for all other pairs arecoloured blue and red. Note that a wide gaps separates the green points from the rest.

Assembly of the supramolecular construct
We have now a certain number (at least two) of pairs of the type {K, S} ~ {K, S} and want to find out
whether it is possible to join any of them so that pairs of larger cluster subunits with similar geometry are
obtained. Merging two pairs of double sub-units gives a pair triple sub-units, {K, S1, S2} and {K, S1, S2}.
From x pairs of double sub-units, we obtain x2 − x / 2 triple pairs. This is illustrated in Fig, 5a. For eachpair we will test whether{K, S1, S2} ~ {K, S1, S2}
is true a statement (Fig. 5b). The test procedure is very similar to that outlined above for double sub-units.
Again, we generate parameter lists. However, each parameter is now defined by points originating fromthree rather than two molecules. Again, we calculate the mean differences of corresponding list entries. A
set of dissimilarity parameters δang, δdhd and δtor / δtor* is computed and compared against the respective
cut-off parameter ∆, and(δang < ∆ang) ∧ (δdhd < ∆dhd) ∧ [(δtor < ∆tor) ∨ (δtor* < ∆tor)] ⇒ {K, S1, S2} ~ {K, S1, S2}.

Page 4243

Fig. 5: Continued from Fig. 2. a) A − F, the six {K, S} ~ {K, S} pairs from Fig. 2d. b) 15 triple sub-units
obtained by pairing of A − F. c) and d) Two possible results of the subsequent comparison of these triple
subunits. Left: All corresponding subunits are similar, i.e. A − F coexist in one seed. Right: ACD and
BEF can only coexist in two distinct groups, leading to two seeds.

We determine all pairs of similar triple clusters and use this information to assemble larger cluster subunits, the seed of the SC. The left panel of Figs. 5c and 5d shows a case where all double subunits coexist
in a single seed. By contrast, the right panel shows a case where certain combinations lead to dissimilar
triple subunits. As a consequence, we obtain two distinct seeds, each containing three shell molecules.
This separation could well be genuine, but it could also be the result of cut-off parameters being set too
low or to high. Then either too few or too many relationships are recognised as similar. Any suchproblems can be resolved by repeating the procedure with a different set of ∆-parameters. Finally, theseed can be expanded into the SC using its symmetry operations. At this point, information about thedimensionality and the corresponding base vectors of the SC can be obtained easily. The investigation ofa series of N crystal structures consists of N2− N / 2 individual cycles of this kind, and the same COSP areused throughout the investigation.

Summary
The representation of crystal structures as clusters of molecules enables us to design powerful tools that
permit a comparison even if the underlying structures crystallise in different space groups and withdifferent Z'. This is useful for the analysis of polymorphic forms and predicted structures and provides astarting point for more complex investigations of large series of related structures.

References
1
2
3
4
5
6

T. Gelbrich, M. B. Hursthouse, Cryst. Eng. Comm. 2005, 7, 324. a) Case study 4. b) Case study 1.
T. Gelbrich, M. B. Hursthouse, Cryst. Eng. Comm. 2006, 8, 448.
R. M. Vrcelj, J. N. Sherwood, A. R. Kennedy, H. G. Gallagher, T. Gelbrich, Cryst. Growth Des. 2003, 3, 1027.
S. Gerber, H. Krautscheid, T. Gelbrich, H. Vollmer, Z. Anorg. Allg. Chem. 2004, 630, 1427.
T. Gelbrich, T. L. Threlfall, S. Huth, E. Seeger, M. B. Hursthouse, Z. Anorg. Allg. Chem. 2004, 630, 1451.
B. Murphy, M. Aljabri, A. M. Ahmed, G. Murphy, B. J. Hathaway, M. E. Light, T. Gelbrich, M. B. Hursthouse,
Dalton Trans. 2006, 357.
Page 43

44

The Pixel module of the OPiX computer program package: affordable
calculation of intermolecular interaction energies for large organic
molecules and crystals
Angelo Gavezzotti
Dipartimento di Chimica Strutturale e Stereochimica Inorganica, Università di Milano, via Venezian 21,
20133 Milano (Italy), E-mail: angelo.gavezzotti@unimi.it , WWW: http://users.unimi.it/gavezzot/

Introduction
The Pixel method is a recently introduced procedure for the calculation of intermolecular interactionenergies. The method is based on a semi-empirical computational procedure in which all the charge
density of a molecule is taken into account rather than just a few nuclei and point charges. Electrostatic
and repulsion terms are included in the calculations, but dispersion and polarization terms are also
included because the methodology is mainly intended for the study of organic molecular assemblies
rather than minerals or ionic solids.
Theoretical chemistry cannot continue to be based on calculations on just formic acid and urea, and asecond characteristic of the Pixel method is its ready applicability to molecular systems of genuine
chemical interest, say, a 50-atom molecule. The method is computationally demanding: in applying it tonaphthalene, for example, one switches from an 18-site description of the molecule in the atom-atom
potential scheme to a 20,000-site description. This is only possible now that computer-speeds havereached the level of teraflops per second
Pixel calculations are carried out with a submodule of the OPiX package, which can also perform anumber of other tasks, including packing analysis and packing structure prediction. Use of the standard
files in OPiX format greatly facilitates also the use of the Pixel module. A scheme and a brief descriptionof the OPiX package follow.

Fig 1: a) calculate the full interaction profile for this dimer in 3 minutes... or b) ..or the lattice energy ofaspirin in 10 minutes!

Pixel calculations are carried out with a submodule of the OPiX package, which can also perform anumber of other tasks, including packing analysis and packing structure prediction. Use of the standard
files in OPiX format greatly facilitates also the use of the Pixel module. A scheme and a brief descriptionof the OPiX package follow.

Page 4445

Fig 2: OVERVIEW OF THE OPiX SYSTEM, blue: main input file ; red: the Pixel modules; View moredetail at, and download files from: http://users.unimi.it/gavezzot/

2. OPiX: General description
OPiX is a program package for the calculation of molecular and intermolecular properties. It is written infeatureless Fortran and it has been compiled and used on all types of computers. OPiX uses file-to file
input options, and there are no windows or menus.

3. Format of main input structural file
Molecular and crystal information can be given in one of the following file formats:format 1 (filename extension .oih): atomic coordinates and crystal data (if any), implicit hydrogen atom
positions. The positions of non-hydrogen nuclei are given as coordinates, while the positions of hydrogen
Page 4546

nuclei are given as a series of commands for the calculation of explicit coordinates for each hydrogen,using standard geometrical criteria from the position of non-hydrogen nuclei. Given the importance of Hatom positions in crystal energy calculations, this renormalization of hydrogen atom positions is essential
when X-ray crystal atomic coordinates are used. Pixel has been calibrated using renormalized C-H
distances of 1.08 Å or O-H and N-H distances of 1.0 Å.
format 2 (filename extension .oeh): atomic coordinates and crystal data (if any), explicit hydrogen atom
positions. The positions of all nuclei are given as explicit coordinates. The COOR module converts .oihinto .oeh files, i.e. calculates H-atom coordinates from the codes in the .oih file.

A .oeh file may contain atomic coordinates of one or more gas-phase molecule(s), or, if it is being used
for a calculation on a crystal structure, the atomic coordinates of one reference molecular unit, plus celldimensions and space group information. In the latter case, a cluster of molecules representing the crystal
may be generated (this will not be possible when the structure is polymeric and the cell contents arecovalently bound to surrounding cells). A .oih or .oeh file must contain coordinates for a full molecule, so
for those crystals in which the asymmetric unit is a fraction of the molecule, the entire molecule must bereconstructed and the appropriate space subgroup must be used.
More detail, and a description of the PROM module (polymorph generator/predictor) and OPROP module(crystal packing properties and statistics) can be found in the documentation on the author's website (docssubdirectory of the opix directory): http://users.unimi.it/gavezzot/ .

4. The PIXEL module: Calculation of intermolecular energies by the semiclassical density sums (SCDS-pixel) method
The Pixel modules (PIXELC or PIXELD, see below) calculate the Coulombic, polarization, dispersion
and repulsion energies between separate, rigid molecules. The interacting molecules in these calculations
are represented by charge density distributions, usually calculated using the program GAUSSIAN(employing the CUBE option). Each elementary density volume with its charge is called a pixel. The
original reference coordinate frame for position of the atomic nuclei and of the electron density pixels is
the same one used in the GAUSSIAN calculation. No intramolecular energies are calculated. An
additional module, MAT2 is used for the preparation of input files.
The electron density output by GAUSSIAN is encoded in an array containing a million or more pixels,
and in order to reduce the run-time of subsequent calculations these are ‘condensed’ into larger pixels,
yielding an array containing around 10-to-20000 values. The condensation level can be controlled by theuser. A model of the set of interacting molecules also needs to be constructed: this might be a simple
dimer or a larger array of molecules generated using crystallographic information. Within the set ofinteracting molecules there will be contact and overlap between undeformed densities, and interactionenergies are obtained pixel-by-pixel summations of Coulombic, linear polarization, and dispersion(London-type) terms; repulsion is proportional to the overall integral between charge densities. The totalenergy is the sum of these four terms. The equations used to calculate the individual energy terms are
given in refs. 5 and 13 in the Bibliography. Four parameters are needed in the calculation of thedispersion, polarization and repulsion energies; optimized values for these are given in the references;
they have been hard-coded into the program as defaults, though these can be over-ridden by the user.
The Pixel method shares with calculations based on atom-atom potential calculations the advantage that
explicit values are obtained for Coulombic, polarization, dispersion and repulsion terms. While it is notpossible to calculate intramolecular (conformational) energies, treat dynamics or change or polarize thecharge distribution, the PIXEL method has a number of important advantages over more conventional
procedures. A molecule is treated as a 10,000-site object rather than a N(atom)-site object, and themethod might be regarded as equivalent to an infinitely large multipolar expansion. In calculations using
Page 46

47

atom-atom potentials each atom must be assigned a charge, whereas in the PIXEL method the Coulombic
energy is parameter-less and so the Pixel Coulombic energy can be regarded as exact as the wavefunctionused to calculate it. Penetration energies can also be calculated.
Two modules make up the facilities for carrying out PIXEL calculation. These are named PIXELD and
PIXELC, and which is used depends on the type of problem being analysed:
PIXELD is used for clusters made of any number of molecules of up to two molecular species, the first
species is referred to as the solute, the second species as the solvent. The position of each molecule in thecluster is obtained by transforming the original coordinates for nuclei and pixels by an orientation matrix
constructed from three Euler angles, and by a displacement vector. These are expressed in the in the same
coordinate frame as used in the GAUSSIAN calculation, and must be derived by the user.
PIXELC is used for calculations on a crystal made of only one molecular species, one molecule per
asymmetric unit. The matrix operation that transforms from the molecular reference frame to coordinatesin the crystal structure is obtained by use of a separate module MAT2; the positions of molecules in thecluster that represents the crystal structure are generated automatically using cell parameters, space groupmatrices, and a cutoff threshold for the distance between centers of mass of the central and surrounding
molecules. Note that it is not possible to treat crystals containing more than one molecule per asymmetricunit.

In both cases, it is convenient to start with a .oeh data file which contains the molecular (and, if needed,
the crystal) information. The minimization of the cluster energy or of the lattice energy can be carried out
with a steepest-descent or a Symplex algorithm.

4.1 Program inputs and outputs
The input to Pixel consists of:1) an electron density file for the solute (and one for the solvent molecule if any), extension .den
2) a file with the molecular specifications, extension .inp.
3) a file with the input parameters of the calculation, pixel.pmt
Besides, a .gjf file is needed for input to GAUSSIAN. Both .inp and .gjf file are prepared by submodule
MAT2 from a .oeh file.
The program outputs are:1) a listing-file with the results of the calculation; extension .oxp;2) for the cluster calculation with PIXELD, a file with atomic coordinates; extension .dat
3) when a lattice energy optimization is carried out, a file (.oeh format) with the final crystal data;
extension .pxm.

4.2 How to run a pixel calculation
1) Prepare a molecular model for the solute molecule (x,y,z coordinates) and set up a .oeh file. Cif files in
the format output by the Cambridge Database can be converted into .oeh files using the module RETCIFCOOR, see scheme 1;
2) Run the MAT2 module. MAT2 prepares the Pixel input file .inp and the GAUSSIAN input file .gjf.
MAT2 also calculates the transformation between original coordinates and a coordinate frame whose
origin is the molecular center of charges with axes directed along the principal charge moments. MAT2
will also calculate automatically the limits of the electron density box and, for the crystal case, also the
Page 4748

matrix transformation that correlates the molecular coordinate frame and the crystal coordinate frame.
MAT2 will also recognize atoms and assign atomic polarizabilities.
3) Run GAUSSIAN for the electron density calculation. The standard use requires a valence only density(option 'frozencore' in GAUSSIAN). If a MO package different from GAUSSIAN is used, the input data
and the output electron density file must be converted accordingly. The parameters used in Pixel havebeen optimized using densities from MP2 6-31G** calculations.
4) Repeat steps 1 to 3 for the solvent molecule (the second molecular species), if there is one.
5) Prepare the parameter file and then run Pixel. The parameter file contains the parameters of the theory
and a few indicators for condensing the molecular charge density

4.3 Options
4.3.1 Case a), a cluster of molecules, PIXELD module
4.3.1.1 Option i) calculate the energy for each set of positional parameters, three center of mass
coordinates and three orientation angles for each molecule, specified from input one after the other. The
values for the translational and the rotational displacements must be found by geometrical considerations;refer to the atomic coordinates in the GAUSSIAN output file. The first molecule is usually theundisplaced reference molecule, others are translated and rotated as needed.
4.3.1.2 Option ii) calculate the energy for a simultaneous variation of up to 5 parameters in a given range;
4.3.1.3 Option iii) Optimize the cluster energy by some cycles of steepest descent and some cycles of
symplex. As expected, the optimization procedure is efficient very far from the minimum, but becomes
critical if an energy valley is very shallow. Use automatic minimization far from the minimum, followed
by a scan of the energy surface using option ii in the neighbourhood of shallow minima.
4.3.1.4 Option iv) PIXELD can be used also to calculate the energy of dimers or oligomers extracted
from a crystal structure. In this case the input is exactly as for the crystal case (see below), but only thesymmetry operations corresponding to the molecules in the oligomer must be given.

4.3.2 Case b), a crystal, PIXELC module
Molecules whose distance from the central one is in a prescribed range are automatically included in
crystal model. Typically, one has 100-150 molecules in the cluster for which the Coulombic, polarization,
dispersion and repulsion energies are calculated.

4.4 A brief description of the Pixel output files
While the program is running, some output appears on the screen (formal unit 6). The file output isdirected to file pixel.oxp. This has a title, some echo of input parameters, and detail on the screenout andcondensation procedures carried out on the original electron density, as well as of the subdivision of
pixels among atomic basins. Then the output has the polarization energy at each molecule, and finally the
Pixel energies: ec, electrostatic; ep, polarization; ed, dispersion; er, repulsion; et, total. The next line has
the 6-exp force field (FF) energies: repulsion, attraction, total, point-charge energy, total+point chargeenergy. When this printout carries the 'lattice' tag, the Coulomb, dispersion, and repulsion energies are
divided by two so the total is the computational equivalent of the enthalpy of sublimation.

Page 48

49

5. What you can do with Pixel: Worked examples and output explanations
5.1 Calculation of electron densities and parameter file
A sample input file for GAUSSIAN for acetylene is:#MP2/6-31G** guess=core nosym density=MP2 pop=esp cube=cards cube=frozencore
acetylene
0 1
C
0.000000
0.000000-0.600000
C
0.000000
0.000000
0.600000
H
0.000000
0.000000-1.660000
H
0.000000
0.000000
1.660000
c:\opix\dens\acetylen.den
0 -3.800000-3.800000-4.280000
96 0.080000
0.000000
0.000000
96 0.000000
0.080000
0.000000
108 0.000000
0.000000
0.080000

Fig 3: Axis orientation of acetylene and water

The Pixel parameter file: if the default version of the theory is desired, all these inputs are zero
0.00 3.00 150.0 4800.0 1200.0 0
3 0 0.000001 99.0
3 0 0.000001 99.0

the four parameters of the theory
electron density trimmers, soluteelectron density trimmers, solvent

5.2 Example 1: Parallel acetylene dimer
The first example concerns an acetylene dimer with two molecules stacked along axis x, at distances of
3.35 and 4.0 Å (see 4.3.1.1). The input file is:acetylene dimer parallel
2
0
4
0
0.000
0.000
1
3 -0.2000 0.0000
23 -0.2000 0.0000
3
1 0.2000 0.0000
4
1 0.2000 0.0000
0.000 0.000 0.000 0.000
3.350 0.000 0.000 0.000
0 0
0.000 0.000 0.000 0.000
4.000 0.000 0.000 0.000
99 99

title
guide integers
atomic information: atom number, atom type
(3=C, 1=H), charge and polarisability. The
zeros given for polarizabiltiy that
defaults should be used.
0.000
0.000
1. position of 1st molecule
0.000
0.000
1. position of 2nd molecule
0.000
0.000

0.000
0.000

1.
1.

Page 49

50

The energy is calculated for only two distances and the output file is:

Welcome to Pixel DIMER version
acetylene dimer parallel
Variable Krep,parameters Edisp,Epol,Erep
3.000
150.004800.00 1200.000
Using damp.atomic ionization potent. for Edisp
First molecule (solute) data
ionization potential and charge
0.00000.00
Atoms
type, Z, x,y,z, point charge, polarizability, vdW R
34.00
0.00000
0.00000 -0.59999 -0.2000
3
4.00
0.00000
0.00000
0.59999 -0.2000
1
1.00
0.00000
0.00000 -1.65998 0.2000
1
1.00
0.00000
0.00000
1.65998 0.2000

1.35
1.35
0.39
0.39

1.77
1.77
1.10
1.10

Density file title acetylene
min and max original density 0.0000E+00 0.8025E+01
atomic basinsatom
1 basin and real charge
4.207
4.000
atom
2 basin and real charge
4.207
4.000
atom
3 basin and real charge
0.792
1.000
atom
4 basin and real charge
0.792
1.000
Condensation level3
Density steps,original
96
96 108 and condensed
32
32
36
steps and pixel vol(A)0.24000.24000.24000.01382
original electron number
9.99817 remaining-pixels
9.996529940
q min and max 0.1000E-05
99.00
screening: electrons out low and high 0.1652E-02 0.0000E+00
atom
1 condens.basin and real charge-4.2364.000
atom
2 condens.basin and real charge-4.2364.000
atom
3 condens.basin and real charge-0.7641.000
atom
4 condens.basin and real charge-0.7641.000
polarizability,raw, tot, renorm 0.35546E+01 0.34800E+01 0.34800E+01
renormalized total charges
10.000000 -10.000000
no. of charge points per atom
1 3882 2 3882 3 1088 4 1088===== Start energy calculations =====
collision parameter
0.120
Molecular cluster, positions, c.o.m. and euler angles
solute10.00000.00000.0000
0.00
0.00
0.00
1.0
solute23.35000.00000.0000
0.00
0.00
0.00
1.0
A...A A...B B...B total energies
coul
3.1
0.0
0.0
3.1
disp
-5.3
0.0
0.0
-5.3
rep
9.2
0.0
0.0
9.2
total polarization-1.4 total energy
5.6
total Pixel energy
FF cluster e6r eqq etot
-1.0
2.9
1.8 atom-atom force field energy
Molecular cluster, positions, c.o.m. and euler angles
solute10.00000.00000.0000
0.00
0.00
0.00
1.0
solute24.00000.00000.0000
0.00
0.00
0.00
1.0
A...A A...B B...B total energies
coul
2.5
0.0
0.0
2.5
the first three columns are
disp
-1.8
0.0
0.0
-1.8
solute-solute, solvent-solute and
rep
0.6
0.0
0.0
0.6
solvent -solvent energies
total polarization-0.2 total energy
1.1
FF cluster e6r eqq etot
-2.1
1.5
-0.6

Page 5051

5.3 Example 2: acetylene-(H2O)2 trimer
The hydrogen atoms of the acetylene molecule point at the oxygen atom of two water molecules along thebisector of the HOH angle:

Fig 4: acetylene-(H2O)2 trimer ; z-axis→

The first water molecule is just displaced along +z, while the second one is inverted and displaced along z. The H...O distances are varied by having the z-coordinates of the water molecules vary from 3.66 to
4.06 and from -4.06 to -3.66 in steps of 0.2 Å . See in 4.3.1.2. The input file is:acetylene-water(2) trimer
1
2
4
3
0.000
0.000
1
3 -0.2000 0.0000
23 -0.2000 0.0000
3
1 0.2000 0.0000
4
1 0.2000 0.0000
0.000
0.000
1 16 -0.8000 0.0000
2 25 0.4000 0.0000
3 25 0.4000 0.0000
0.000
0.000
0.000
0.00
0.000
0.000
3.66000.00
0.000
0.000 -4.0600
0.00
-1 0
0. 0. 0.
0. 0. 0.
0. 0. 4.06
0. 0. 0.
0. 0. -3.66
0. 0. 0.
0. 0. 0.
0. 0. 0.
0. 0. 0.2
0. 0. 0.
0. 0. 0.2
0. 0. 0.

acetylene atomic info

water atomic info
0.00
0.00
0.00

0.00
0.00
0.00

1.0
1.0
-1.0

starting positions

final positions
steps

The last part of the output file has the interaction energies
1 variable parameters
cluster ec ep ed er et
FF cluster e6r eqq etot
2 variable parameters
cluster ec ep ed er et
FF cluster e6r eqq etot
3 variable parameters
cluster ec ep ed er et
FF cluster e6r eqq etot
4 variable parameters
cluster ec ep ed er et
FF cluster e6r eqq etot
5 variable parameters
cluster ec ep ed er et
FF cluster e6r eqq etot
6 variable parameters
cluster ec ep ed er et
FF cluster e6r eqq etot
7 variable parameters
cluster ec ep ed er et
FF cluster e6r eqq etot

3.660
-37.1
12.2
3.660
-42.2
15.5
3.660
-51.1
25.8
3.860
-28.2
2.0
3.860
-33.3
5.3
3.860
-42.2
15.5
4.060
-23.1
-1.3

-4.060-10.2-20.7-3.860-12.1-22.7-3.660-15.9-25.5-4.060-6.3-17.9-3.860-8.3-19.9-3.660-12.1-22.7-4.060
-4.4
-15.8

-9.2
-8.5

30.9

-25.7

-10.5
-7.2

38.1

-26.7

-12.2
0.2

52.1

-27.1

-7.6
-15.9

16.9

-25.2

-8.8
-14.6

24.2

-26.2

-10.5
-7.2

38.1

-26.7

-6.3
-17.1

9.6

-24.2

Page 5152

5.4 Example 3: optimization of the acetylene-water π-dimer

Fig 4: acetylene-water π-dimer
See in 4.3.1.3. The input file is:acetylene-water O..pi dimer
1
1
4
3
0.000
0.000
1
3 -0.2000 0.0000
23 -0.2000 0.0000
3
1 0.2000 0.0000
4
1 0.2000 0.0000
0.000
0.000
1 16 -0.8000 0.0000
2 25 0.4000 0.0000
3 25 0.4000 0.0000
0.000
0.000
0.000
0.00
0.00
0.00
1.0
0.000
2.600
0.000
90.00
0.00
0.00
1.0
2 10
two cycles st.descent, 10 cycles Symplex
0 0 0 0 0 0 0 1 0 1 0 0
optimization tags: acetylene molecule fixed,
0.1 1. 2. 20.0 0.001
water molecule: vary only y-coordinate
and in-plane rotation angle

The starting configuration is is obtained by rotating the water molecule 90° around x and displacing by
2.6 Å along y, as shown on the left. These two parameters are then optimized and the final configurationis seen on the right. Steepest descent works well far from the minimum, Symplex is more performing
close to the minimum. Pixel reasonably predicts that the π-system of acetylene will be approached by theH-atom of the water molecule. The last part of the output shows the progress of the Symplex
optimization:
current parameters
0.000
0.000
0.000
0.000
0.000
0.000
3.435
0.000
100.095
0.000
cluster ec ep ed er et
-4.0
-2.1
-4.3
current parameters
0.000
0.000
0.000
0.000
0.000
0.000
3.425
0.000
102.157
0.000
cluster ec ep ed er et
-4.3
-2.3
-4.4
current parameters
0.000
0.000
0.000
0.000
0.000
0.000
3.356
0.000
101.282
0.000
cluster ec ep ed er et
-4.7
-2.8
-4.9
current parameters
0.000
0.000
0.000
0.000
0.000
0.000
3.372
0.000
105.845
0.000
cluster ec ep ed er et
-5.3
-3.0
-4.8
current parameters
0.000
0.000
0.000
0.000
0.000
0.000
3.353
0.000
109.970
0.000
cluster ec ep ed er et
-6.3
-3.7
-5.1
max iteration number exceeded
10
writing coord file for last parameters
1
0.000
0.000
0.000
0.0
1
0.000
3.353
0.000
110.0
Page 52

0.000
0.000
5.0
-5.4
0.000
0.000
5.3
-5.7
0.000
0.000
7.2
-5.3
0.000
0.000
7.4
-5.7
0.000
0.000
8.7
-6.3
0.0
0.0

0.0
0.0

53

energy for last parameters
A...A A...B B...B total energies
coul
0.0
-6.3
0.0
-6.3 note:only solute-solvent energies are nonzero
disp
0.0
-5.1
0.0
-5.1
rep
0.0
8.7
0.0
8.7
total polarization-3.7 total energy-6.3
FF cluster e6r eqq etot
0.5
-4.1
-3.6

5.5 Example 4: Crystal lattice energy calculations
See in 4.3.2. The example is for the formic acid crystal. Files formac.oeh and formac.gjf are:
#FORMAC01****
1.000 010.24103.54405.3560
90.00
90.00
90.00
crystal cell
0
5
1
.1584
.3109
.1655 1 3
.0000
fractional
2
.0834
.1423
.0023 1 18.0000
atomic coords
3
.2766
.3424
.1430 1 17
.0000
4
.1410
.0393
-.1322 1 26
.0000
5
.1131
.4292
.3300 1 1
.0000
0
4
4
space group symmetry information
1.00
.00
.00
.00
1.00
.00
.00
.00
1.00
.00000.00000.00000
-1.00
.00
.00
.00
1.00
.00
.00
.00
1.00
.50000.50000.500001.00.00.00.00 -1.00
.00
.00
.00
1.00
.50000.50000.00000
-1.00
.00
.00
.00 -1.00
.00
.00
.00
1.00
.00000.00000.5000030000#MP2/6-31G** guess=core nosym density=MP2 pop=esp cube=cards cube=frozencore
FORMAC01****
0 1
C-0.002289
0.409174
0.108307
atomic coords. in molecularO
0.005214-0.084918-1.102822
reference frameO
0.002073-0.272312
1.122122H-0.031114-1.081109-1.022557
H-0.013451
1.483901
0.218310
c:\opix\dens\FORMAC01.den
0-3.960000-3.800000
100
0.080000
0.000000
100
0.000000
0.080000
100
0.000000
0.000000-3.960000
0.000000
0.000000
0.080000

electron density box

In this calculation, a rather small box radius (7.0 Å) is considered for a quick example, and the crystal
cluster contains only 31 near-neighbor molecules. Usually, the radius may be of the order of 15-18 Å, andthe crystal cluster may contain 100-150 molecules. The calculation with condensation level 5 lasts about
one minute. The formac.inp Pixel input file is:
FORMAC01****
0 -1
5
0
0.000
0.000
1
3 0.0000 1.0500
atomic species, charge and polarizability
2 18 0.0000 0.0000
3 17 0.0000 0.0000
4 26 0.0000 0.0000
5
1 0.0000 0.0000
0.00007.000035.0000 crystal box radius
10.24103.54405.356090.0000
90.0000
90.0000
cell
1.000 0.000 0.000
orientation matrices
Page 5354

0.000 1.000 0.000
0.000 0.000 1.000
0.000 0.000 0.000-0.124704 -0.519479 0.845335 relates molecular to crystal
0.863259 0.363191 0.350538 coordinates-0.489115 0.773456 0.403154
1.742890
0.917232
0.525156
4
space group symmetry
1.00
0.00
0.00
0.00
1.00
0.00
0.00
0.00
1.00
0.000000 0.000000 0.000000
-1.00
0.00
0.00
0.00
1.00
0.00
0.00
0.00
1.00
0.500000 0.500000 0.500000
1.00
0.00
0.00
0.00 -1.00
0.00
0.00
0.00
1.00
0.500000 0.500000 0.000000
-1.00
0.00
0.00
0.00 -1.00
0.00
0.00
0.00
1.00
0.000000 0.000000 0.500000
99

The output file is:
FORMAC01****
Variable Krep,parameters Edisp,Epol,Erep
3.000
150.004800.00 1200.000
Using damp.atomic ionization potent. for Edisp
molecular data
ionization potential and charge
0.00000.00
Atoms
type, Z, x,y,z, point charge, polarizability, vdW R
34.00-0.00229
0.409170.10831 0.0000
1.05
1.77
18
6.00
0.00521 -0.08492 -1.10281 0.0000
0.75
1.58
17
6.00
0.00207 -0.27231
1.12211 0.0000
0.75
1.58
26
1.00
-0.03111 -1.08109 -1.02254 0.0000
0.39
1.10
1
1.00
-0.01345
1.48388
0.21831 0.0000
0.39
1.10
Density file title FORMAC01****
min and max original density 0.0000E+00 0.1833E+02
Condensation level5
Density steps,original 100 100 100 and condensed
20
20
20
steps and pixel vol(A)0.40000.40000.40000.06400
original electron number 17.99138 remaining-pixels
17.99105
2622(molecule is described by 2622 e-Pixels)
q min and max 0.1000E-05
99.00
screening: electrons out low and high 0.3369E-03 0.0000E+00
polarizability,raw, tot, renorm 0.34447E+01 0.33300E+01 0.33300E+01
renormalized total charges
18.000000 -18.000000===== Start energy calculations =====
collision parameter
0.200
CRYSTAL; between
0.00
7.00 top cutoff 35.00
cell parameters 10.241
3.544
5.356
90.00
90.00
90.00
Space group matrices
1.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 1.0
0.000 0.000 0.000-1.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 1.0
0.500 0.500 0.500
1.0 0.0 0.0 0.0 -1.0 0.0 0.0 0.0 1.0
0.500 0.500 0.000-1.0 0.0 0.0 0.0 -1.0 0.0 0.0 0.0 1.0
0.000 0.000 0.500
euler angles and c.o.m.
62.5
29.3
98.2
1.74290.91720.525231 molecules within crystal cutoff shell
overlap by atom types
1
30.000021
overlap by atom types
1
170.001296
atom-atom overlap integrals
overlap by atom types
1
180.000757
between charge densities
overlap by atom types
1
26
0.000006
overlap by atom types
3
10.000021
atom types: 1 hydrogen,overlap by atom types
3
30.000319
3 carbon, 17 carbonyl O, 18 O,
overlap by atom types
3170.001680
26 OH hydrogen
overlap by atom types
3
180.000927
overlap by atom types
326
0.000427
overlap by atom types
1710.001296
overlap by atom types
1730.001681
overlap by atom types
17
170.000234
overlap by atom types
17
180.000751
overlap by atom types
17
26
0.026061(O)-H...O= overlap
overlap by atom types
18
10.000757
overlap by atom types
18
30.000927
Page 54

55

overlap by atom types
18
170.000753
overlap by atom types
18
180.000283
overlap by atom types
18
26
0.000023
overlap by atom types
26
10.000006
overlap by atom types
26
30.000427
overlap by atom types
26
17
0.026050
overlap by atom types
26
18
0.000023
Epol,damp,no-damp -43.91 -658.93
FORMAC01****
lattice ec ep ed er et -86.5 -43.9 -33.4 104.7-59.1
Pixel energies
FF lattice e6 er e6r eqq etot -105.8
60.8
-45.0
0.0
-45.0 atom-atom energies

Note that energies are qualified as 'lattice': that means that the Coulombic, dispersion and repulsion
energies have been divided by two to avoid double counting as usual in pairwise additive lattice
summations. The polarization energy has not, since it is not counted twice. The auxiliary output fileformac.mlc has detail of the molecule-molecule interactions, first the symmetry operations, and then alist of Coulombic, dispersion and repulsion molecule-molecule energies. This output can be used to spot
the most important intermolecular interactions in the crystal structure.

5.6 Example 5: dimers from a crystal structure
See in 4.3.1.4. This example calculates the energies, including total polarization, for several dimers
extracted from the formic acid crystal. There are only the two symmetry operations for each pair ofmolecules; the symmetry operation for the desired dimers can be obtained from a survey of fileformac.mlc.
The last part of the input file is:
2
1.00
0.00
0.00
0.00
1.00
0.000000 0.000000 0.000000
-1.00
0.00
0.00
0.00
1.00
0.500000 0.500000 0.500000
2
1.00
0.00
0.00
0.00
1.00
0.000000 0.000000 0.000000
1.00
0.00
0.00
0.00
1.00
0.00000 1.00000 0.00000
99

0.00

0.00

0.00

1.00

0.00

0.00

0.00

1.00

0.00

0.00

0.00

1.00

0.00

0.00

0.00

1.00

OUTPUT (LAST PART).................... as above for full crystal
cell parameters 10.241
3.544
5.356
90.00
90.00
90.00
euler angles and c.o.m.
62.5
29.3
98.2
1.74290.91720.5252
Space group matrices
1.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 1.0
0.000 0.000 0.000-1.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 1.0
0.500 0.500 0.500
2 molecules within crystal cutoff shell
A...A A...B B...B total energies
coul
-77.0
0.0
0.0
-77.0
disp
-13.3
0.0
0.0
-13.3
rep
91.6
0.0
0.0
91.6
total polarization-37.4 total energy-36.0
FF cluster e6r eqq etot
-22.0
0.0
-22.0
Space group matrices
1.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 1.0
0.000 0.000 0.000
1.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 1.0
0.000 1.000 0.000
2 molecules within crystal cutoff shell
A...A A...B B...B total energies
coul
3.4
0.0
0.0
3.4
disp
-5.4
0.0
0.0
-5.4
rep
3.8
0.0
0.0
3.8
Page 55

56

total polarization-1.0 total energy

FF cluster e6r eqq etot

-5.3

0.9

0.0

-5.3

5.7 Example 6: Optimization of a crystal structure
Optimization of a crystal structure is done by optimizing the cell parameters and the rigid-bodymolecular position, i.e. three coordinates for the center of mass and three Euler angles for orientation.
Steepest descent: very efficient far from minima, inefficient for fine optimization; Symplex: more
efficient but requires a very high number of cycles, typically 300-500. This is a very time-consuming
calculation.
INPUT (LAST PART):...............as formac.inp above
4
1.00
0.00
0.00
0.00
1.00
0.000000 0.000000 0.000000
-1.00
0.00
0.00
0.00
1.00
0.500000 0.500000 0.500000
1.00
0.00
0.00
0.00 -1.00
0.500000 0.500000 0.000000
-1.00
0.00
0.00
0.00 -1.00
0.000000 0.000000 0.500000
2
30
1 1 1
0 0 0
1 1 0

0.00

0.00

0.00

1.00

0.00

0.00

0.00

1.00

0.00

0.00

0.00

1.00

0.00

0.00

0.00

1.00

1

1

1

number of symplex cycles
optimization tags: optimize a,b,ccell parameters, do not vary cellangles (orthorhombic), do not optimize
z coordinate of center of mass(space group polar along z)

Note the request of only 30 cycles of Simplex optimization (typical values are around 500). Note that
positions along floating origin directions should not be optimised’.

6. Final comments
Running times are short: on a normal PC running under MS-DOS the calculation of the lattice energy ofa 30-atom molecule may take some 30 minutes at condensation 4, and 10 minutes at condensation 5(good enough for a reasonable estimate of the lattice energy). One point on the energy profile for a dimerof two 15-atom molecules is a matter of seconds. On a really fast or parallel machine, computing times
become as comparable to the computing times for the atom-atom potential method were twenty yearsago.
OPiX-Pixel is easy to use once you invest a minimum amount of time learning requirements for fileformats etc. A number of examples are provided with the program package, and these should be
carefully worked through. Do not be discouraged if the first attempts seem complicated. However, OPiX
is by no means a black-box, push-button system, so you are in charge of the calculation, not the package.

Page 56

57

The OPiX package is distributed free of charge to academic institutions and non-profit organizations.
Redistribution of the software requires permission of the author. Use for Companies and other profit
organizations is subject to conditions.
The program can be obtained from the web-site http://users.unimi.it/gavezzot/
The following literature citation should be used when publishing results obtained using the package:
A.Gavezzotti (2005) OPiX, A computer program package for the calculation of intermolecularinteractions and crystal energies, University of Milano, together with the first two items of the following
list.

Bibliography
The following papers contain a description of the method:
1. A. Gavezzotti, J.Phys.Chem. (2002) B106, 4145.
2. A. Gavezzotti, J.Phys.Chem. (2003) B107, 2344.
3. A. Gavezzotti, CrystEngComm, (2003) 5, 429 and 2003, 5, 439.
4. A.Gavezzotti, Z. Krist. (2005) 220, 499.
The following papers describe applications of the method:
5. A. Gavezzotti, J.Chem.Theor.Comput. (2005) 1,834.
6. J. D. Dunitz and A. Gavezzotti, Angew. Chem. Int. Ed. (2005) 44, 2.
7. R.Boese, T.Clark and A.Gavezzotti, Helv.Chim.Acta (2003) 86, 1085.
8. J.D.Dunitz, A.Gavezzotti, Helv. Chim. Acta (2003) 86, 4073.
9. F. Demartin, G. Filippini, A. Gavezzotti, S. Rizzato. Acta Cryst.(2004) B60, 609.
10. L.Carlucci, A.Gavezzotti, Chem. Eur. J. (2005) 11, 271.
11. A.Gavezzotti, Structural Chemistry, (2005) 16, 177.
12. J.D.Dunitz, A.Gavezzotti, Cryst.Growth Des.(2005) 5, 2180.
13. S. Bacchi, M. Benaglia, F. Cozzi, F. Demartin, G.Filippini, A. Gavezzotti, Chem.Eur.J. (2006) 12,3538;
14. J.Dunitz, B.Schweizer, J.Chem.Theor.Comp. (2006) 2, 288. see also: Y.Ma, P.Politzer, J.Chem.Phys.
(2004) 120, 3152.
For extensive discussions of the Pixel method see also A.Gavezzotti, Molecular aggregation, Structure
analysis and molecular simulation of crystals and liquids, Oxford University Press, Oxford 2006:
http://www.oup.com/uk/catalogue/?ci=9780198570806.

Page 57

58

Quantifying the Similarity of Crystal Structures
René de Gelder
Institute for Molecules and Materials, Radboud University Nijmegen, Toernooiveld 1, 6525 ED Nijmegen, The Netherlands. - Email: R.deGelder@science.ru.nl ; WWW: http://www.crystallography.nl/

Introduction
Comparison of crystal structures and the quantification of structural similarity is far from trivial. A uniqueand practical representation of a crystal structure is not easy to define and sophisticated methods areneeded to assess structural similarity, especially when structures are compared in a more global sense, e.g.
in terms of packing principles. Comparing hundreds of thousands of structures, as present in the CSD
database1, needs clever automation, despite the speed of today's computers. On the other hand, with theincreasing speed and data storage capacity of today's computers the time seems ripe for implementing
automated procedures that look for hidden structural relations and principles that cannot be found by theusual search procedures in current database software.
The intention of this article is not to review all existing crystal structure comparison approaches andmethods described in literature. Instead, a method for crystal structure comparison based on powder
diffraction patterns is described, together with the source code to get the actual figure for the structuralsimilarity. This method can easily be implemented as part of the usual software present in crystallographylaboratories.
It is also discussed and demonstrated what automation of crystal structure comparison can do for the daily
practice of a crystallographer and for crystal engineering research.

Why crystal structure comparison?
After solving a crystal structure the question is always whether the new structure is unique compared tothe collection of structures already recorded in literature and databases. Although today's databasesoftware is very user-friendly one can easily miss closely related structures that might be of considerable
interest to your research. This is not directly a shortcoming of the database software or the user but is a
result of chemical interpretation and chemical variety that cannot be anticipated easily (see Fig. 1).
Therefore, robust and objective search methods are still very welcome, also for answering the seemingly
trivial question of structural uniqueness.

Fig 1: Two isostructural compounds with a subtle difference in chemistry (CSD refcodes NAMKUH and
BETXAZ)

Comparing crystal structures is not only relevant to crystallographers who solved a new crystal structure.
One can also be interested in the phenomena of polymorphism and/or isostructurality. Are there specificnon-trivial families of structures in the CSD or in my in-house structural database? What atoms andgroups can I replace in my molecule without disturbing the crystal packing? Replacing metals, as is well
Page 5859

known, often results in isomorphous compounds. Cl can often be replaced by F, I, Br or methyl.
However, can replacement of other functional groups still lead to isostructurality? At least we would liketo know about such cases (see Fig. 2).

Fig 2: Different molecules, the same crystal packing (CSD refcodes WOMXOL and XAYCIJ)

In crystal engineering a correct classification of a set of structures can be essential for the understandingof the relation between physical properties and the underlying structure of materials. In the clustering
stage of ab initio crystal structure prediction representative subsets have to be generated for whichanalysis and geometry optimization is feasible. The conclusion is that there are a lot of situations in which
methods are needed that objectively quantify the similarity of crystal structures in a fast and reliable way.

The problem: unique descriptors of crystal structures
The usual procedure for finding related crystal structures in literature is defining a suitable query incrystallographic databases like the CSD, ICSD or PDB. Such a query can be based on the chemicalcomposition, the unit cell, the space group, a chemical fragment, etc. Searches based on chemicalcomposition are often too strict. Reduced unit-cell parameters can vary significantly with minor lattice
distortions. On the other hand, searches on unit cells with a "safe" tolerance often give very long lists ofhits. In Fig. 3a an example is given of a structure that initially was not recognized as a redetermination asa result of a difference in chemical interpretation (tetramer versus polymer) and a large anisotropic
contraction of the unit cell going from room to low temperature.

Fig 3: a) structure initially (1996) interpreted as a tetramer (CSD refcode MEACCU01), later (2003) asa polymer (CSD refcode MEACCU02, initially TUTNOL) b) PXRD patterns for structure
MEACCU01/02, measured at different temperatures

Using the space group is risky when you have phase transitions or symmetry breaking as a result of achange in temperature or slight chemical modifications. Atoms, substituents or bonds in a chemicalsearch fragment can be replaced by others to give compounds that show similar molecular structures
and/or crystal packings. The problem, which is general for crystal structure comparison, is that you would
like to have a descriptor for your structure that is not too strict in the chemical sense, is unique for thepacking of the molecules and doesn't require a choice of origin or some other setting (which is the casefor the combination of unit cell parameters and fractional coordinates).
Page 59

60

The powder diffraction pattern as a global descriptor
There are global descriptors for crystal structures, like the radial distribution function or modifications of
this function2, that fulfill the requirements as outlined above. A powder diffraction pattern is also a global
descriptor of a crystal structure, more precisely of the periodic electron density in a crystal. Such a
descriptor can easily be calculated with many public domain programs (like Mercury3) and is therefore
available to the crystallographer. Although invariable for the choice of origin or setting, in the case of
powder diffraction patterns the positions of the peaks are very sensitive to small deviations in unit cellparameters. This means that strongly related structures may give (calculated) powder diffraction patterns
that look similar from an overall point of view but differ significantly on a more local scale (see Fig. 3b).
The same situation may occur for isomorphous compounds that differ only slightly in unit cell volume orunit cell shape. These compounds give calculated powder patterns that by visual inspection are definitely
related and recognizable as isostructural compounds. In all those cases the calculation of a reliable andobjective measure for the similarity or dissimilarity of the powder patterns is the essential and crucial
step. With a pattern matching approach based on correlation functions4, crystal structures can reliably becompared and classified on the basis of their PXRD patterns. In this article we discuss the relation
between the WCC (Weighted Cross Correlation) criterion, for which the Fortran code will be given, andthe well known RMS and Rwp criteria.

The comparison of powder diffraction patterns
The RMS (Root Mean Square) criterion is a well known criterion that is based on the sum of the squared
differences between n observed and n calculated data values, respectively yi(obs) and yi(calc):
RMS = ( ∑i=1, n (yi(obs)-yi(calc))2 )1/2

[I]

In principle, with the RMS criterion one measures the length of the difference vector d, |d|, spanned by theobserved data vector y(obs) and calculated data vector y(calc).
The RMS criterion becomes the sine of the angle between the vectors y(obs) and y(calc) (in n-dimensional
space) if scaling is done correctly and when its value is normalized by the length of the scaled observed
data vector y'(obs), | y'(obs)| = ( ∑i=1, n y'i(obs)2 )1/2.
In that case the RMS value ranges from 0 to 1 (0 meaning perfect agreement). The normalized version of
expression [I] is given by:
RMSnorm = ( ∑i=1, n (y'i(obs)-yi(calc))2 )1/2 / ( ∑i=1, n y'i(obs)2 )1/2

[II]

Scaling of y(obs) with s(obs) must be done according to the least squares protocol:
y'i(obs) = s(obs)yi(obs)s(obs) = ∑i=1, n yi(obs) yi(calc) / ∑i=1, n yi(obs)2

[III]
[IV]

As stated above, RMS is the length of the difference vector spanned by the observed and calculated data
vectors but, due to scaling and normalization, this becomes the sine of the angle spanned by the observedand calculated data vectors y(obs) and y(calc): the difference vector is placed at an angle of 90 degrees
onto the calculated data vector by scaling according to the L.S. protocol. Many times scaling is done
incorrectly, e.g. on the basis of the total number of counts in the patterns. In that case the value of RMS is
influenced not only by the angle between the n-dimensional vectors but also by scaling errors. Note thatthe order of the data points is unimportant for the calculation of RMS.

Page 60

61

A well known criterion for powder pattern similarity is Rwp (R-weighted pattern). This criterion is used forthe refinement of crystal structures on PXRD data and for structure solution from PXRD data. Rwp is similar to RMS but the squared differences are weighted according to the standard deviations in the observed
intensities.
Rwp =( ∑i=1, n wi (yi(obs)-yi(calc))2)1/2 / ( ∑i=1, n wi yi(obs)2 )1/2
wi = 1/yi(obs)

[V]
[VI]

This weighting of the individual contributions comes from least squares theory. It can easily be shownthat Rwp can be seen as a plain RMS criterion applied to modified powder patterns.
Rwp =( ∑i=1, n (yi(obs)1/2-yi(calc)/yi(obs)1/2)2 )1/2/ ( ∑i=1, n yi(obs))1/2[VII]

For this modification the pattern values in both the observed and calculated patterns should be divided by
the standard deviations in the observed intensities:
ymodi(obs) = yi(obs)1/2
ymodi(calc) = yi(calc)/yi(obs)1/2[VIII][IX]

Rwp =( ∑i=1, n (ymodi(obs)-ymodi(calc))2)1/2 / ( ∑i=1, n ymodi(obs)2 )1/2

[X]

As a result, also the scaling of the patterns is different from the one used for application of the RMS
criterion.
s(obs) = ( ∑i=1, n yi(calc)2 /yi(obs) / ∑i=1, n yi(obs))1/2[XI]

The weighting used in Rwp is, however, only meaningful when the peak positions in the observed andcalculated patterns are the same. The use of Rwp for the comparison of powder patterns corresponding tostructures with (significantly) different unit cells is therefore incorrect.
The WCC (Weighted Cross Correlation) criterion4 is based on correlation functions applied to unmodified
patterns.
WCC = ∫ wfg(r)cfg (r)dr / (∫ wff (r)cff (r)dr ∫ wgg(r)cgg (r)dr) 1/2
cfg (r) =∫ f(x)g(x+r)dx[XII][XIII]

The weighting function, which extracts information from the correlation functions, can be adapted toinfluence the sensitivity for shifts in peak positions, in XRD as a results of lattice parameter variations.
This is done by changing the value of l (values of l between 0.6 and 3.0 lead to stable and comparable
results4; the IsoQuest program5 uses 2.0):
wfg(r) = 1 - | r | / lwfg(r) = 0
wff (r) = wgg(r) = wfg(r)if | r | < lif | r | ≥ l

[XIV]
[XV]
[XVI]

The WCC criterion is equal to the cosine of the angle between two vectors in n-dimensional space when
you only look at r = 0 (pointwise). In that case
WCCr=0 = (1 - RMS2)1/2[XVIII]For r > 0 the comparison no longer holds.
Page 61

62

The WCC criterion is always normalized and scaling is unnecessary since this is done implicitly.
Comparison of deformed patterns, caused by unit cell variations, is possible with the WCC criterion since
it recognizes shifted peaks. It is more sensitive to intensity variations since you look at unmodified
patterns. However, this can easily be changed by mimicking the Rwp dampening of the intensities bytaking the square root of the patterns (this is done in the program IsoQuest, which is discussed below).
When we modify the patterns according to [VIII] and [IX] and calculate WCC at r = 0, we obtain therelation between WCC and Rwp, a relation between a sine and cosine function:
WCCmodr=0 = (1 - Rwp2)1/2[XIX]

So, for r = 0 there is a direct and clear relation between RMS, Rwp and WCC.

From powder diffraction patterns to structural similarity
The Fortran code for calculating the match between two powder diffraction patterns, using weighted crosscorrelation functions, is remarkably simple. With NX being the number of data points, XS the step size in
2theta, WI the value for the width of the weighting function, and C1 and C2 arrays containing theintensity values for pattern 1 and 2, the similarity SI (ranging from 0 to 1, 1 meaning perfect agreement)
can be calculated with the two subroutines MATCH and CORREL, given below.
In Appendix 1 additional code and data (Table 4 and 5) is given for test purposes. The necessary powder
diffraction patterns and also the Fortran code can be obtained from http://www.crystallography.nl/xmatch/.
.

C

SUBROUTINE MATCH(C1,C2,NX,XS,WI,SI)
DOUBLE PRECISION SI,A1,A2,CC
INTEGER NXDIMENSION C1(NX),C2(NX)
NW=NINT(WI/XS)
RW=1./FLOAT(NW)
CALL CORREL(C1,C1,NX,NW,RW,A1)
CALL CORREL(C2,C2,NX,NW,RW,A2)
CALL CORREL(C1,C2,NX,NW,RW,CC)
SI=CC/SQRT(A1*A2)
RETURNEND
SUBROUTINE CORREL(C1,C2,NX,NW,RW,CC)
DIMENSION C1(NX),C2(NX)
DOUBLE PRECISION T,CC
CC=0.0
DO 1 N=-NW+1,NW-1
T=0.0
DO 2 I=1,NX
J=I+N
IF(J.LT.1.OR.J.GT.NX) GOTO 2
T=T+C1(I)*C2(J)2
CONTINUE
CC=CC+T*(1.-RW*ABS(N))
1 CONTINUE
RETURN
END

Page 6263

IsoQuest: application of crystal structure comparison to the CSD databaseFig 4: Snapshot of the IsoQuest program showing that the structures TUTNOL andinitially seen as different structures, are redeterminations

MEACCU01,

On the basis of the method described above we developed the program IsoQuest5 for exploring theCambridge Structural Database1. IsoQuest tells you whether there are structures that are identical orsimilar to your structure (see Fig. 4). Hits from IsoQuest can be further analyzed with IsoBase, a database
containing the complete analysis of all (50 billion) structural relations in the CSD on the basis of the
IsoQuest principle.
An in-house powder diffraction database was derived from CSD entries for which 3D-coordinates areavailable (2theta range from 0 to 40 degrees). For this purpose a program was written that can convert
the complete CSD to a powder diffraction pattern database. The calculation of the PXRD patterns fromthe CSD entries is not straightforward. A lot of entries show disorder, contradictions in symmetry, nonexisting elements, etc. Many of these problems can, however, be ‘repaired’. The resulting powder patterndatabase can be searched by the IsoQuest program, using a structural model or reflection data as input.
With the IsoQuest program complete and often surprising lists of identical or related structures can befound in the CSD, in less than half a minute on a modern PC. Similar structures can be further exploredwith IsoBase, a database which contains all isostructurality relations in the CSD. IsoBase was generated
by comparing all entries with all other entries in the CSD. The advantage of this database is that an
IsoQuest search for a new structure can be further analyzed in a fast way. Why a further analysis?
Structures found by IsoQuest can be related to other structures, initially not found during the first search,and this can be checked using IsoBase (see examples below) by taking automatically all IsoQuest hits as(secondary) search structures.

Example 1: analyzing compound "ALACAC01"
An IsoQuest search for compound ALACAC01 (an arbitrary entry from the CSD) gives the following
result:Table 1 IsoQuest result for compound ALACAC01
REFCODE spacegroup abc alpha beta gamma volume Z nref S1S2 scale-------------------------------------------------------------------------------ALACAC01 P21/C
14.1
7.6 16.4 90.0 99.0 90.0 1722 4 69 1000 1000 1000
ALACAC03 P21/C
14.0
7.5 16.3 90.0 98.8 90.0 1699 4 68 997 982 1005
ALACAC02 P21/C
14.0
7.5 16.3 90.0 98.9 90.0 1694 4 69 997 978 1005
ALACAC12 P21/C
14.0
7.5 16.3 90.0 98.8 90.0 1702 4 67 992 980 1005
ALACAC11 P21/C
14.0
7.5 16.3 90.0 98.8 90.0 1702 4 69 992 980 1005
ACACCR
P21/C
14.0
7.6 16.4 90.0 99.1 90.0 1714 4 69 988 987 1000
ACACCR02 P21/C
14.0
7.5 16.4 90.0 99.0 90.0 1709 4 69 986 984 1005
ACACMN02 P21/C
14.0
7.6 16.4 90.0 99.3 90.0 1721 4 68 985 985 1000
COACAC03 P21/C
13.9
7.5 16.2 90.0 98.4 90.0 1665 4 66 981 944 1010
QAMCAI
P21/C
14.2
7.6 16.6 90.0 99.3 90.0 1758 4 71 981 966 995
ACACMN
P21/C
13.9
7.5 16.2 90.0 98.4 90.0 1661 4 65 980 939 1010
COACAC02 P21/C
14.0
7.5 16.2 90.0 98.5 90.0 1672 4 65 975 945 1010
ACACGA
P21/C
14.0
7.6 16.5 90.0 99.0 90.0 1731 4 70 974 973 1000
ACACRU03 P21/C
14.0
7.5 16.3 90.0 99.0 90.0 1702 4 69 966 952 1005
ACACRU04 P21/C
13.8
7.4 16.1 90.0 99.3 90.0 1619 4 63 965 878 1020
ACACRH10 P21/C
13.9
7.5 16.4 90.0 98.6 90.0 1689 4 68 952 935 1010
KABMIJ
P21/C
14.1
7.5 16.5 90.0 99.0 90.0 1717 4 70 950 950 1000
ACACRU
P21/C
13.9
7.5 16.0 90.0 99.1 90.0 1650 4 63 949 913 1015

Page 63

64

Using the result from IsoQuest and consulting IsoBase leads to five additional hits: NIRLAB,QQQCXJ01, QQQCXJ02, ACACRU05 and ACACRU06.
Table 2 IsoBase results for compound ALACAC01
REFCODE spacegroup abc alpha beta gamma volume Z nref S1S2 scale-------------------------------------------------------------------------------NIRLAB
P21/C
14.0
7.5 16.5 90.0 98.9 90.0 1707 4 69 963 961 1000
QQQCXJ02 P1121/B 13.9 16.4
7.5 90.0 90.0 98.6 1693 4 68 959 948 1005
QQQCXJ01 P1121/B 13.9 16.4
7.5 90.0 90.0 98.6 1693 4 68 959 948 1005
ACACRU06 P21/C
14.1
7.5 16.4 90.0 99.1 90.0 1713 4 69 951 949 1000
ACACRU05 P21/C
13.8
7.4 16.1 90.0 99.3 90.0 1638 4 63 949 879 1015

Refcodes which only differ in number (e.g. ALALAC01 and ALALAC03) correspond to the same
compound. Therefore, the result of the combined use of IsoQuest and IsoBase yields 23 related entries, ofwhich eleven entries are unique isostructural compounds.
Using the ligand system of entry ALACAC01 (attached to an "any"-atom) as a search fragment for theConquest6 program of the CCDC leads to only 14 of the 23 IsoQuest hits, of which 5 hits are uniqueisostructural compounds. This illustrates that entries can easily be missed and that IsoQuest and IsoBase
generate additional information.

Example 2: analyzing compound "BARNUD"
A compound consisting of three phenyl rings and one Cl-atom attached to acentral Si-atom, space group P21/c (see picture7 on the right) was used as input.
With IsoQuest 16 related structures are found for this compound. The results
for this search are given in Table 3.
Table 3. Results of a CSD-search for BARNUD using IsoQuest
CSD refcode Chemical and Crystallographic similarity to BARNUDWAKHOFCl replaced by SH
MTPHEP01 Cl replaced by (double bonded) CH2
MTPHEP10 = MTPHEP01 but measured at a different temperature
TPPOSSCl replaced by double bonded STPPOSS02 = TPPOSS but measured at a different temperature
TPPOSS03 triclinic polymorph of TPPOSS (P-1)
TPGEBR
Si replaced by Ge, Cl replaced by Br
TPPHSESi replaced by P, Cl replaced by Se
TPPHSE01 triclinic polymorph of TPPHSETPASNS
Si replaced by As, Cl replaced by double bonded S
TPASNS01 same as TPASNS
BONLEVSi replaced by P, Cl replaced by BH3, spacegroup P-1
BRTPSNSi replaced by Sn, Cl replaced by Br
TPSNCL01 Si replaced by Sn
TPSNCL02 = TPSNCL01 but measured at a different temperature
QUQCUASi replaced by Ge

Page 64

65

In this set you find all kinds of replacements. Moreover, the unit cell or space group is not always thesame. Different authors and journals are found for the same or similar compounds. Specifying a fragment
in Conquest, consisting of three phenyl rings attached to an "any"-atom, and combining this fragmentsearch with a search on unit cell (standard tolerance of 1.5%) gives you 23 hits: BURNAD, BUFFAJ,CUTYAR, FONLAV, FXFPRP, GELCEF, HAFSIQ, HELYUS, JOZVUP, PZGACU, TPASNS,TPASNS01, TPGEBR, TPPHSE, TPSNCL02, WAKHOF, BAFLUQ, QUQCUA, NAKJUF, NAKJUF01,
OGONIH, NAXFIC and WAWHOS. This set of 23 compounds contains 7 of the 16 isostructuralcompounds found by IsoQuest and 16 compounds that are not related to BARNUD in terms ofisostructurality, showing again that IsoQuest generates additional information.

Example 4: analyzing an in-house crystal structure
Are there structures in the CSD that have similar packings as one of the structures published by ourcrystallography department in Nijmegen? A remarkable result is found for compound DEQGUB. The
published crystal structures with CSD-refcodes WARDUO and NESDAQ are isomorphous although thecations in these structures are quite different (see Fig. 5). Apparently, the tetraphenylborate counterion(not shown) is dominating the crystal structures of these compounds.

5a

5b

5c

Fig 5: Cations present in 3 isostructural compounds. a: DEQGUB, b: WARDUO, c: NESDAQ

Example 5: large sets of isostructural compounds
IsoBase contains all isostructurality relations in the CSD and it can show for every entry the related
compounds. There are many large sets of isostructural compounds visible in this database. An example isthe set containing compound ECARAB. An amazing number of 42 isostructural compounds can be found
for this cholic acid clathrate: ZUZDON, GUNKOP, GUNMUX, GUNLUW, BIFQAI01, LAFCEA,TEMWOX, GUNLOQ, ERIPUQ01, VABSOG, ERIPUQ, ZUZDUT, WEYNUJ, GUNNIM, GUNLAC,
UMABAL, RABKEG, YUNYOV01, LAFCAW, PUWREE, ZUZFAB, YUNYOV, PIWKUB,LAFCAW01, GUNMAD, GOVRAK, MIWTIV, PIWKOV, PIWKOV01, LAHPOA, ZUPKIE,
HURPEP, GUXFEK, HURNUD, ZEJFEZ, GUXFOU, GUXGAH, GUNMEH, GUXFAG, GOVQOX,VUTWAI and JOLFIZ.
Three of them (ECARAB, GOVRAK and HURPEP) are shown in Fig. 6. GOVRAK is a cholamide ptoluidine clathrate and consists of different host and guest molecules compared to ECARAB. HURPEP is
also isostructural to ECARAB but has twice the unit cell volume.

Page 65

66

Fig 6: top: ECARAB ; middle: GOVRAK ; bottom: HURPEP

This last example demonstrates again that the method described in this article is able to trace related
compounds with differences in chemistry and/or symmetry and can collect sets of structures from theCSD database that can be used for studying the phenomenon of isostructurality or(pseudo)polymorphism.

Conclusions
The method for crystal structure comparison presented in this article is a powerful tool for
crystallographers to check the uniqueness of newly determined structures, to look for related structures
and to classify sets of structures. Moreover, applied to structural databases it is a way to generate new
information on packing principles and crystal engineering rules.

References
1) The Cambridge Structural Database: a quarter of a million crystal structures and rising.
F. H. Allen, Acta Crystallogr., B58, 380-388, 2002.
2) Method for the computational comparison of crystal structures. E.L. Willighagen, R. Wehrens, P. Verwer, R. de Gelder,
L.M.C. Buydens, Acta Crystallogr., B61, 29-36, 2005.
3) Mercury: visualization and analysis of crystal structures.
C. F. Macrae, P. R. Edgington, P. McCabe, E. Pidcock, G. P. Shields, R. Taylor, M. Towler and J. van de Streek, J. Appl.
Cryst., 39, 453-457, 2006.
4) A Generalized Expression for the Similarity of Spectra: Application to Powder Diffraction Pattern Classification.
R. de Gelder, R. Wehrens and J.A. Hageman. J. Comp. Chem., 22, 273-289, 2006.
5) SYSTER and ISOQUEST: How good and unique are your data and structure?
R. de Gelder and J.M.M. Smits. Acta Crystallogr., A60, s78, 2004.
6) New software for searching the Cambridge Structural Database and visualising crystal structures. I. J. Bruno, J. C. Cole, P.
R. Edgington, M. Kessler, C. F. Macrae, P. McCabe, J. Pearson and R. Taylor, Acta Crystallogr., B58, 389-397, 2002.
7) PLATON, A Multipurpose Crystallographic Tool. A.L. Spek, Utrecht University, Utrecht, The Netherlands, 2005.
Page 66

67

Appendix 1:
PROGRAM XMATCH
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C

Last update: 191006 RdG
Calculates the match between powder diffraction patterns.
Returns a value between 0.0 and 1.0 for the similarity (SI).
1.0 means perfect agreement, 0.0 means completely different.
NP: number of powder patterns
NX: number of data points
XS: step size in 2theta
WI: single precision value for the width of the weighting function
SI: a single double precision value for the similarity
CO: intensity values for each pattern
CM: similarity matrix
DOUBLE PRECISION SI
DIMENSION CO(3001,20),CM(20,20)
NP=20
NX=3001
XS=0.02
WI=0.62
OPEN (UNIT=2, FILE='wcc.out', STATUS='UNKNOWN')CALL READPR(CO,NP,NX)
DO 1 I=1,NP
DO 2 J=I,NP
CALL MATCH(CO(1,I),CO(1,J),NX,XS,WI,SI)
CM(I,J)=SI
CM(J,I)=SI
2
CONTINUE
1 CONTINUEWRITE(2,4) WI
WRITE(2,5) (I,I=1,NP)
DO 3 I=1,NP
WRITE(2,6) I, (CM(I,J),J=1,NP)
3 CONTINUE
4 FORMAT(' Width of the weighting function = ',F5.2)
5 FORMAT(7X,1X,20(I5,1X))
6 FORMAT(I7,1X,20(F5.2,1X))
STOP
END

C
SUBROUTINE READPR(CO,NP,NX)
DIMENSION CO(3001,20)
CHARACTER*12 FN(20)DATA FN /'cefraa.dat','cefrab.dat','cefrna.dat','cefraq.dat',
1'cf2acn.dat','cfbipi.dat','ceflx2.dat','ceflan.dat',
2'cecloa.dat','second.dat','cfrob3.dat','copabe.dat',3'codi26.dat','codi27.dat','cfpabe.dat','cef2ff.dat',
4'cfhchn.dat','cf4maf.dat','cfdmfs.dat','cfm3hb.dat'/
WRITE(2,*)'******************************************************'WRITE(2,*)'Test : 20 powder patterns of cephalosporin complexes .'WRITE(2,*)'See: J. Comp. Chem. (2001), 22, 3, 273-289.'
WRITE(2,*)'Results must agree with data in Table 5.'
WRITE(2,*)'******************************************************'
DO 1 I=1,NP
OPEN (UNIT=1, FILE=FN(I), STATUS='OLD')
DO 2 J=1,NX
READ(1,*,END=3) X,CO(J,I)
2
CONTINUE
3CLOSE (1)
WRITE(2,4) I,FN(I)
1 CONTINUE
4 FORMAT(' Pattern ',I2,': ',A12,' read')
WRITE(2,*)'******************************************************'
RETURN
END

Page 67

68

Table 4 Crystal data corresponding to the test powder diffraction patterns
Compound name
Cefradine/alpha-naphthol
Cefradine/beta-naphthol
Cefradine/naphthalene
Cefradine/quinoline
Cefradine/2-hydroxy acetonaphthone
Cefradine/bipyridine
Cephalexine/beta-naphthol
Cephalexine/alpha-naphthol
Cefaclor/alpha-naphthol
Cefaclor/beta-naphthol
Cephadroxil/beta-naphthol
Cephadroxil/4-hydroxy-benzoezuur
Cephadroxil/2,6-dihydroxy-naphthalene
Cephadroxil/2,7-dihydroxy-naphthalene
Cefradine/4-hydroxy-benzoezuur
Cefradine/2-phenylphenol
Cefradine/hydroquinone
Cefradine/4-methylacetophenone
Cefradine/DMF
Cefradine/methyl 3-hydroxybenzoatea23.47079
23.4211923.45837
23.41265
23.38549
23.02269
23.39759
23.43432
23.48840
23.44692
7.11174
6.99921
7.10786
7.09018
14.91661
23.56421
7.07185
15.40382
10.87473
10.90731b
7.121546.97147
7.11788
7.109107.19649
7.14670
7.06229
7.10804
7.07855
7.0261921.71704
20.99127
21.86340
21.27323
7.38199
7.1320310.70306
7.29832
9.511409.40654c
α14.93036
90.0
15.00473
90.0
14.89216
90.0
14.80598
90.0
14.75882
90.0
14.55443
90.0
14.91757
90.0
14.87538
90.0
14.84551
90.0
14.8413490.0
30.95857
90.0
30.69011
90.0
32.30589
90.0
31.00436
90.0
20.50296
90.0
18.68928
90.0
14.23422 87.15449
23.57355
90.0
12.39035
90.0
12.19924
90.0

Space

β
γ
group Type108.26834
90.0
C2
A1
110.40521
90.0
C2
A2
108.57098
90.0
C2
A3
108.14590
90.0
C2
A4
108.57974
90.0
C2
A5
104.64385
90.0
C2
A6
109.79842
90.0
C2
A7
108.19072
90.0
C2
A8
108.94678
90.0
C2
A9
110.55009
90.0
C2
A10
90.0
90.0
P212121 B11
90.0
90.0
P212121 B12
90.0
90.0
P212121 B13
90.0
90.0
P212121 B14
105.77318
90.0
P21
C15
109.37986
90.0
C2
D16
78.99942 89.74252
P1
E1799.35406
90.0
P21
F18
98.70461
90.0
P21
N19
98.53256
90.0
P21
N20

Table 5 Pattern similarity values for the test powder diffraction patterns
A1
A2
A3
A4
A5
A6
A7
A8
A9
A10
B11
B12
B13
B14
C15
D16
E17
F18
N19
N20

A1
1.00

A2
0.80
1.00

A3
0.99
0.82
1.00

A4
0.96
0.82
0.98
1.00

A5
0.93
0.78
0.92
0.90
1.00

A6
0.88
0.78
0.90
0.90
0.82
1.00

A7
0.93
0.93
0.94
0.93
0.86
0.85
1.00

A8
0.99
0.83
0.99
0.97
0.91
0.89
0.95
1.00

A9
0.92
0.87
0.93
0.91
0.85
0.85
0.96
0.95
1.00

A10
0.82
0.95
0.83
0.81
0.79
0.79
0.94
0.85
0.93
1.00

B11
0.78
0.80
0.81
0.79
0.72
0.85
0.81
0.80
0.79
0.78
1.00

Page 68

B12
0.60
0.75
0.63
0.63
0.61
0.69
0.66
0.61
0.66
0.71
0.84
1.00

B13
0.78
0.75
0.79
0.76
0.75
0.75
0.77
0.77
0.75
0.73
0.87
0.78
1.00

B14
0.72
0.80
0.75
0.74
0.69
0.77
0.78
0.74
0.77
0.78
0.96
0.89
0.87
1.00

C15
0.75
0.76
0.76
0.76
0.81
0.74
0.75
0.75
0.71
0.73
0.73
0.70
0.77
0.73
1.00

D16
0.80
0.77
0.82
0.78
0.75
0.75
0.81
0.80
0.78
0.77
0.83
0.67
0.83
0.78
0.67
1.00

E17
0.63
0.68
0.66
0.71
0.58
0.63
0.66
0.65
0.63
0.60
0.66
0.67
0.66
0.70
0.70
0.55
1.00

F18
0.66
0.69
0.67
0.67
0.73
0.68
0.66
0.65
0.64
0.66
0.69
0.74
0.75
0.70
0.75
0.63
0.60
1.00

N19
0.34
0.34
0.35
0.34
0.31
0.33
0.35
0.34
0.34
0.32
0.41
0.42
0.42
0.44
0.43
0.36
0.37
0.42
1.00

N20
0.41
0.41
0.41
0.39
0.40
0.38
0.40
0.41
0.39
0.37
0.42
0.41
0.44
0.43
0.44
0.35
0.45
0.53
0.80
1.00

69

Topological analysis of crystal structures
Oleg V. Dolomanov
Department of Chemistry, The University of Durham, South Road, Durham, DH1 3LE, UK. Correspondence e-mail: pcxod@nottingham.ac.uk ; WWW: http://www.ccp14.ac.uk/ccp/web-mirrors/lcells/

Introduction
Extended structural networks are present in a wide range of chemical compounds. The importance ofanalysis of these networks stems from the need to classify the materials in terms of their threedimensional structure and the construction of different structure-property correlations. The classification
assumes the existence of an invariant which consistently describes the framework of these materials. A
number of invariants have been introduced for the description of extended frameworks, such as•••

Schläfli symbols, vertex symbols or topological terms [1]Coordination sequences and topological density [2-4]Cycle sequences [5, 6]

These invariants have been mainly used for zeolitic frameworks, which consist only of tetrahedral nodes.
However, Schläfli symbols in particular are finding increasing application in structural networks ofdifferent connectivity.
The easiest invariant to interpret is the Schläfli symbol, which describe the environment of a selected
node within an extended network. Coordination sequences are not as easily interpreted as they describesummarised growth of nodes in coordination shells; being periodic, they can have a very long period,
which can make them hard to use. The cycle sequences represent a combined approach, which does notmake them as comprehensive as vertex symbols or more practical than coordination sequences. However,in some cases it is necessary to use a combination of these invariants to describe networks, in particular itis necessary for polymorphs (e.g. diamond and lonsdalite), because a single invariant may be not uniquefor highly related systems.
Evaluation of these characteristics for structural networks is straightforward in the case of 2D structures,but may be very complicated in case of 3D structures. This article focuses on the algorithms for theconstruction of topological networks and evaluation of vertex symbols, which are implemented in the
crystal structure visualisation and analysis program “Olex” [7].

Definitions
A topological network is the mathematical abstraction of the connectivity of an extended structural
network. Such a network can be mono- or multi-component. The transformation of a chemical network
into its topological representation proceeds as follows: if one of these entities (e.g. metal cation, ligand,coordinating solvent or counteranion) is connected to only one another, then it is removed; if it isconnected to two others, it is replaced with a bond between the neighbouring entities; if it is linked tomore than two others it is considered as a node. In this representation the network appears as amathematical graph where each node is associated with a list of at least three other nodes. The length ofthe pathway between any two nodes is given by the number of nodes along it, including the first and thelast nodes.
The definition of a ring which is used in this discussion is consistent with the definition of the primitive
ring by Marians [8] and represents a circuit, which cannot be split into two smaller ones. Alternatively, it
can be defined as a circuit, where all the shortest paths between any two nodes belong to the ring. Theserings are also called minimal rings [9].
Page 69

70

Term “coordination shell” is closely related to the term coordination sequence [2-4], and describe nodes
topologically equidistant8 from a selected one. Thus, the first coordination shell represents the immediate
environment of a central node, whereas the second consists of nodes directly connected to the nodes ofthe first shell, but excluding the central atom. Coordination sequences and shells are related so that the kth
member of the coordination sequence represents the number of atoms in the kth coordination shell.

An example
One of the simplest examples of extended network can be a square grid (Fig 1). To evaluate the vertex
symbol for central node, unique circuits based on outgoing bonds have to be counted. The four fourmembered circuits can be easily seen. These circuits also comply with the definition of ring. However, fora four- connected network 6 circuits is expected.9 The other two six-membered circuits to be found areillustrated in Fig 1.

6

6

4

Figure 1: View of an element of a square grid. The red node is central, blue nodes – the first coordination shell, green nodes – second coordination shell.

These circuits are not rings, as they consist of two smaller four-membered rings and therefore do notcomply with the ring definition. The composition of the vertex symbols will be discussed later. However,from this example it is seen that in order to evaluate vertex symbols the construction of topological network is required and an algorithm to find circuits formed by two bonds outgoing from chosen atom isneeded as well.

Construction of topological networks
Extended structural networks can be very complicated due to the presence of a variety of chemical components and in this way differ from networks of inorganic zeolites, where structural and topological networks are almost identical. There are two approaches to the construction of topological networks: one isbased on the application of the definition of a topological node (mathematical abstraction, Fig 2), while
the other uses information about building blocks of the structure. The first algorithm does not require any
user input, whereas the second one needs the user to define components of the structure. Despite being
generic, the first algorithm may lead to topological networks with no chemical sense, and further intervention by the user is needed to interpret the resulting topological network in terms of the chemical species present (e.g. to identify which nodes belong to the ligand).

8

Topological distance is counted in number links between nodes and therefore length of the pathway from these nodes to theselected one is equal.
9
For an n-connected node the number of circuits to be found is n*(n-1)/2
71
Page 70

H
N
NH

N

N
null-dimensional

HN
N
H

N

N

N

N

N

N
N

N
N
N

N

non reducibleN

Fig 2: View of the mathematical abstraction of a chemical structure. According to the described algorithm hydrogen atoms are removed and atoms connected to only two others are replaced with a bond.

The mathematical abstraction algorithm for the construction of topological networks can be illustrated by
the following code snippet:
Construction of topological network using mathematical abstraction approach snippet
The first approximation is that all atoms of the structure are nodes. Upon return, only nodes by definition will be left
nodesRemoved = 1
while (nodeRemoved){
nodesRemoved=0;
for (i=0; i<nodeCount; i++){if (Node[i].NeighbourCount < 2){
Node[i].Remove();i- -;nodesRemoved++;continue;}if( Node[i].NeighbourCount == 2){
Node[i].Neighbour[0].LinkTo( Node[i].Neightbour[1] );Node[i].Remove();i--;nodesRemoved++;continue;}}}-node connected to one other-remove the node-linking node-link the neighbouring nodes, remove current

Ring statistics in chemistry
Evaluation of vertex symbols requires counting the number of rings in the environment of a particular
topological node. This is closely related to the concept of ring statistics, which has a very important rolein chemistry. The ring system of a molecule is a key feature in determining its shape and properties. Ring
statistics are also used for the interpretation of chemical structure, design of organic synthesis and storageof chemical information [10, 11]. Many computer algorithms have been developed to obtain specificinformation from chemical structures in terms of their ring interconnectivity for either discrete or
polymeric structures. These algorithms, which were reviewed by Downs [12], can be divided into
following groups:• Graph theory
general, spanning tree, edge combination, incidents matrix, connection table, adjacency matrix,
half-ring tracing, breadth-first growth of spanning tree, maximal adjacency matrix• Planar projection• Walk through the connectivity table
There is a large choice of algorithms. Each was designed to perform a specific role, and many of the 24
algorithms, reviewed by Downs fail for complex ring systems. However, the description of topologicalnetworks using vertex symbols converges to a relatively simple task – the algorithm does not have toPage 7172

evaluate all rings in the system; instead the rings have to be found in the environment of a selected node,
which simplifies the job significantly.

Circuit perception
Yuan and Cormack [13] describe a convenient algorithm for primitive ring statistics in compounds with
topological networks with intermediate connectivity (e.g. 4-connected), but without translational
symmetry such as silicate glasses. The algorithm has several good points:(1) absence of upper limit on ring size, (2) low memory usage, (3) speed
The algorithm consists of three subroutines: shortest path search, shortest path identification, andidentification of primitive rings. Additionally the algorithm is optimised for the shortest-path search byspecifying the search direction (“four-point directing single-pair search”), which gives it some advantages
in calculation speed.
The algorithm, described here, has similar characteristics to the one above, but with emphasis on theevaluation of vertex symbols. It intensively utilises the modified breadth-first algorithm [14], which isused for rings perception as well as to find shortest path length between any two nodes of the network.10
It was modified in order to find a circuit or a path between nodes; normally two nodes are used instead ofa single node in the original algorithm. This modification gives good improvement in performanceleading to about fourfold increase in speed as the volume of a sphere grows as its radius cubed (Fig 3).

Frontier

Node

Node1

Fig 3: An illustration of the modified breadth-first algorithm. The dotted line shows the volume of nodes
which have to be processed when the algorithm is initiated from one node and the solid lines show thevolume of nodes when the algorithm is initiated from both nodes simultaneously.

It was found that simple breadth-first algorithm is not applicable to find all possible rings in the network
due to the algorithm’s anisotropic nature (Fig 4b,c), which appears in different node numbering in
dependence on the starting node. Also it is almost impossible to use the down-walk11 approach to find all
possible rings around central node as illustrated in Fig 4a.

10

Originally, this algorithm is used to build spanning trees for a graph; here it is used to assign atoms coordination shell numbers (tags), which further can be processed to retrieve necessary information.
11
A walk between linked nodes from the one with higher tag to a smaller one; the difference between the tags must be 1.
73
Page 72

4

3
2

2
2

3
1

3

4

1

4

4

0

0

0

5

2

1

4
3

5

3

4

2

2
3

3

4

a

b

c

Fig 4: (a) An illustration of a situation where the breadth-first algorithm fails - the longer 8-memberedring is not found. (b, c) An illustration of the anisotropic nature of the down-walk algorithm. The
algorithm produces different numbering in dependence on the starting node.

To eliminate these features of the algorithm, it was modified so that the numbering starts from both nodes
simultaneously using different tags. Nodes, where the numbering conflict occurs (one tag is assigned avalue and the other tag is about to be assigned) are remembered and the tag-assignment is halted. This
modification is referred to as the frontier search algorithm. When the numbering stopped, the network
consists of two hemispheres, where nodes have only one tag initialized out of two. Following
completeness of the initialization from each conflicting node allows acquiring of all possible circuits
using the down-walk approach.
The frontier search algorithm is illustrated in Fig 5. In Fig 5a the hemispheres are constructed and in Fig
5b the completeness of the initialization from the conflict nodes, shown in black, is illustrated. After thetags of nodes are initialised completely, the graph is ready for down-walk search of circuits (4a down to
1a in Fig 5b and 7a down to 1a in Fig 5c).
2a

2a

2b

1a

1a

1b
0
2b
3b

3a

2a

3b

4b

4b

b

7a
0

2b

3a

2b

1a

4a
0

2a

a

2a

3a

2a

6a
5a

3a
4a

c

Fig 5: An illustration of the frontier search algorithm. (a) View of tags after the execution of frontier
search algorithm; nodes 4b and 2b are remembered. (b, c) Following completing initialisation of the “a”
tags from the conflicting nodes allows finding either ring.

The number of the conflict nodes is not very large in comparison with whole network (a plane in 3D), but
the number of operations increases dramatically. To improve the performance, the conflict nodes have to
be sorted by their tags in ascending order and the search for a primitive ring should be performed for eachconflict node. If such a ring is found, the procedure has to be performed for the remaining of conflictnodes having the same number. This allows finding of all alternative equally-sized rings, as required forthe evaluation of long vertex symbols.

Page 73

74

The frontier search algorithm snippet.
This algorithm assumes that a node has two tags (can be implemented with two arrays for exiting code) and these tags are initialised withnegative values (e.g. -1). NodeA and nodeB are the two nodes in the environment of the central node for which the frontier is to be found.
List shellA, shellB, frontier;shellA.add( nodeA );shellB.add( nodeB );nodeB.Tag2 = 1;
centraNode.Tag1 = centralNode.Tag2 = 0;
while (true){
length = shellA.length;
for (i=0; i<length; i++){for (j=0; j<shellA[i].NeighbourCount; j++){if ( shellA[i].Neighbour[j].Tag1 < 0 ){if (shellA[i].Neighbour[j].Tag2 > 0 )frontier.Add( shellA[i].Neightbour[j] );shellA[i].Neightbour[j].Tag 1= shellA[i].Tag1 + 1;}
shellA.Remove(0);i--;}}length = shellB.length;
for (i=0; i< length; i++){for (j=0; j<shellB[i].NeighbourCount; j++){if (shellB[i].Neighbour[j].Tag1 < 0 && shellB[i].Neighbour[j].Tag2 < 0)shellB[i].Neightbour[j].Tag2 = shellB[i].Tag2 + 1;}
shellB.Remove(0);i--;}if( shellA.Empty && shellB.Empty ) break;}-initialise the first step
-this is used to tackle three-membered rings-this eliminates the central node from counting-infinite loop over all nodes-make sure that only one coordination shell is
processed a time-remember the node – numbering “collision” occurred-assign next coordination number-get rid of the processed nodes; different methods
to improve performance can be implemented-make sure that only one coordination shell is
processed a time

-do not have to search for the frontier here – theprevious piece of code does it

all nodes processed – may quit now; different
conditions can be used to stop the process (e.g.
maximum circuit length)

The circuit perception algorithm snippet for two nodes in the immediate environment of the given node.
The algorithm assumes that node tags have been initialised as above. Circuits are evaluated for the central node. To evaluate all circuits
n*(n-1)/2 iterations have to be done for all nodes in the environment of the central one.
List FoundCycles;
ringLevel = 0;
ringFound = false;
SortFrontiedByTag1();
RememberTags();for (i=0; i<frontier.length; i++){if( ringFound && frontier[i].Tag1 != ringLevel ) break;frontier[i].CompleteTag1Initialisation();
List circuits = frontier[i].WalkDownExpandCircuits();for (j=0; j<circuits.length; j++){if (circuit[i][ circuit.length-1] != nodeA ){circuits.Delete(j);j--;continue;}if( !ShortcutExists( circuits[j] ) ){ringFound = true;
ringLevel = frontier[i].Tag1;}}
FoundCycles.AddUnique( circuits );RestoreTags();}-this will be returned-sort all where numbering collision occurred by Tag1
-have to remember the tags as they get changed later-condition when all circuits of the same size are processed-complete initialisation of Tag1 for all nodes where it -1-get the list of all circuits using down-walk approach-check that the circuit leads to nodeA-check if current circuit is a ring; this will be one of conditions
to break further iterations-add only unique circuits only (with different nodes in the
middle)-restore tags for the next iteration

CompleteTag1Initialisation function snippet
Page 74

75

The function assumes that node tags have been initialised by the frontier search algorithmfor (i=0; i<this.NeigbourCount; i++){if( this.Neightbour[i].Tag1 < 0 ){if( this.Tag2 < this.Neighbour[i].Tag2 ){this.Neighbour[i].Tag1 = this.Tag1 + 1;
this.Neghbour[i].CompleteTag1Initialisation();}}}-iterate through all connected nodes-check if Tag1 is initialised-the down-walk condition-recursive call

The down-walk algorithm snippet
These two function are used to list all circuits of a given node
List WalkDownExpandCirrcuits(){
List circuits, circuit;this.WalkDown( circuit, circuits );return circuits;}
WalkDown( List curerrentCircuit, List circuits ){for (i=0; i<this.NeighbourCount; i++){if( (node.Tag1 – node.Neighbour[i]) == 1 ){List newCircuit;
newCircuit.Assign( currentCurcuit );circuitCurcuit.Add( node );node.Neighbour[i].WalkDown( newCircuit );circuits.Add( newCircuit );}}}-a convenience function-walk down condition – the tags difference is 1
-copy values from previous circuit segment so that the circuits
consist of all nodes-recursive call

Circuits Analysis
We have tried different methods for the analysis of circuits, but no easily-implemented or reliablealgorithms were found, and so full circuit analysis is performed. The full analysis is done by trying to finda shorter path between any two nodes of a circuit than the ones, which belong to the circuit. As mentioned
above the shortest path length is evaluated using modified breadth-first algorithm.
Shortcut search algorithm snippet
The algorithm assumes that content of the circuit is ordered sequentially, so that node index represent its distance from nodeA or nodeB
boolean ShortcutExists( circuit ) {for (i=0; i<circuit.length; i++){for (j=i+2; j<circuit.length; j++){length = circuit.Node[i].DistanceTo( circuit.Node[j] );if ( (length < (j-i)) &&(length < (circuit.length +1 – (j-i))) )return true;}}
return false;}-go through all nodes of the circuit
i+2: nodes must be separated by at least two others for
shortcut to exist-compare with one side of the circuit-compare with other side of the curcuit-shortcut found in this case-no shortcut found

Page 75

76

Publishing symbols
The circuit search algorithm has to be applied to all unique pairs of bonds outgoing from the central atom.
After this is done, vertex symbols can be easily evaluated. To evaluate the short vertex symbol, rings ofdifferent sizes formed by all distinct angles (an angle is formed by two bonds outgoing from the centralnode) are counted. If a ring does not exist, then a shortest circuit is taken according to Smith [15];according to Wells [1] the shortest circuit is taken in any case. Then the rings are sorted in ascending size
and the ring number is used as a superscript. It is noteworthy that some authors prefer to omit a circuit if
the ring cannot be found. Thus for the network discussed in the example (Fig. 1) the short vertex symbol
is 4462 (some authors prefer to refer to it as to the 44 grid).
Long vertex symbols are used for four-connected networks and can be composed by the following
procedure described by O’Keeffe [16, 17]:
1. evaluate all rings (including alternative of the same size) for all six angles; if no rings can befound, the infinity sign (∞) is used
2. group symbols for opposing angles together
3. indicate the number of rings of the same size by a subscript, omitting one
4. order the rings in ascending order, considering point 2
Performing this procedure for the network in Fig 1 gives 4.4.4.4. ∞.∞.

Implementation
Algorithms described above are implemented in the Olex [7] program, which is freely available at the
CCP14 website. Users can use Olex to open SHELX files, grow the structure using symmetry operations,construct a topological network and evaluate short/long vertex symbols for the structure. An interface isprovided for the analysis of networks with short interactions (e.g. hydrogen bonds) and for assigning
nodes of the automatically generated topological network to distinct chemical components of the network(e.g. ligand, counteranion, etc),
Ag

+

N

N

S

Ag

+

Ag

Ag

Ag

Ag
Q

N
Ag

+

Ag

N
Ag

Ag

Ag

Ag

+

Figure 6: An illustration of the topological network construction. The first step is the mathematicalabstraction of the chemical network, the second step is to give the network a chemical sense.

The program works with networks based upon covalent bonds and to analyse networks with shortinteractions the user can transform a list of selected short interactions into “covalent” bonds and canperform the analysis in the same way as for any other covalent network. The tool for making chemicallysensible topological networks allows on to choose some topological nodes/bonds and to replace themwith a new topological node (Fig 6, [18]).

Page 76

77

Conclusions
Algorithms for topological analysis of extended structural networks and evaluation of vertex symbols are
discussed and implementation is provided in code snippets. The algorithms were implemented in the“Olex” software and were tested on a variety of zeolitic and metalloorganic networks and had shown
results consistent with previously published data.

Acknowledgements
I thank Dr Simon Parsons for help in preparation of this article.

References
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.

A. F. Wells, 'Three-Dimensional Nets and Polyhedra', John Wiley & Sons, 1977
W. M. Meier and H. J. Möck, J. Solid State Chem., 1979, 27, 349-355
G. O. Brunner, J. Solid State Chem., 1979, 29, 41-45
R. W. Grosse-Kunstleve, G. O. Brunner and N. J. A. Sloane, Acta Cryst., 1996, A52, 879-889
A. Beukemann and W. E. Klee, Z. Kristallogr., 1994, 209, 709
G. Thimm and W. E. Klee, Zeolites, 1997, 19, 422-424
O. V. Dolomanov, A. J. Blake, N. R. Champness, C. Wilson and M. Schröder, J. Appl. Cryst.,
2003, 36, 1283-1284
C. S. Marians and L. W. Hobbs, J. Non-Cryst. Solids, 1990, 124, 242-253
L. Guttman, J. Non-Cryst. Solids, 1990, 116, 145-147
Y. Takahashi, J. Chem. Inf. Comput. Sci., 1994, 34, 167-170
B. Schmidt and J. Fleischhauer, J. Chem. Inf. Comput. Sci., 1978, 18, 204-206
G. M. Downs, V. J. Gillet, J. D. Holiday and M. F. Lynch, J. Chem. Inf. Comput. Sci., 1989, 29,
172-187
X. Yuan and A. N. Cormack, Computational Materials Sciences, 2002, 24, 343-360
T. H. Cormen, C. E. Leiserson and R. L. Rivest, 'Introduction to Algorithms', MIT Press, 1990
J. V. Smith, American Mineralogist, 1978, 63, 960-969
M. O'Keeffe and B. G. Hyde, 'Crystal Structures I: Patterns and Symmetry', Mineralogical Societyof America Monograph, 1996
M. O'Keeffe and S. T. Hyde, Zeolites, 1997, 19, 370-374
O. V. Dolomanov, D. B. Cordes, N. R. Champness, A. J. Blake, L. R. Hanton, G. B. Jameson, M.
Schröder and C. Wilson, Chemical Communications, 2004, 642-643

Page 7778

On the Detection of Solvent Accessible Voids in Crystal Structures with
PLATON/SOLV
Anthony (Ton) L. Spek
Crystal & Structural Chemistry, Bijvoet Centre for Biomolecular Research, Science Faculty, Padualaan
8, Utrecht University, 3584 CH Utrecht, The Netherlands. Email: a.l.spek@chem.uu.nl ; WWW:
http://www.cryst.chem.uu.nl/

1.

Abstract

A technique is described, as implemented in the program PLATON, for the determination of solvent
accessible voids in a crystal structure. Current applications of this utility include the SQUEEZE method
for the handling of disordered solvents in crystal structure refinement, crystal structure validation withCHECKCIF to report on possibly missed voids in a structure model and the classification of pores inframework structures.

2.

Introduction

Our interest in solvent accessible voids in a crystal structure stems from a problem that we encounteredwith the refinement of the crystal structure of the drug Salozopyrin that appeared to include continuous
solvent channels [1]. The residual electron density in those channels (shown in Fig. 1) could not bemodeled satisfactorily with a disorder model. The difference Fourier map (Fig. 2) showed no isolated
peaks but rather a continuous density tube filled with unknown solvent. After having surmounted the
problems to obtain suitable crystals for data collection we got subsequently stuck with an unsatisfactorilyhigh and un-publishable R-value due to the unaccounted for solvent contribution. This problem was thestart of the development of a technique now named SQUEEZE and available in the program package
PLATON [2]. A description of a prototype implementation of the current method, at that time named
BYPASS and interfaced with SHELX76, can be found in reference [3]. The underlying concept of
SQUEEZE is to split the total scattering factor FH(calc) into two contributions: the contribution of theordered part FH(Model) and the contribution of the disordered solvent FH(solvent). The latter contribution
is obtained by back-Fourier transformation of the electron density that is found in the solvent region in the
difference Fourier map. This recovery procedure is repeated until conversion is reached. SQUEEZE
interfaces with SHELXL97 [Göttingen] and CRYSTALS [Oxford].
Judging from the number of structures that are flagged in the CSD for the fact that SQUEEZE was used,
it can be estimated that this procedure was used at least 1000 times and probably many times more.
This contribution will address only the algorithm that is used to establish the solvent accessible volumes
in a crystal structure.

Page 7879

Figure 1: Views down and perpendicular to the solvent accessible channels (green) in the crystal
structure of the drug Salazopyrin.

Figure 2: Section through the difference Fourier map showing the content of the channels.

Alternative approaches for the determination of voids have been reported by Richards [4], Ho & Marshall[5], Mugnoli [6], Watkin [7] and Wigderson & Meyer [8].

3.

The Algorithm

All crystal structures contain void space in small regions and cusps between atoms. In the order of 35% of
the space in a crystal structure lies outside the van der Waals volume of the atoms in the structure. In thecurrent context, we are not interested in those voids but rather in voids that can at least accommodate asphere with minimum radius R(min). A good default choice for R(min) = 1.2 Å, being the van der Waals
radius of a hydrogen atom. Most structures exhibit no voids in the last sense.
Page 79

80

In this section, we will first give an ‘analog’ graphical introduction to the concept of ‘solvent accessible
volume’ and then more details on its numerical implementation of the concept.
3.1 The analog model
Solvent accessible voids are determined in three steps as illustrated in fig. 3.

Step #1: A van der Waals radius is assigned to all atoms in the unit cell. In this way, we have divided thetotal volume V into two parts: V(inside) and V(outside). Note that as a byproduct, we can determine theso called Kitajkorodskij packing index [9]:Packing Index = V(inside) / V.
Step #2: Define the volume within which all points are at least 1.2 Å away from the nearest van der Waals
surface. This volume is obtained in a way similar to that in step #1 but now with atom radii being the vander Waals radii increased by 1.2 Å.
Step #3: Extend the volume obtained in step #2 with all points that are within 1.2 Å from its bounding
surface.

STEP #1 – EXCLUDE VOLUME INSIDE THE
VAN DER WAALS SPHERE

STEP # 2 – EXCLUDE AN ACCESS RADIAL VOLUMETO FIND THE LOCATION OF ATOMS WITH THEIRCENTRE AT LEAST 1.2 ANGSTROM AWAYSTEP # 3 – EXTEND INNER VOLUME WITH POINTS WITHIN
1.2 ANGSTROM FROM ITS OUTER BOUNDS

Figure 3: Cartoons illustrating the three stages of the identification of the solvent accessible volume.

Page 8081

3.2 The Numerical Implementation
The numerical implementation of the model described in section 3.1 is relatively compute intense. We
give here only a sketchy description. The actual implementation involves significant bookkeeping and isbest gleaned from the Fortran source. The calculations are based on a grid with a distance between
gridpoints in the order of 0.2 Å. The exact value depends on the need to have an integral number of grid
steps in each of the three dimensions.

Step #1: Each gridpoint is marked as either (I) inside the van der Waals volume, (II) at least 1.2 Å awayfrom the nearest van der Waals surface or (III) neither (I) or (II). Note: for the SQUEEZE application, afaster shortcut is used but this will not be discussed here.
Step #2: Connected sets of gridpoints of type (II) are assembled into void objects (either as isolated
entities or 1, 2 or 3 dimensional channels or networks.
Step #3: Each void object is extended with the gridpoints that are within 1.2 Å of the bounding surface.
For each void object, the volume and center of gravity is calculated (see Fig. 4). In addition a second
moment of the distribution of the gridpoints is calculated and analysed in terms of main axes andvariances. The latter gives some idea about the shape of the voids. In addition, the distance from thecenter of gravity to the nearest atoms is listed. This can be helpful in the interpretation of the type of voidat hand. I.e. a void with a volume of in the order of 40 Å3 with nearby acceptor atoms such as O or N canlikely host a water molecule.
The complete void map can be inspected in printed sections or graphically (either in mono or stereo). Fig.
5 gives an example in mono style.

4.

Applications

A major application of the algorithm as implemented in PLATON is its use as part of the SQUEEZE procedure. It is used as a mask on a difference Fourier map to extract relevant information on its contentssuch as the integrated number of electrons in the masked volume.
The example (Fig. 4) below concerns a void containing a THF molecule disordered over the two-fold axisin space group C2/c. The reported volume of 156 Å3 is typical for such small molecules. The number in []behind this value represents the type (II) volume.

Figure 4: Numerical display of the voids in the unitcell.

Page 8182

Figure 5: Graphical display (in mono style) of the of the voids in the unitcell.

The VOID algorithm in PLATON was also used for the description of pore types in framework structures
such as Zeolites [10].

5.

Alternative VOID Display

PLATON also implements an alternative way to visualize voids in a crystal structure. The version in
PLATON is inspired by a program by Mugnoli [6]. With this method spheres touching the van der Waals
surfaces are introduced and displayed.

Figure 6: Wireframe model of the ordered contents of the unitcell. The yellow spheres represent the voidsin the structure. The Povray input was generated with the PLUTON link in PLATON.

Page 82

83

Figure 7: Van der Waals radii presentation of the ordered part of the structure. The yellow spheres
represent the voids in the structure.

6.

Concluding Remarks

Voids containing disordered solvents are often located at special positions. The solvents that occupy thosesites generally have the volume needed to fill the space between the main molecules of interest but not the
pointgroup symmetry compatible with the site symmetry (e.g. a THF in a 3-bar site). ‘Popular’ disordersites are centres of inversion and 3, 4 and 6 fold axes.
Checking for solvent accessible voids is also done as part of the IUCr CHECKCIF structure validation
procedures [2]. In practice it is found that voids and their contents are not always clear and thus can be
missed. Density plateaus might evade peak search algorithms. The ultimate tool to inspect void regions is
the calculation of contoured difference maps, either in terms of 2D sections or rotate able 3D maps [11].
More details can be found at http://www.cryst.chem.uu.nl/platon/

7.

References[1] P. van der Sluis & A.L.Spek (1990). Acta Cryst. C46, 883-886.
[2] A.L. Spek (2003). J. Appl. Cryst. 36, 7-13.
[3] P. van der Sluis. & A.L. Spek (1990). Acta Cryst. A46, 194-201.
[4] F.M. Richards (1985). In Methods of Enzymology, 115, 440-464.
[5] C.M.W. Ho & G.R. Marshall (1990). J. of Computer-Aided Molecular Design 4, 337-354.
[6] A. Mugnoli (1992). ECM14, Abstract 530.
[7] D.J. Watkin (1972). Acta Cryst. A28, 33-35.
[8] E. Wigderson & A.Y. Meyer (1988). Comput. Chem. 12, 237-244.
[9] A.I. Kitajgorodskij. ‘Molecular Crystals and Molecules’. New York, Academic Press, 1973.
[10] H. Kuppers, F. Liebau & A.L.Spek (2006). J. Appl. Cryst. 39, 338-346.
[11] D.M. Tooke & A.L. Spek (2005) J. Appl. Cryst. 38, 572-573.

Page 83

84

The charge flipping algorithm: a powerful and universal tool for the apriori solution of crystal structures in any dimension
Gervais Chapuis and Lukas Palatinus
Laboratoire de cristallographie, Ecole Polytechnique Fédérale de Lausanne, Cubotron, 1015 Lausanne,
Switzerland, email: gervais.chapuis@epfl.ch and lukas.palatinus@epfl.ch WWW: http://lcr.epfl.ch/

Abstract
The charge flipping algorithm which was recently published appears to be a very powerful tool for thesolution of the phase problem in crystallography. The algorithm solves the phase problem iteratively froma full set of intensities by switching between direct and Fourier space. No a priori information is required
and only one free parameter has to be adjusted. This algorithm is remarkable owing to its universality. It
has been successfully applied to solve periodic and aperiodic structures including quasicrystals andincommensurate structures, from single crystal and powder diffraction and from X-ray and neutron
measurements.

Introduction
In 2004, Oszlányi and Sütő published a very interesting paper proposing a new algorithm to solve thephase problem in structural crystallography. The fact that the algorithm was very simple to describe andthat it did not require any a priori information other than a full set of intensities was very appealing.
Shortly afterwards, the same authors published an improved algorithm (2005) proposing a special
treatment for the weak intensities. The simplicity of the algorithm and the ease to program it was
immediately exploited and applied to aperiodic crystals (Palatinus, 2004). In this article, the author
successfully applied the charge flipping algorithm to solve a number of incommensurate structures fromexperimental data. Later the method was also shown to work well for decagonal and icosahedral
quasicrystals.
In the last decade, the search of new algorithms to solve quasi-crystalline structures has been particularly
active and has generated a bright spectrum of new methods. The method proposed by Elser (1999) islooking for the set of phases that maximizes the value of the global minimum in the density. Starting fromrandom phases, the method uses techniques of linear programming to reproduce the correct phases. The
method closest to charge flipping is the low density elimination (LDE) technique. This method has been
described in two successive papers by Shiono &Woolfson (1992) and Refaat & Woolfson (1993) and was
initially used for removing negative peaks and sharpening peaks in the E map. This is an iterative method
where positive densities are kept unchanged or slightly modified and negative densities are set to zero. In
earlier publications, the method was used for phase extension and refinement of macromolecules. The
method is effective when high-resolution data are available but slow in converging. Later, the method was
successfully extended (see for example Matsugaki and Shiono, 2001) for the ab initio solution of small
molecule and protein structures. Recently the method is successfully applied for the structure solution ofquasicrystals (Yamamoto & Takakura, 2006).
In the next chapters of this article, we shall first present the specificities of the charge flipping (CF)algorithm and illustrate the power of the algorithm with a few examples. This algorithm is unique anddistinguishes itself by its universality: it has been successful in solving any type of structures ranging
from periodic to aperiodic, from powders to single crystals and from X-ray to neutron data.

Page 84

85

The charge flipping algorithm
The charge flipping algorithm is an iterative process starting with a complete set of diffraction intensities
with atomic resolution. The algorithm does not require any a priori information on the symmetry of thestructure or on the chemical composition of the structure. These properties can be included in the model
after the application of charge flipping and can be even to a large extent, derived directly from the resultof charge flipping. The iterative process is illustrated in the following diagram:First, a set of random phases are assigned to all the structure factors, which can be deduced, up to a scale
factor, from the intensities. The inverse Fourier transform can be calculated yielding a density function.
Of course, this density function ρ(x) exhibits positive as well as negative extrema due to the inadequate
set of phases. The second step is to create a new density function g(x) which can be constructed from ρ(x)by inverting the sign of all densities falling below a certain positive threshold δ (charge flipping). The
new density g(x) can be Fourier-transformed to obtain the complex magnitudes G(H) with phases ϕ(H)and amplitudes |G(H)|. In the last step of the cycle, new structure factors F(H) are obtained with theexperimental magnitudes |F(H)| and phases ϕ(H). These structure factors are entered in the next iteration
cycle.
One may wonder when the iterative process can be considered as converged. In the CF process, we
distinguish in general four different phases, which are illustrated below. The first phase is shortly
followed by the second phase which can be interpreted as a search in phase space. It is followed by a third
phase with a sharp decrease of the residual R-value indicating that a solution of the structure has probably
been found. The last phase is essentially a stabilising process.
The whole algorithm has only one free parameter, namely the flipping threshold δ. In practice, thisthreshold can be easily determined. Many tests on various structures show, that the process is converging
rapidly within seconds or minutes on recent desktops.

Page 8586One should first remark that this algorithm is dimension independent. This means that periodic as well as
aperiodic structures can be solved by this process. The second remark is that the CF method is not an
optimisation process in the mathematical sense, i.e. the algorithm is not attempting to optimise afunctional of the density or phases. The third remark is that no rigorous mathematical theory is currently
known that could explain the surprising efficiency of the CF algorithm.
The last remark has however not refrained the interested users to apply the CF algorithm. Within a shortperiod of time, the method has already been applied very successfully to solve a number of structuresfrom many different fields. In the next chapter, we shall illustrate only a few examples owing to space
limitation.

Examples of solutions
i. Quininium (R) mandelate (QRM)
QRM is an organic incommensurate structure, with 35 non-H atoms per formula units. The representation
below is a commensurate approximant with 3x6 cells. The solution of the structure (Schönleber &Chapuis, 2001) either as an approximant or in the superspace approach from single crystal diffraction data
was a real challenge with the standard structure-solution methods. The displacive modulation affects
essentially the quinoline moiety (two cyclohexan rings sharing a common bond) and the phenyl ring. Theinterested reader can observe the modulation by carefully observing the 18 QRM molecules.
The CF method could solve the structure in (3+1)d superspace practically in automatic mode.

ii. Decagonal-Quasicrystal (d-QC)
The structure of the decagonal phase Al70 Ni15 Co15 which has been published earlier (Steurer et al. 1993).
The structure was solved with the software Superflip (Palatinus & Chapuis 2006) in five-dimensional
space from the X-ray dataset kindly provided to us by the authors. The illustration given below represents
a portion of the structure of 22.7 x 22.7 Å2 which can be directly compared with fig. 7a of the originalarticle of the authors. The x1 -x2 plane is perpendicular to the tenfold screw axis. The similarity between
the two figures is striking and it is difficult to find any meaningful differences. Even the pairs of split
atoms which are marked in the original publication can be found in the density map resulting from thecharge flipping algorithm. The transition metals can be clearly distinguished from the aluminium atoms.
With current desktop computers, solution convergence is reached within minutes.

Page 86

87

The charge flipping algorithm was also successful in solving a new and unknown decagonal QC phase in
the system Al-Ir-Os (Katrych et al. 2006). All the 6782 unique reflections measured experimentally wereused to solve the structure on a 5- dimensional grid of 24 x 24 x 24 x 24 x 64 points. The charge flipping
calculation converged after less than 100 cycles. This procedure yields clearly the heavy atoms but inorder to improve the resolution of the light atoms by suppressing the noise and amplify the weak
structural features, the procedure consisting of summing up many individual maps was used in the final
stages of the analysis.
iii. Icosahedral-QC
Following the above examples, it is thus clear that the charge flipping algorithm is a powerful method tosolve aperiodic structures based on experimental X-ray diffraction data. What about solving any structure
including aperiodic structures from neutron diffraction data? With neutron diffraction, we are facing the
problem of negative scattering lengths of some atom types (H, Mn, etc.) and one may wonder if thisproperty is compatible with the charge inversion, which is introduced during each cycle. Surprisingly, it
appears that a simple modification suffices to generalize the charge flipping algorithm also for densities
with negative regions. It is sufficient to modify the flipping step from flipping all density below δ toflipping the density only in the interval between -δ and +δ (Oszlányi & Sütő 2006). This is illustrated
with the example of the i-Al68Pd23Mn9 structure based on single crystal neutron diffraction data
(unpublished data kindly provided by Marc de Boisieu).

Page 87

88

The figure above represents the electron density of a portion of the structure, more specifically a slab of
2.15 Å thickness perpendicular to a five fold axis. Three types of atoms can be clearly identified. The Mn
atoms exhibit a negative density whereas the Pd and Al atoms exhibit a positive density, which is
proportional to their scattering lengths.

iv. Layered silicate from powder diffraction data
The structure solution from powder diffraction data faces, in addition to all problems common with thesingle-crystal data, the intrinsic problem of reflection overlap. As a result, not all reflection intensities areindividually known and the structure solution is more complicated. Charge flipping is relatively robust to
random errors in the data and thus can solve simple structures from powder diffraction data directly.
However, for more complex structures an improved method is needed that would allow for repartitioningof the intensities of overlapping reflections. A method that proved particularly useful was a combinationof charge flipping with histogram matching (Baerlocher et al. 2006). During the CF iteration the density
is modified so that it matches an expected density histogram. This modified density is then used torepartition the intensities of overlapping reflections. Using this method, several complex crystal structures
were solved form powder diffraction data. As an example, the figure below shows the solution of astructure of a layered silicate E-401 with 23 non-hydrogen atoms in the asymmetric unit (140 in the unitcell) with symmetry I2mb. The structure is superimposed as a stick model on the isosurface
representation of the electron density. The difficulties in determining the correct symmetry hindered thesolution of this structure by direct methods. Charge flipping does not need any information about thesymmetry and thus the structure could be immediately solved and the correct symmetry inferred from theresult.

Page 8889

Superflip
In order to provide a general tool for application of charge flipping algorithm for crystal-structure
solution, a program named Superflip (Palatinus & Chapuis, 2006) has been developed. This program canreconstruct scattering densities from diffraction data at arbitrary dimensions, including, but not limited to,three for the standard structures, four to six for modulated structures and quasicrystals, and two, forexample for the purposes of surface scattering experiments. The program allows for structure solution
with x-ray and neutron scattering data both from single crystal and powder. It determines automaticallythe optimal value of the threshold δ, so that the user does not need to intervene and the structure solution
proceeds completely automatically. After the charge flipping iteration the program can search for the
position of the symmetry operations in the resulting density and average the density so that it corresponds
to the symmetry expected by the user. Subsequently the resulting electron density can be analysed by the
program EDMA (Smaalen et al. 2003) that can extract the position of the atoms from the reconstructed
density and export it to the formats of Jana2000, SHELX, or to CIF. Both Superflip and EDMA can be
downloaded free of charge at http:/superspace.epfl.ch/superflip/.
Thanks to the simplicity and usefulness of the algorithm several other implementations have been created.
The most notable one is probably the "Flipper" option in the Platon package, but many other programs
that are used mainly by their authors only have been written, too. We have not extensively tested any ofthese programs and thus we do not feel competent to comment on them.

Conclusion
Since the discovery of X-ray diffraction, the solution of the phase problem has forced generations ofspecialists to develop new methods to circumvent the shortcomings of diffraction, i.e. the loss of thephases of the structure factors in diffraction experiments. The Patterson method followed by direct
methods and all its variants both contributed to sudden increases in determining new structures. We hopethat the charge flipping method and its improved variants will also contribute to the next impulse in thisfield. The important point here is that contrary to previous methods, the CF method and the related
Page 8990

density-modification methods are a priori methods which do not require any assumptions on theatomicity of the structure or the knowledge of its symmetry and chemical composition. The uniqueproperty of the CF algorithm is its ability to solve within the same formalism not only periodic but also
aperiodic structures. Although our experience is still limited, all the attempts to solve incommensurate
structures, dodecahedral or icosahedral quasicrystals with experimental data were successful. Neutron
diffraction data with negatively scattering elements is not a limitation either. We have also seen somesuccessful examples of CF solutions from powder diffraction experiments. The next challenge of themethod will then be the solution of the diffraction from single objects.

References
Baerlocher Ch., McCusker, L. B. and Palatinus, L. "Charge flipping combined with histogram matching to solve complex
crystal structures from powder diffraction data", Zeitschrift für Kristallographie, in press (2006)
Elser, V. "X-ray phase determination by the principle of minimum charge." Acta Crystallographica Section A 55: pp. 489-499(1999).
Katrych, S., Weber, T., Kobas, M., Massüger, L., Palatinus, L., Chapuis, G. and Steurer, W. "New stable decagonalquaiscrystal in the system Al-Ir-Os. To be published in "Journal of Alloys and Compounds” (2006).
Matsugaki, N. and Shiono, M. "Ab initio structure determinations by direct-space methods: tests of low-density elimination."
Acta Crystallographica Section D 57: pp. 95-100 (2001).
Oszlányi, G. and Sütő, A. "Ab initio structure solution by charge flipping." Acta Crystallographica Section A 60: pp. 134-141(2004).
Oszlányi, G. and Sütő, A. "Ab initio structure solution by charge flipping. II. Use of weak reflections." Acta Crystallographica
Section A 61: pp. 147-152 (2005).
Oszlányi, G. and Sütő, A. "How can we cope with negative scattering density?" ECM23 Leuven, Book of Abstracts (2006).
Palatinus, L. "Ab initio determination of incommensurately modulated structures by charge flipping in superspace." Acta
Crystallographica Section A 60: pp. 604-610 (2004).
Palatinus, L. and Chapuis, G. "Superflip - a computer program for solution of crystal structures by charge flipping in arbitrary
dimensions", http:/superspace.epfl.ch/superflip (2006)
Refaat, L. S. and Woolfson, M. M. "Direct-space methods in phase extension and phase determination. II. Developments of
low-density elimination." Acta Crystallographica Section D 49: pp. 367-371 (1993).
Schönleber, A. and Chapuis, G.. "Quininium (R)-mandelate, a structure with large Z' described as an incommensurately
modulated structure in (3+1)-dimensional superspace." Acta Crystallographica Section B 60(1): pp. (2004).
Shiono, M. and Woolfson, M. M. "Direct-space methods in phase extension and phase determination. I. Low-density
elimination." Acta Crystallographica Section A 48: pp. 451-456 (1992).
Steurer, W., Haibach, T., Zhang, B., Kek, S. and Luck, R. "The structure of decagonal Al70Ni15Co15." Acta Crystallographica
Section B 49: pp. 661-675 (1993).
van Smaalen, S., Palatinus, L., and Schneider, M. "The Maximum Entropy Method in superspace", Acta Crystallographica
Section A 59: pp. 459-469 (2003)
Yamamoto, A. and Takakura, H. "Recent development in structure determinations for quasicrystals." Philosophical Magazine86(3-5): pp. 405-411 (2006).

Page 9091

cctbx news
Ralf W. Grosse-Kunstlevea, Peter H. Zwarta, Pavel V. Afoninea, Thomas R. Ioergerb,
Paul D. AdamsaaLawrence Berkeley National Laboratory, Berkeley, CA 94720, USA and bTexas A&M University,
College Station, TX 77843, USA. E-mail: rwgk@cci.lbl.gov ; WWW: http://cci.lbl.gov/

Abstract
We describe recent developments of the Computational Crystallography Toolbox.

Preamble
In order to interactively run the examples scripts shown below, the reader is highly encouraged to visit
http://cci.lbl.gov/cctbx_build/ and to download one of the completely self-contained, self-extracting
binary cctbx distributions (supported platforms include Linux, Mac OS X, Windows, IRIX, and Tru64
Unix). All example scripts shown below were tested with cctbx build 2006_11_22_0037.
In the following we refer to our articles in the previous editions of this newsletter as "Newsletter No. 1","Newsletter No. 2", etc. to improve readability. The full citations are included in the reference section.

1 Introduction
The Computational Crystallography Toolbox (cctbx, http://cctbx.sourceforge.net/) is the open-sourcecomponent of the Phenix project (http://www.phenix-online.org/). Most recent cctbx developments are
geared towards supporting new features of the phenix.refine application. Thus, the open-source mmtbx(macromolecular toolbox) module is currently being most rapidly developed. In this article we give an
overview of some of the recent developments. However, the main theme of this article is the presentationof a light-weight example command-line application that was specifically developed for this newsletter:
sequence alignment and superposition of two molecules read from files in PDB format. This involves
parameter input based on the Phil module presented in Newsletter No. 5, fast reading of the PDB files
with the new iotbx.pdb.input class, simple sequence alignment using the new mmtbx.alignment
module, and use of the Kearsley (1989) superposition algorithm to find the least-squares solution forsuperposing C-alpha positions. The major steps are introduced individually, followed by a presentation of
the complete application.
The example application is deliberately limited in functionality to make it concise enough for this article.
The main goal is to show how the open-source components are typically combined into an application.
Even though the example is quite specific to macromolecular crystallography, we believe it will also be
useful for a small-molecule audience interested in utilizing the large open-source library of generalcrystallographic algorithms (see our previous articles in this newsletter series) to build an application.

2 iotbx.pdb
The PDB format is the predominant working format for atomic parameters (coordinates, occupancies,
displacement parameters, etc.) in macromolecular crystallography, but many small-molecule programs
also support this format. phenix.refine also utilized the PDB format, mainly to facilitate easy
communication with other programs, most notably graphics programs for visualization.

Page 9192

2.1 iotbx.pdb.input
The PDB format specifications are available at http://www.pdb.org/ . Technically, the format is very
simple, therefore a vast number of parsers exist in scientific packages. The cctbx is no exception. A parser
implemented in Python has been available for several years. In many cases Python's runtime performanceis sufficient for interactive processing of PDB files, but can be limiting for large files, or for traversing theentire PDB database (currently 40731 files, about 25 GB total). This has prompted us to implement a fastparser in C++, complete with Python bindings in the same style as all other cctbx C++ classes,
comprehensive error reporting, and fully automatic memory life-time management (no manual new/delete
or malloc/free). Reading a PDB file from Python is simple:
import iotbx.pdb
pdb_inp = iotbx.pdb.input(file_name="pdb1htq.ent")

With a size of 76 MB this is the largest file in the PDB, but full processing takes only 3.8 s on a 2.6 GHz
Opteron, of which about 0.5 s are for simply transferring the data from disk into memory. In contrast, theolder Python implementation needs 89 s for processing the file into data structures of similar complexity.
In the future all our cctbx-based applications will make use of the new, faster parser. Interestingly, whenprocessing the PDB database with iotbx.pdb.input using multiple CPUs, disk-I/O is the rate limiting
step. Using 8 CPUs, we can process all 25 GB in less than five minutes. Using more CPUs does not
reduce this time.
The pdb_inp object holds the information from the PDB file in a structured way. The "sections" of thefile according to the PDB format specifications at http://www.pdb.org/ are available as, e.g.:
pdb_inp.title_section()
pdb_inp.remark_section()
pdb_inp.crystallographic_section()...

In Python these sections appear as simple lists of strings. The full power of Python and the cctbx libraries
is available for post-processing this information. Since most sections are never very large, there is no
point in writing specialized C++ processing code, which is typically significantly more labor intensive
compared to writing equivalent Python code, and much more difficult to adjust for new developments.
The only section of PDB files that is sometimes found to be very large is the "coordinate section" with the
ATOM and HETATM records. This section is fully processed in the iotbx.pdb.input constructor
shown above. The corresponding information is available via the methods:
labels_list = pdb_inp.input_atom_labels_list()
atoms = pdb_inp.atoms()

which return arrays of the same length, each with one data object per atom. The information for one atom
is again accessible from Python, e.g.:
for labels,atom in zip(labels_list, atoms):
print labels.chain(), labels.resname(), labels.name(), atom.xyz, atom.b

2.2 iotbx.pdb.hierarchy
The input_atom_labels objects in the pdb_inp.input_atom_labels_list() above store the name,resname, chain, icode (insertion code), segid (segment identifier), and altloc (alternate location
indicator) for each atom. This information defines a hierarchical organization of the macromolecules, but
in a highly redundant way which complicates further processing steps, such as the assignment ofgeometry restraints (see Newsletter No. 4). iotbx.pdb.input supports building an
iotbx.pdb.hierarchy object. The redundant atom labels are analyzed to build a non-redundant six-deephierarchy object, e.g.:

Page 9293

hierarchy = pdb_inp.construct_hierarchy()

The six-deep data structure consists of:hierarchy
model
chain
conformer
residueatomwhich can be concisely traversed from Python:for model in hierarchy.models():
for chain in model.chains():
for conformer in chain.conformers():
for residue in conformer.residues():
for atom in residue.atoms():# ...

The time for building the hierarchy object given pdb1htq.ent is about 0.7 s. Traversing the hierarchy
with the five-deep loop above takes only about 0.6 s, i.e. is unlikely to be a rate-limiting step even forvery large structures. Therefore the few lines of example code given in this section are probably one of
the most convenient and efficent ways of quickly processing a PDB file from a scripting language.
For general information on how to learn more about Python objects, look under the "Tutorials Siena2005" link at cctbx.sf.net. For example, the command:
libtbx.help iotbx.pdb.residue

will show the complete interface of the residue object.
hierarchy objects can be manipulated or constructed from scratch from both Python and C++. However,high-level functionality like inserting or deleting residues or chains, or formatting output is currently notavailable. We will add such high-level manipulations as the need arises. The typical development process
is to implement a required high-level operation given the currently available interfaces, then add it as a
new method to the most suitable existing class to make it easily accessible for other purposes. We expect
the hierarchy objects to continuously grow in this way for some time to come.

2.3 pdb_inp.xray_structure_simple
The xray_structure_simple simple method of iotbx.pdb.input is an efficient implementation
converting the information stored in the pdb_inp object above to a list of cctbx.xray.scatterer
objects, managed by the cctbx.xray.structure class. See our previous newsletter articles and the Siena
2005 tutorials for various examples on how to work with these objects.
Fundamentally, the conversion is trivial. Each input atom is converted to exactly one xray.scatterer.
However, as always, the devil is in the details. The PDB CRYST1 and SCALE cards have to be evaluated toobtain the correct fractionalization matrix (PDB coordinates are with respect to a Cartesian basis). The
trickest problem is the determination of the scattering type for each atom, for which three PDB columns
have to be considered (atom name, element symbol, charge). Following the PDB format specifications
strictly, the scattering type is clearly defined, but unfortunately deviations from the strict specifications
are quite common. For example, the element symbol may be missing or mis-aligned, or the charge
symbol is sometimes found to be given as "+2" instead of "2+". The xray_structure_simple method
allows for some deviations from the strict PDB specifications as long as the error is highly obvious. Moreserious errors are communicated via exceptions with carefully formatted, informative error messages.

Page 93

94

The xray_structure_simple method is relatively expensive in terms of runtime, partially because thesite symmetry is determined for each atom, which involves looping over the symmetry elements anddistance calculations. The runtime for the pdb1htq.ent structure (978720 atoms) is about 9.9 s.
However, this step is typically performed only once at the start of a program. To put this further into
context, a structure factor calculation up to a resolution of 3 A, using the FFT method, takes about 26 s.
This underlines that the time for I/O using the new pdb.input class is generally neglible in the context of
a whole application.
For completeness, the code for building the xray.structure and computing the structure factors is:
xray_structure = pdb_inp.xray_structure_simple()xray_structure.structure_factors(d_min=3, algorithm="fft")

3 mmtbx.alignment
mmtbx.alignment provides algorithms for aligning two protein sequences, where each sequence isrepresented as a string of one-letter amino-acid codes. The implementation is based on the ideas of Gotoh(1982) and runs in quadratic time O(M*N), where M and N are the sequence lengths. It does both global(Needleman & Wunsch, 1970) and local (Smith & Waterman, 1981) alignments, assuming affine (linear)
gap penalties (for which default gap-cost parameters may be changed by the user). Alignments are basedon maximizing similarity. Similarity scores between amino acids are specified via symmetric matrices.
Similarity matrices of Dayhoff (1978) and BLOSUM50 (Henikoff & Henikoff (1992),
http://en.wikipedia.org/wiki/BLOSUM) are provided. User-supplied matrices are also supported (thisfeature also enables alignment of non-amino-acid sequences).
To show a short example of aligning two sequences:from mmtbx.alignment import alignalign_obj = align(
seq_a="AESSADKFKRQHMDTEGPSKSSPTYCNQMM",
seq_b="DNSRYTHFLTQHYDAKPQGRDDRYCESIMR")

The align_obj holds matrices used in the dynamic-programming(http://en.wikipedia.org/wiki/Dynamic_programming) alignment algorithm. Methods are available to get
the alignment score and to extract the actual sequence alignment:
print "score: %.1f" % align_obj.score()alignment = align_obj.extract_alignment()
print alignment.match_codes
print alignment.a
print alignment.matches(is_similar_threshold=0)
print alignment.b

The output is:score: 6.0
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmm
AESSADKFKRQHMDTEGPSKSSPTYCNQMM|| || ||DNSRYTHFLTQHYDAKPQGRDDRYCESIMR
match_codes is a string of the characters m, i, and d, for match, insertion, and deletion, respectively. The
alignment above is based on identity matches only. Alternatively, the similarity matrices of "dayhoff" or"blosum50" can be used, e.g.:align_obj = align(
seq_a="AESSADKFKRQHMDTEGPSKSSPTYCNQMM",
seq_b="DNSRYTHFLTQHYDAKPQGRDDRYCESIMR",
Page 9495style="global",
gap_opening_penalty=10,
gap_extension_penalty=2,
similarity_function="blosum50")

The output of the same print statements as above is in this case:
mmmmmmmmmmmmmmmmdmmmmmmmmmmmmmi
AESSADKFKRQHMDTEGPSKSSPTYCNQMM|| || | * ||| *|DNSRYTHFLTQHYDAK-PQGRDDRYCESIMR

Here the * indicate residues that are similar above the is_similar_threshold, using the blosum50
similarity matrix.
Alignment of sequences of typical lengths is fast enough for interactive work (300 residues: about 1 s),
but can take minutes given thousands of residues (2200 residues: about 40 s). Also, for very longsequences the memory consumption can be significant since four M*N alignment matrices are stored as
pure Python objects. In the future we may reimplement the core of the alignment algorithm in C++ toincrease runtime performance (by a factor 30-50) and to significantly reduce memory consumption.
However, the Python interface presented here is expected to stay the same.

4 scitbx.math.superpose
The scitbx.math.superpose module implements the quaternion method of Kearsley (1989) for
superpositioning two related vector sets. In comparison to the related method of Kabsch (1976), thismethod has the advantage of gracefully handling degenerate situations (e.g. if all atoms are on a straightline) without the need for handling special cases (Kabsch, 1978). For all non-degenerate situations, theresults of the Kabsch and Kearsley methods are identical within floating point precision.
We will give a self-contained example, using the iotbx.pdb.input class discussed above. First, we
define a few atoms to be aligned:# residues in PDB entry 1AON
gly1 = """\
ATOM
55 N
GLY A
9
ATOM
56 CA GLY A
9
ATOM
57 C
GLY A
9
ATOM
58 O
GLY A
9
""".splitlines()
gly2 = """\
ATOM
134 N
GLY A 19ATOM
135 CA GLY A 19
ATOM
136 C
GLY A 19ATOM
137 O
GLY A 19""".splitlines()

47.072 -70.250
45.971 -69.823
45.946 -68.397
46.350 -67.467-4.389-3.545-3.056-3.7641.00 27.28
1.00 22.53
1.00 25.45
1.00 28.17

46.795 -55.602
47.081 -55.164
45.844 -54.551
45.851 -53.398-6.961-8.320-8.936-9.3841.00 15.66
1.00 11.86
1.00 7.75
1.00 10.45

This code produces two Python lists of Python strings. To be compatible with the iotbx.pdb.input
constructor, these have to be converted to C++ arrays ("flex arrays", see Newsletter No. 1):
from cctbx.array_family import flex
gly1 = flex.std_string(gly1)
gly2 = flex.std_string(gly2)

Now we are ready to instantiate two iotbx.pdb.input objects. Instead of reading directly from a file asshown before, we read the PDB lines from the C++ array of strings:
import iotbx.pdb
pdb1 = iotbx.pdb.input(source_info=None, lines=gly1)
pdb2 = iotbx.pdb.input(source_info=None, lines=gly2)
Page 95

96

Next, we extract two C++ flex arrays with the coordinates:sites1 = pdb1.extract_atom_xyz()
sites2 = pdb2.extract_atom_xyz()

These arrays can be used directly to instantiate the least_squares_fit class which computes therotation and translation for the best fit using the algorithm of Kearsley (1989) (which is the default):
from scitbx.math import superpose
superposition = superpose.least_squares_fit(
reference_sites=sites1,
other_sites=sites2)

The r and t attributes are scitbx.matrix instances which provide mathematica_form() methods which
we use here for pretty-printing:print superposition.r.mathematica_form(
label="r", one_row_per_line=True, format="%8.5f")
print superposition.t.mathematica_form(
label="t", format="%8.5f")

The output is:
r={{-0.72436, -0.03369, 0.68860},{-0.43741, 0.79448, -0.42127},{-0.53289, -0.60635, -0.59023}}
t={{83.88229}, {-8.78874}, {-17.07881}}

To compute the RMS difference of the superposed sites:
sites2_fit = superposition.other_sites_best_fit()print "rms difference: %.4f" % sites1.rms_difference(sites2_fit)

Output:rms difference: 0.3671

The following code produces a listing of distances for each atom:from scitbx import matrix
lbls1 = pdb1.input_atom_labels_list()
lbls2 = pdb2.input_atom_labels_list()
for l1,s1,l2,s2f,d in zip(lbls1, sites1,
lbls2, sites2_fit,
sites2_fit-sites1):
print l1.pdb_format(), "%8.4f, %8.4f, %8.4f" % s1
print l2.pdb_format(), "%8.4f, %8.4f, %8.4f" % s2f
print "
difference: %8.4f, %8.4f, %8.4f" % d, \"|d| = %6.4f" % abs(matrix.col(d))
print

The input atom labels are obtained from the iotbx.pdb.input objects using the pdb_format() method
which returns the atom labels in the same arrangement as found in the PDB file; this output is useful for
locating an atom in the original file. sites2_fit-sites1 uses flex array algebra to compute thedifference vectors, and the scitbx.matrix class is used to compute the length of the vector. The output
starts with:
" N
" N
...

GLY A
9 "
GLY A 19 "difference:

47.0720, -70.2500,
47.0655, -70.5000,-0.0065, -0.2500,-4.3890-4.1925
0.1965 |d| = 0.3180

Page 9697

It is easy to verify that the Kabsch method gives identical results for this non-degenerate configuration of
atoms:
superposition_kabsch = superpose.least_squares_fit(
reference_sites=sites1,
other_sites=sites2,
method="kabsch")

In this case the rotation matrix and the translation vector are exactly identical to the Kearsley results
shown above. However, method="kabsch" should not be used in applications since we didn't spent theeffort of writing code for special cases. Therefore the Kearsly method is the default.

5 Putting the pieces together: mmtbx.super
The large variety of tools in the cctbx enables quick develop of small scripts (a.k.a. jiffies) that perform
non-trivial tasks with relative ease.
In a typical jiffy, most work goes into building a user interface that facilitates the communication between
program and user. The actual computational work that needs to be done is often not very laborious, andcan be as trivial as a simple call of a library function.
The following paragraphs will illustrate the rapid development of a lightweight structure superpositioncommand line tool using a variety of recent additions to the cctbx. The full code can be found in
cctbx_sources/mmtbx/mmtbx/command_line/super.py. This script is also available from thecommand line under the name mmtbx.super.

5.1 Design
The goal is to develop a simple tool that carries out the following tasks:
1. Determine input file names and alignment parameters (user interface).
2. Read in two related PDB files.
3. Determine corresponding residues between the two PDB files.
4. Compute a least-squares superposition of C-alpha atoms.
5. Write out the superposed coordinates to a new PDB file.

5.2 User interface
A basic, yet versatile, user interface can be implemented in a very straightforward manner using Phil.
Since Phil has been discussed at length in Newsletter No. 5, we limit ourselves to a brief overview of theimplementation.
The Phil "master parameters" definition embedded in super.py is:import libtbx.philmaster_params = libtbx.phil.parse("""\
super {
fixed = None.type = strmoving = None.type = str
moved = "moved.pdb".type = stralignment_style = *local global.type = choice
Page 9798

gap_opening_penalty = 20
.type = float
gap_extension_penalty = 2.type = float
similarity_matrix = *blosum50 dayhoff.type = choice}""")master_params is a Phil scope instance with a super sub-scope (for clarity) that defines the parameters
we need. fixed and moving are input files names, moved is an output file name. The other parameters arefor mmtbx.alignment.align.

All parameters can be modified from the command line, e.g.:
mmtbx.super fixed=first.pdb moving=second.pdb similarity_matrix=dayhoff

This is enabled with the following code fragments in super.py:
import libtbx.phil.command_line
phil_objects = []argument_interpreter = libtbx.phil.command_line.argument_interpreter(
master_params=master_params, home_scope="super")...
try: command_line_params = argument_interpreter.process(arg=arg)
except: raise Sorry("Unknown file or keyword: %s" % arg)
else: phil_objects.append(command_line_params)

As an added convenience, bare file names are also recognized, e.g. this is an alternative to the command
above:
mmtbx.super first.pdb second.pdb similarity_matrix=dayhoff

The complete code (including the fragments above) for supporting this generality is:
def run(args):
phil_objects = []argument_interpreter = libtbx.phil.command_line.argument_interpreter(
master_params=master_params, home_scope="super")fixed_pdb_file_name = None
moving_pdb_file_name = None
for arg in args:
if (os.path.isfile(arg)):
if (fixed_pdb_file_name is None): fixed_pdb_file_name = arg
elif (moving_pdb_file_name is None): moving_pdb_file_name = arg
else: raise Sorry("Too many file names.")else:
try: command_line_params = argument_interpreter.process(arg=arg)
except: raise Sorry("Unknown file or keyword: %s" % arg)
else: phil_objects.append(command_line_params)

At this point we have to consolidate the two possible sources of information: bare file names (stored
under fixed_pdb_file_name and moving_pdb_file_name) and assignments via fixed=... ormoving=.... First, we combine all the Phil assignments (stored under phil_objects) into one
working_params object and use the extract() method to get easy access to the definitions (seeNewsletter No. 5):
working_params = master_params.fetch(sources=phil_objects)
params = working_params.extract()

Now we override the Phil assignments with the bare file names if available, or generate an error message
if a file name is missing:Page 9899

if (fixed_pdb_file_name is None):if (params.super.fixed is None): raise_missing("fixed")
else:params.super.fixed = fixed_pdb_file_nameif (moving_pdb_file_name is None):if (params.super.moving is None): raise_missing("moving")
else:
params.super.moving = moving_pdb_file_nameraise_missing() is a simple function raising an informative exception (see super.py), e.g.:
Sorry: Missing file name for moving structure:
Please add
moving=file_nameto the command line to specify the moving structure.

5.3 Processing of PDB input files
With all the input parameters consolidated in the params object above, reading in the PDB files is simple:
fixed_pdb = iotbx.pdb.input(file_name=params.super.fixed)
moving_pdb = iotbx.pdb.input(file_name=params.super.moving)For both files we have to extract the sequence of residue names and corresponding C-alpha coordinates.
This is implemented as a function that we call twice:fixed_seq, fixed_sites, fixed_site_flags = extract_sequence_and_sites(
pdb_input=fixed_pdb)
moving_seq, moving_sites, moving_site_flags = extract_sequence_and_sites(
pdb_input=moving_pdb)

For the complete implementation of extract_sequence_and_sites() please refer to super.py. For
simplicity, the function only considers the first MODEL in the pdb file, and for each chain only the first
conformer (as derived from the altloc symbols):
model = pdb_input.construct_hierarchy().models()[0]for chain in model.chains():
selected_residues = chain.conformers()[0].residue_class_selection(
class_name="common_amino_acid")
residues = chain.conformers()[0].residues()
for ires in selected_residues:...

Another simplification is the selection of "common_amino_acid" residues only. For these, the residue
names are translated to one-letter codes which are collected in a seq list:
import mmtbx.amino_acid_codes...
seq = []...
resi = residues[ires]
resn = resi.name[0:3]single = mmtbx.amino_acid_codes.one_letter_given_three_letter[resn]
seq.append(single)

Page 99

100

The rest of the body of the loop over the selected residues extracts the C-alpha coordinates if available:from cctbx.array_family import flex...
sites = flex.vec3_double()use_sites = flex.bool()...
use = False
xyz = (0,0,0)
for atom in resi.atoms():if (atom.name == " CA "):xyz = atom.xyz
use = True
breaksites.append(xyz)
use_sites.append(use)The coordinates are stored under sites. A corresponding use_sites array of bools (False or True) stores
if a C-alpha atom was found or not. Finally the collected sequence, coordinates and use flags are returned
with:return "".join(seq), sites, use_sites

The list of one-letter codes is converted to a plain string on the fly. The plain string is more convenient towork with in the following steps.

5.4 Sequence alignment
Sequence alignment is now a simple call of mmtbx.alignment.align as discussed before. The function
call parameters are taken directly from the Phil params object:align_obj = mmtbx.alignment.align(
seq_a=fixed_seq,
seq_b=moving_seq,
gap_opening_penalty=params.super.gap_opening_penalty,
gap_extension_penalty=params.super.gap_extension_penalty,
similarity_function=params.super.similarity_matrix,
style=params.super.alignment_style)

From the align_obj we extract the alignment as shown before, but we spend a little more effort toproduce nice output:alignment = align_obj.extract_alignment()
matches = alignment.matches()equal = matches.count("|")
similar = matches.count("*")
total = len(alignment.a) - alignment.a.count("-")
alignment.pretty_print(
matches=matches,block_size=50,
n_block=1,
top_name="fixed",bottom_name="moving",
comment="""... see super.py ... """)

This code produces, e.g.:
The alignment used in the superposition is shown below.
The sequence identity (fraction of | symbols) is 55.1%of the aligned length of the fixed molecule sequence.
Page 100

101

The sequence similarity (fraction of | and * symbols) is 75.5%of the aligned length of the fixed molecule sequence.
12345678901234567890123456789012345678901234567890
fixed
movingVTDNIMKHSKNPIIIVVSNPLDIMTHVAWVRSGLPKERVIGMAGVLDAA* ||*||| * ||*|||||*|**|*||| |||| |*||||*|IIPNIVKHSPDCIILVVSNPVDVLTYVAWKLSGLPMHRIIGSGCNLDSA

5.5 Least-squares superposition
To keep this example simple, in the least-squares superposition we want to use only the C-alphacoordinates of matching residues, i.e. residues with a | or * symbol in the output above. This informationis stored under matches as obtained above. We also have to check if the C-alpha coordinates are available
for both of the matching residues. This information is stored under fixed_site_flags andmoving_site_flags. The matching + available C-alpha coordinates are obtained with this code:
fixed_sites_sel = flex.vec3_double()moving_sites_sel = flex.vec3_double()for ia,ib,m in zip(alignment.i_seqs_a, alignment.i_seqs_b, matches):
if (m not in ["|", "*"]): continue
if (fixed_site_flags[ia] and moving_site_flags[ib]):
fixed_sites_sel.append(fixed_sites[ia])moving_sites_sel.append(moving_sites[ib])Computing the superposition and printing out the RMSD between the aligned, superposed C-alpha atoms
is now very simple:
lsq_fit = superpose.least_squares_fit(
reference_sites=fixed_sites_sel,other_sites=moving_sites_sel)
rmsd = fixed_sites_sel.rms_difference(lsq_fit.other_sites_best_fit())
print " RSMD between the aligned C-alpha atoms: %.3f" % rmsd

5.6 Export of moved coordinates
As the final step, mmtbx.super applies the rotation and translation obtained in the least squares fit to all
original coordinates in moving_pdb and writes out the modified atom records:
print "Writing moved pdb to file: %s" % params.super.moved
out = open(params.super.moved, "w")for serial, label, atom in zip(moving_pdb.atom_serial_number_strings(),
moving_pdb.input_atom_labels_list(),moving_pdb.atoms()):
print >> out, iotbx.pdb.format_atom_record(
record_name={False: "ATOM", True: "HETATM"}[atom.hetero],
serial=int(serial),
name=label.name(),altLoc=label.altloc(),
resName=label.resname(),
resSeq=label.resseq,
chainID=label.chain(),
iCode=label.icode(),site=lsq_fit.r * matrix.col(atom.xyz) + lsq_fit.t,
occupancy=atom.occ,
tempFactor=atom.b,
segID=atom.segid,
element=atom.element,
charge=atom.charge)

All of the information on the input ATOM or HETATM records is passed through as-is, except for thecoordinates. We make use of the scitbx.matrix facilities again to apply lsq_fit.r and lsq_fit.t toPage 101

102

atom.xyz. format_atom_record() is a very simple function, essentially just a Python string formatting

statement which could also be spelled out inline. However, the assignment of the data items to function
parameters is easier to read and understand than the raw formatting statement, and the function handles
some subtleties (e.g. overflowing serial and resSeq) that are easily overlooked. Using a central function
ensures that subtle and rare problems like this are fixed everywhere once they are discovered.

6 Overview of refinement development
In the crystallographic context structure refinement means optimization of certain target functions bymodifying various model parameters. Depending on several factors (e.g. available data, model quality andsize) the model can be parameterized in different ways, as grouped or individual atomic parameters.
Individual atomic parameters are coordinates, isotropic or anisotropic ADPs (atomic displacement
parameters), and occupancy factors. Grouped parameterizations are rigid body, group ADP, TLS, groupoccupancy, and overall anisotropic scale factor. All of these except group occupancy refinement are
currently implemented in phenix.refine.
The most recent version of phenix.refine allows automatic refinement of any combination ofparameters for any part or combination of parts of the model. To the best of our knowledge this is aunique feature among existing crystallographic software.
To give an example, for a molecule with three chains A, B, and C, the command:
phenix.refine model.pdb data.mtz \strategy=rigid_body+individual_sites+individual_adp+tls \sites.rigid_body="chain A" \sites.individual="chain B" \adp.tls="chain A" \adp.tls="chain C"

will perform refinement of:•chain A as a rigid body•individual isotropic ADPs for the whole molecule•

individual coordinates for chain B•

TLS parameters for chain A and chain C

More information about phenix.refine is available at http://phenix-online.org/download/cci_apps/ .
In the following we will highlight a few selected open-source modules supporting phenix.refine.

6.1 Rigid body refinement
The core machinery for rigid body refinement is located in
cctbx_sources/mmtbx/mmtbx/refinement/rigid_body.py. A typical call is:
rigid_body_manager = mmtbx.refinement.rigid_body.manager(
fmodel= fmodel,selections= rigid_body_selections,refine_r= True,refine_t= True,convergence_test= True,nref_min= 1000,
max_iterations= 25,
use_only_low_resolution = False,
high_resolution= 2.0,
Page 102103low_high_res_limit= 6.0,
max_low_high_res_limit = 8.0,
bulk_solvent_and_scale = True,bss= bulk_solvent_and_scale_parameters,
euler_angle_convention = "xyz",
log= log)
rotations= rigid_body_manager.total_rotation,translations = rigid_body_manager.total_translation

This performs L-BFGS minimization of a crystallographic target w.r.t. 6*len(rigid_body_selections)parameters. The model (xray_structure), crystallographic data (Fobs, ...), and target definition are heldby fmodel. The selections can cover either the whole molecule or selected parts. Atoms that are notselected are fixed during refinement. Depending on the parameters, it can perform either conventional
rigid body refinement in a selected resolution range or use more sophisticated multi-zone protocol where
the refinement starts in low resolution zone (defined by nref_min) and proceeds with the whole set ofreflections. Bulk solvent parameters and scale parameters are updated automatically if the model isshifted more than a certain threshold.

6.2 Grouped isotropic ADP refinement
The code for grouped isotropic ADP refinement resides in
cctbx_sources/mmtbx/mmtbx/refinement/group_b.py. A typical call is:
mmtbx.refinement.group_b.manager(
fmodel= fmodel,selections= group_adp_selections,convergence_test= True,max_number_of_iterations= 25,
number_of_macro_cycles= 3,
run_finite_differences_test = False,log= log)

This performs refinement of one isotropic ADP per selected group. Non-specific input parameters are
similar to those in rigid body refinement module. The refinable parameters are a shift in isotropic ADP
for each group, which are added to the original ADPs. The group-specific shifts are applied to both
isotropic and anisotropic atoms. For the latter the shift is added to the three diagonal elements of the ADP
tensor. In particular this is important for TLS refinement where the atoms in TLS groups are anisotropic
and the group ADP refinement is used. ADPs of non-selected atoms are unchanged.

6.3 TLS refinement
This

is

the

most

complexcode

mentioned

here

and

is

locatedinthe

cctbx_sources/mmtbx/mmtbx/tls and cctbx_sources/mmtbx/tls (Python andrespectively). The file cctbx_sources/mmtbx/mmtbx/tls/tools.py contains the class:directories
C++ code,class tls_refinement(object):def __init__(self, fmodel,
model,
selections,refine_T,refine_L,refine_S,
number_of_macro_cycles,
max_number_of_iterations,start_tls_value = None,
run_finite_differences_test = False,
eps = 1.e-6,
out = None,
macro_cycle = None):
Page 103104

which performs all principal steps in its constructor, including extraction of start TLS parameters from thecurrent ADPs (extracted from fmodel.xray_structure) and the current TLS parameters (zero in thefirst macro-cycle), L-BFGS minimization of a crystallographic target w.r.t. the TLS parameters, split of
total ADPs into local and TLS components, and enforcement of positive-definiteness of the final ADP
tensors for each individual atom. These operations are exposed as helper functions in tools.py which
can also be called individually.

6.4 Individual coordinates, ADP and occupancies
The file cctbx_sources/mmtbx/mmtbx/refinement/minimization.py is one of the most matrue files
in the mmtbx and is the main driver for restrained refinement of individual coordinates, ADPs (isotropic
or anisotropic) and occupancies for selected atoms using X-ray and/or neutron data. E.g. to perform
coordinate refinement:
mmtbx.refinement.minimization.lbfgs(
restraints_manager= restraints_manager,
fmodel= fmodel,model= model,refine_xyz= True,lbfgs_termination_params = lbfgs_termination_params,
wx= xray_term_weight,
wc= geometry_term_weight,
verbose= 0)

The model object contains selection information to determine which atoms are refined and which are
fixed.

7 Acknowledgments
We gratefully acknowledge the financial support of NIH/NIGMS under grant number P01GM063210.
Our work was supported in part by the US Department of Energy under Contract No. DE-AC0205CH11231.

8 References
Dayhoff, M.O. (1978). Atlas of Protein Sequence and Structure, Vol. 5 suppl. 3, 345-352.
Gotoh, O. (1982). J. Mol. Biol. 162, 705-708.
Grosse-Kunstleve, R.W., Adams, P.D. (2003). Newsletter of the IUCr Commission on Crystallographic
Computing, 1, 28-38.
Grosse-Kunstleve, R.W., Afonine, P.V., Adams, P.D. (2004). Newsletter of the IUCr Commission on
Crystallographic Computing, 4, 19-36.
Grosse-Kunstleve, R.W., Afonine, P.V., Sauter, N.K., Adams, P.D. (2005). Newsletter of the IUCr
Commission on Crystallographic Computing, 5, 69-91.
Henikoff & Henikoff (1992). PNAS 89, 10915-10919
Kabsch, W. (1976). Acta Cryst. A32, 922-923.
Kabsch, W. (1978). Acta Cryst. A34, 827-828.
Kearsley, S.K. (1989). Acta Cryst. A45, 208-210.
Needleman, S. & Wunsch, C. (1970). J. Mol. Biol. 48(3), 443-53.
Smith, T.F. & Waterman M.S. (1981). J. Mol. Biol. 147, 195-197.

Page 104105

An integrated three-dimensional visualization system VESTA using
wxWidgets
Koichi Momma1 and Fujio Izumi2
1Institute of Mineralogy, Petrology, and Economic Geology, Tohoku University, Aoba, Sendai, Miyagi
980-8578, Japan; 2 Quantum Beam Center, National Institute for Materials Science, 1-1 Namiki, Tsukuba, Ibaraki 305-0044, Japan.
E-mail: monmakou@ganko.tohoku.ac.jp - WWW: http://www.geocities.jp/kmo_mma/

1. Introduction
Progress in modern structure-refinement techniques of the maximum-entropy method (MEM) and MEMbased pattern fitting (MPF) [1], has made it easier and more popular to determine three-dimensional (3D)
distribution of electron densities from X-ray diffraction data and densities of coherent-scattering lengths(nuclear densities), bc, from neutron diffraction data. On the other hand, rapid developments of computer
hardware and software have accelerated and facilitated electronic-structure calculations affording
physical quantities including electron densities, wave functions, and electrostatic potentials.
Such technological advances in recent years bring demands for integrated 3D visualization systems todeal with both structural models and 3D pixel data such as electron and nuclear densities. The crystal
structures and spatial distribution of various physical quantities obtained experimentally and by computer
simulation should be understood three-dimensionally. Despite the availability of many structure-drawing
programs, cross-platform free software capable of visualizing both crystal and electronic structures inthree dimensions is very few; if any, they are not very suitable for displaying those of inorganic andmetallic compounds.
To improve such a situation, we have recently developed a new integrated system VESTA (Visualization
for Electronic and STructural Analysis) for 3D visualization of crystal structures and pixel data on
personal computers. This article at first gives a brief overview of VESTA, which is followed by moredetailed descriptions of features and algorithm that have been newly implemented in it.

2. Circumstances behind the development of VESTAVESTA is a successor to two 3D visualization programs, VICS and VEND, in the VENUS (Visualizationof Electron/NUclear densities and Structures) software package [1-4]. VENUS, which was developed by
Dilanian, Izumi, and Kawamura with help from Ohki and Momma during 2001–2006, comprises thefollowing five programs:
1. VICS (VIsualization of Crystal Structures) for displaying and manipulating crystal structures,
2. VEND (Visualization of Electron/Nuclear Densities) for displaying and manipulating 3D pixeldata,
3. PRIMA (PRactice Iterative MEM Analyses) for MEM analysis from X-ray and neutron
diffraction data,
4. ALBA (After Le Bail Analysis) for the maximum-entropy Patterson method,
5. Alchemy: a file converter to make it possible to analyze observed structure factors, which result
from Rietveld analysis using GSAS and FullProf, by MEM with PRIMA.
VICS and VEND are GLUT- and GLUI-based applications written in the C language with full use of
OpenGL technology. They saw the light of day at the end of 2002 and, since then, continued their growth
to be used widely in a variety of studies.

Page 105106However, we never get full satisfaction from their usability and performance for the following four
reasons. First, the combined use of them to visualize both crystal and electronic structures via text files israther troublesome; on-the-fly visualization of these two kinds of images is highly desired. Second, theirgraphical user interface (GUI) is not very user-friendly because they are based on the old-fashioned
toolkits, GLUT and GLUI, which have been no longer upgraded. GLUT and GLUI offer only a limited
number of widgets. For example, they do not support pull-down menus and tabs for windows, which are,at present, very popular in applications with GUI. One of the most serious troubles in VICS and VEND isthat they terminate suddenly without any warning messages whenever the close button at the upper rightcorner of the title bar in each window/bar has been clicked. This problem results from a bug in the
toolkits. Third, VICS and VEND can deal with only a limited number of objects such as atoms, bonds,
polyhedra, and polygons on isosurfaces. Fourth, they require large system resources owing to unrefinedprogramming.
To overcome the above faults in VICS and VEND, we at first upgraded VICS to VICS-II employing amodern C++ GUI framework wxWidgets [5,6] to build a new state-of-art GUI and further integrated
VICS-II and VEND into the next-generation 3D visualization system VESTA, adding new capabilities.

3. Overview
VESTA is a 3D graphic application written in the C++ language on the basis of OpenGL technology. It
runs fast on personal computers equipped with video cards accelerating OpenGL. Windows, Mac OS X,
and Linux versions are available. For each platform, both 32- and 64-bit applications will be distributedon the Web.
Thanks to wxWidgets, we can open multiple files using tabbed graphic windows; pull-down menus andtabbed dialog boxes are also supported. Needless to say, the annoying bug related to the close button
described above has now been fixed. VESTA allows us to deal with a practically unlimited number ofobjects as far as memory size goes. It requires much less system resources than VICS and VEND.
VESTA represents crystal structures as ball-and-stick, space-filling, polyhedral, wireframe, stick, andthermal-ellipsoid models. Ball-and-stick, wireframe, and stick models can be overlapped with dottedsurfaces corresponding to van der Waals radii. Polyhedra may be made translucent so as to make insideatoms and bonds visible. We can insert a movable lattice plane with variable opacities into a structuralmodel. Drawing boundaries can be defined by ranges along x, y, and z axes as well as lattice planes.
Electron/nuclear densities, wave functions, and electrostatic potentials are visualized as isosurfaces,
bird’s-eye views, and two-dimensional (2D) maps. VESTA has a feature of surface colorization to show
another kind of a physical quantity at each point on isosurfaces. Translucent isosurfaces can beoverlapped with a structural model.
VESTA can read in files with 36 kinds of formats such as CIF, ICSD, and PDB and output files with 11
kinds of formats such as CIF and PDB. Users of RIETAN-FP [7,8] must be pleased to learn that standard
input files, *.ins, can be both input and output by VESTA. The entire crystal data and graphic settings canbe saved in a small text file, *.vesta, without duplicating huge 3D pixel data. File *.vesta with the VESTA
format contains relative paths to 3D data files and optionally a crystal-data file that are read in
automatically when *.vesta is reopened. VESTA also makes it possible to export graphic files with 14
image formats including 4 vector-graphic ones.

4. Programming models
4.1 GUI parts
wxWidgets [5,6], which was formerly referred to as wxWindows, is one of the best toolkits for crossplatform GUI programming. It provides us with a look-and-feel inherent in each operating system. The
Page 106107

license agreement of wxWidgets, an LGPL-like license with some exceptions allowing binary distribution
without source code and copyright, is flexible enough to permit us to develop any types of applications
incorporating wxWidgets
During the course of GUI reconstruction, we carefully separated the source code of GUI parts from thatof other core parts to make it easier to reuse the latter in combination with other GUI toolkits. The core
parts are basically controlled from the GUI ones. However, there are exceptions where functions provided
by wxWidgets are called in some core parts. In such a case, the function is wrapped by another function
to make the core parts quite independent of GUI toolkits and to show which functions depend on external
libraries.
VESTA supports multiple windows, each of which may contain multiple tabs corresponding to files.
Various kinds of information is output to the bottom area, where comments can also be input after
clicking the comment tab.
Figure 1 shows the main window of VESTA running on Windows XP. A brief hierarchy of widget
classes to build it is illustrated in Fig. 2. An OpenGL canvas is placed on a wxNotebook widget giving
the ‘tab’ interface. Notebook widgets are usually designed to handle multiple-window components in thesame window area. However, we used some tricks to minimize system resources. VESTA was designed
in such a way that all the notebook pages have the same kind of a child, i.e., a wxGLCanvas widget.
Because the notebook widget ensures that no multiple pages are simultaneously displayed, we actuallyneed no multiple OpenGL canvases. Hence, VESTA assigns a single wxGLCanvas recursively to every
notebook page.

Fig 1: A screenshot of the VESTA main window.
wxFramewxNotebook

wxGLCanvas
wxPanelwxTextCtrl
wxNotebook

Fig 2: Schematic image of widgets-class hierarchy on the main window.

Page 107108

To maximize graphic performance, VESTA uses a cache mechanism of OpenGL display command lists
that increase in size with increasing number of drawing objects in the canvas; a command list for only one
canvas is always created. If each tab had its own canvas, the total size of memory consumed for thecommand lists of all the OpenGL canvases would become huge. The layout of widgets in VESTA,
therefore, reduces memory usage dramatically. For the Linux and Mac OS X ports, some additional
tweaks are required to reuse the same OpenGL canvas in different tabs.
4.2 Core parts
In contrast to the GUI framework, we tried to reuse other parts of the source code as much as possible.
All the global variables related to crystal data and graphic settings are capsulated into a Scene class toallow object-oriented programming. An instance of the Scene class is dynamically generated whenever
new data are created or read in from files so that multiple windows and tabs may work simultaneously.
The previous programs, VICS and VEND, can deal with only a limited number of objects and consume alarge amount of memory even when handling a relatively small number of data because both of them use
native ANCI C arrays. To eliminate this limitation with minimum effort and without any appreciable
overhead, C arrays were replaced with a small wrapper class of std::vector. The main part of thewrapper class is coded as follows:
template<typename T> class objVector{
public:~objVector(){clear();}
inline T& operator[](size_t i) {return (T&)*(T*)v[i];}inline void add(T* item){v.push_back( item );}void clear(){for(size_t i=0; i<v.size(); i++) delete (T*)v[i];v.clear();}void remove(size_t i){delete (T*)v[i];v.erase(v.begin()+i);}
std::vector<void*> v;};

We also prepared the same kind of a wrapper class, aryVector, for pointers to arrays. This classpermits type-safe programming without unnesessary code duplication of the std::vector templateclass. Further, it can be accessed by a [] operator in exactly the same way as with C arrays on a sourcecode level despite great differences in real operations on a binary level. We should only note that all theobjects must be deletable; that is, they should be generated by a new operator. Because they areautomatically deleted by a destructor when wasting an array, we need not concern about memory leaks.
We have another genuine reason why the std::vector class is indirectly used in nearly all cases.
Instances of objects can be shared by two or more arrays of the same form. Elements in an array can bequickly sorted only by manipulating pointers without copying a large amount of data for real objects.

5. Dealing with structural models
5.1 Searching for bonds
Bond-search algorithm was much improved in VESTA. The most primitive way to search for bonds is to
examine the entire pairs of atoms within drawing boundaries. We adopted a similar approach with some
improvements in VICS. Although this algorithm is very simple, the calculation time increases drastically
Page 108

109

with increasing number of atoms, N, in the drawing region. The calculation cost is proportional to thesquare of N, which is expressed as O(N2) with big O notation.12
On the other hand, the calculation time is linearly proportional to N, O(N), in VESTA as a result ofchecking only atom pairs where distances between them are smaller than a certain value. To minimize thenumber of atoms to be examined, a variant of the cell index method by Quentrec and Brot [9,10] wasadopted in VESTA. This approach is widely used in programs for molecular dynamics simulation thatneeds to deal with a large number of atoms [11]. The basic idea of the cell index method is to divide alarge box into subboxes (subcells in the present case) and make up a list of atoms in each subcell. Whendrawing a crystal structure, the large box corresponds to drawing boundaries, and sizes of a subcell along
x, y, and z directions are chosen so as to be slightly larger than the largest bond length. This manner
ensures that all the bonds for an atom can be found within the same cell plus neighboring 26 subcells,
each of which typically contains only a few atoms.
VESTA can search for bonds in three modes. In the first mode, both A1 and A2 atoms bonded to eachother are specified. The second mode is used to search for all the atoms located between minimum andmaximum distances from an A1 atom. In the third “Search molecule” mode, a set of atoms within a
specified bond length is reiteratively found. Atoms A1 and A2 may be specified by entering either
symbols for elements or site names.
5.2 Changes in drawing boundaries
Drawing boundaries for structural models can be changed in sophisticated ways similar to convoluting
and reiterative-convoluting spheres in ORTEP-III [12]. For example, we usually prefer that coordination
polyhedra are not omitted but drawn when their central atoms are situated within the drawing boundaries.
For this purpose, all the atoms bonded to these central atoms are added with option “Beyond theboundary” (Fig. 3). To draw Fig. 3, bonds were searched in two different ways. One was to use the“Search A2 bonded to A1” mode with A1 = Al and A2 = O and check “Show polyhedra” and “Searchbeyond the boundary” options. The minimum and maximum limitations of bond lengths were 0 Å and 2.1
Å, respectively. The other was to use the “Search molecules” mode and apply the “Search beyond theboundary” option to O–H bonds. Bond lengths were set between 0 Å and 1.0 Å, and drawing boundaries
between (0, 0, 0) and (1, 1.5, 1).

Fig 3: Crystal structure of δ–AlOOH, a high pressure modification of aluminum oxide hydroxide, withthermal-displacement ellipsoids at a 99 % probability level [13]. H atoms are represented by spheres ofan arbitrary radius.

12

The big O notation is a mathematical one to describe the behavior of a function for a very large (or a very small) number of
input data, in this case, N atoms. More precisely, “f(n) is O(g(n))” means that there exists a certain constant m and a positive constant c such that f(n) ≤ c*g(n) for n > m.
110
Page 109

In organic compounds including metal complexes, the combination of the “Search molecule” mode andoption “Beyond the boundary” is used to search for the entire atoms of molecules with at lease one atom
lying within drawing boundaries.
5.3 Information about objects
Selection of objects (atoms, bonds, and coordination polyhedra) by clicking with a mouse provides us
with a variety of crystallographic information in the output window at the bottom:
1) fractional coordinates,2) symmetry operations and translation vectors,3) site multiplicities plus Wyckoff letters derived by STRUCTURE TIDY [14] embedded in
RIETAN-FP (for files of some formats)4) interatomic distances, bond angles, and torsion angles,5) information about coordination polyhedra including volumes, Baur’s distortion indices [15],quadratic elongations [16], bond angle variances [16], bond valence sums [17] of central
metals, and bond lengths expected from bond valence parameters [17].
5.4 Lattice transformation
VESTA has a feature to convert general equivalent positions in a conventional setting into those in a nonconventional one with a transformation matrix, which is also used for (primitive lattice)–(complex lattice)
conversions and for creating superstructures.
⎛ P p⎞⎟⎟ consists of the (3× 3) rotation matrix P and the (3× 1)
The (4× 4) transformation matrix = ⎜⎜⎝ 0 1⎠
translation vector p. Primitive translation vectors a, b, c are transformed by P as(a',b',c' ) = (a,b,c )P⎛ P11⎜= (a,b,c )⎜ P21
⎜P
⎝ 31

P12
P22
P32

P13 ⎞
⎟
P23 ⎟
P33 ⎟⎠= (P11a + P21b + P31c, P12a + P22b + P32c, P13a + P23b + P33c ).

The shift of the origin is defined with the shift vector⎛ p1 ⎞⎜ ⎟p = (a , b, c ) p = (a , b, c )⎜ p2 ⎟ = p1a + p2b + p3c .
⎜p ⎟
⎝ 3⎠

The symmetry operationis transformed by’=⎛ Q q ⎞ ⎛ P -1⎟⎟ = ⎜⎜
where Q = ⎜⎜⎝ 0 1⎠ ⎝ 0

The lattice vector-P -1 p ⎞
⎟=
1 ⎟⎠

–1

,

.

⎛ x⎞
⎜ ⎟
⎜ y⎟
= ⎜ ⎟ is transformed by
z
⎜ ⎟
⎜1⎟
⎝ ⎠

’=

.

Page 110

111

If the determinant of P, det(P), is negative, the crystal-coordinate system is transformed from righthanded to left-handed, and vice versa. If det(P) is not 1, the unit-cell volume, V, changes on the latticetransformation. When det(P) is larger than 1, VESTA allows us to create a superstructure by examining
the following equation to find additional sites lying in between (0,0,0) and (1,1,1).
⎛ x' ⎞⎜ ⎟⎜ y'⎟⎜ x' ⎟ =
⎜ ⎟
⎜1⎟
⎝ ⎠

⎛ x + nx ⎞⎜⎟⎜ y + ny ⎟⎜ z+n ⎟
z
⎜
⎟
⎜ 1 ⎟
⎝
⎠

(n x , n y , n z = 0, ± 1, ± 2, ...) .

Note that VESTA adds no new equivalent positions but new sites when creating superstructures. That is,
the space group of the new structure should be a subgroup of the original space group. When det(P) issmaller than 1, the same position may result from two or more sites. In such a case, the redundant sites
can be removed by clicking a “Remove duplicate atoms” button.

6. Dealing with 3D pixel data
6.1 Three kinds of representation
Isosurfaces are represented as smooth-shaded polygons, wireframes, and dot surfaces. Physical quantities,e.g., wave functions and nuclear densities, having both positive and negative values are expressed byisosurfaces with two different colors.
6.2 Surface colorization
Another attractive feature is surface colorization, whose typical application is to colorize isosurfaces ofelectron densities according to electrostatic potentials. Figure 4 exemplifies an application of thisfeature to results of an electronic-state calculation for the [Cd{S4Mo3(Hnta)3}2]4– ion (H3nta:
nitrilotriacetic acid) [18] by a discrete variational Xα method with DVSCAT [19]. The isosurface level
was set at 0.03a0–3, and electrostatic potentials on the isosurface range from –0.814 Ry (blue) to 0.174 Ry(red). Opacity parameters, C1 and C2, for the isosurface (see 6.4) were 80 % and 100 %, respectively.

Fig 4: A composite image of an electron-density isosurface colorized on the basis of electrostatic
potentials and a ball-and-stick model for the [Cd{S4Mo3(Hnta)3}2]4– ion [18].

Page 111

112

6.3 Two-dimensional distribution on lattice planes and boundary sections
Lattice planes (slices) can be inserted to display 2D distribution of a physical quantity in addition to its
isosurfaces. Both boundary sections and lattice planes are colorized on the basis of numerical values onthem. The saturation level of color is specified as (a) a value normalized between 0 and 100
corresponding minimum and maximum values, respectively, and (b) a value corresponding to raw data.
The color index, T, for a data point with a value of d is calculated from two saturation levels, Smin andSmax, in the unit of the raw data:d − S min.
T=
S max − S min
Data points with values larger than Smax and smaller than Smin are given the same colors as those assigned
to Smax and Smin, respectively. The color of each point is determined from T, depending on color modes:
B-G-R, R-G-B, C-M-Y, Y-M-C, gray scale (from black to white), and inversed gray scale. For example,
blue is assigned to 0, green to 0.5, and red to 1 in the B-G-R mode.
6.4 How to calculate opacities of polygons
With VESTA, the visibility of both outlines of isosurfaces and an internal structural model was
surprisingly improved in comparison with that with VEND. The opacity, C(p), for polygon p with anormal vector of (x, y, z) is calculated with a linear combination of two opacity parameters, C1 and C2, forpolygons parallel and perpendicular to the screen, respectively:
C ( p) = C1 z + C2 (1 − z ).
6.5 Order of drawing polygons
When drawing translucent objects with the OpenGL API, polygons should be usually drawn from behind.
VESTA sorts a set of polygons before drawing them, making it possible to render images properly
regardless of orientation of the objects. The sequence of drawing polygons can optionally be reversed.
The use of this option may sometimes improve the visibility of complex isosurfaces because neither backsurfaces nor internal ones are drawn; otherwise, they heavily overlap each other to give an improper
image.
6.6 Pixel operations
VESTA supports pixel operations between more than two 3D data sets. For example, this feature enables
us (a) to subtract calculated electron densities from observed ones obtained by MEM analysis to detectatoms missing in a structural model and (b) to subtract down-spin electron densities from up-spin ones tovisualize effective spin densities (Fig. 5).
AC

B

Fig 5: Distributions of electron densities and effective spin densities calculated with DVSCAT for the O2
molecule. A: up-spin electron density; B: down-spin electron density; C: effective spin density (A – B)
calculated with VESTA. Isosurface levels were set at 0.01a0–3 (A and B) and 0.001a0–3 (C), respectively.

Page 112113

6.7 Improvements in rendering quality
The quality of rendering objects such as isosurfaces, boundary sections, and lattice planes in VESTA ismuch higher than that in VEND, even when dealing with a relatively small number of pixels.
6.7.1 Smooth-shading modelA flat-shading model to draw isosurfaces was used in VEND. It assigns a normal vector to each polygon,
which causes the discontinuity of reflection colors near vertices and edges shared with neighboring
polygons. To settle this problem, we adopted a smooth-shading model, which assigns a normal vector toeach vertex of a polygon, in VESTA. The normal vector at each point on the polygon is calculated with ashading model, ‘GL_SMOOTH’, provided by the OpenGL API using a linear combination of the normal
vectors at the vertices.
6.7.2 Colors for boundary sections and lattice planes
VEND assigns RGB values to vertices of polygons on boundary sections and lattice planes. However,these ‘colored polygons’ are problematic when data values mainly change in a narrow region. Suppose asituation where blue is assigned to 0, green to 0.5, and red to 1. If the three vertices of a triangularpolygon have values of 0, 0.5, and 1, the color for the center of the polygon becomes a mixture of thethree colors:
R = (0 + 0 + 1) / 3 = 1 / 3
G = (0 + 1 + 0) / 3 = 1 / 3
B = (1 + 0 + 0) / 3 = 1 / 3 .
The resultant color is gray that does not represent any physical quantities. To avoid the appearance ofsuch a meaningless color, VESTA prepares a rainbow-colored one-dimensional texture, glTexImage1D,
and assigns coordinates in the texture to vertices. For RGB texture, 0 is assigned to blue texture positions,
0.5 to green ones, and 1 to red ones. Then, for any sets of three physical quantities at vertices and for any
positions of polygons, texture coordinates represent values at those positions. In the above case, thetexture coordinate (= color index), T, at the center of the polygon is:
T = (0 + 0.5 + 1) / 3 = 0.5 .

The internal unit of saturation levels for colors is changed from a normalized one to a raw-data one so thatsaturation levels close to 0 or 1 (in a normalized unit) can work correctly. Assume that we specify
saturation levels normalized between 0 and 1 corresponding to minimum and maximum values in a dataset, respectively. Then, a problem arises from floating-point arithmetic errors if 3D data have extremely
large (or small negative) values as in the case of electrostatic potentials. For instance, suppose a casewhere minimum and maximum data values are respectively –1020 and 0 with saturation levels from –10 to
0 in the raw-data unit. The normalized value for –10 is (–10 + 1020)/(0 + 1020) ≈ 1 while that for 0 is (0 +1020)/(0 + 1020) = 1. Thus, with the normalized representation, values between –10 and 0 cannot be
distinguished within the precision of floating-point arithmetic. This problem does not occur in VESTA
because the internal representation of saturation levels, –10 and 0 in the above case, has the same
precision as with raw data. Thus, VESTA generates no factitious lines on colored isosurfaces.
6.7.3 Surface colorization
For colorization of isosurfaces, unrefined code was written in VEND. That is, data values at vertices on
the isosurfaces are approximated at those of the nearest pixels while different values are assigned to thosevertices of neighboring polygons which have just the same coordinates. We thoroughly redesigned thesurface-colorization feature in VESTA. With VESTA, the data value, U(v), for vertex v between two
pixels, p1 and p2, is evaluated using a linear combination of U(p1) and U(p2):
U ( p1 )l 2 + U ( p 2 )l1
U (v ) =l1 + l 2
where l1 and l2 are the distance between v and p1, and that between v and p2, respectively; l1 + l2 is equal
to the distance between p1 and p2. Thus, VESTA shows much smoother isosurfaces without interpolationof pixel data than VEND.
Page 113

114

6.8 Algorithm for geometry calculations
The calculation of isosurface geometry has been appreciably accelerated in VESTA compared with that in
VEND.

Figure 6 shows a 2D projection of 3D pixel data and ‘grids’ defined by pixel rows along x, y, and z axes.
Vertices and polygons on isosurfaces are calculated for all the subgrids with eight pixels per grid. For
each subgrid, its twelve edges are checked whether they intersect the isosurfaces or not. For example, if apixel data, p(i,j,k), is larger than the isosurface level whereas p(i-1,j,k) is smaller than it, a vertex betweenp(i,j,k) and p(i-1,j,k) for a polygon is generated. Every polygon on the isosurface generated in this way
has its own three vertices. However, all the pixels except those on drawing boundaries are shared withneighboring eight subgrids, which means that values at most pixels are evaluated as many as eight times.
Furthermore, this method generates many duplicate vertices with the same coordinates because mostvertices on the isosurface are common among neighboring six polygons. The sluggish speed of
calculating isosurface geometry with VEND is explained in terms of these facts. The simple but
inefficient approach to calculate isosurface geometry is given below:p(0,j,k)g(1,j,k)......

p(0,j-1,k)g(1,2,k) g(2,2,k)p(0,1,k)g(1,1,k)p(0,0,k)g(2,1,k)p(1,0,k) . . . . . .

g(i,1,k)p(i-1,0,k)p(i,0,k)Fig 6: The relation between 3D pixel data p and grid g defined by nearest eight pixels. Polygons for theisosurface are calculated for each grid.
calculate_isosurface_geometry_old(
float *rho, // 3D pixel data
float isolevel // isosurface levelint bbox[6], // Drawing boundaries
int NPIX[3], // Number of pixels along x, y, z in unit cell){
int i, j, k, m;
int r[8][3];float grid[8][4];float *vertlist[12];objVector<Polygon> poly; // list of polygons on isosurface
unsigned char cubeindex; // bit flags for a grid recording which pixels are outside/inside of// isosurface...
r[0][0] = 0; r[0][1] = 0; r[0][2] = 0;r[1][0] = 1; r[1][1] = 0; r[1][2] = 0;r[2][0] = 1; r[2][1] = 1; r[2][2] = 0;r[3][0] = 0; r[3][1] = 1; r[3][2] = 0;r[4][0] = 0; r[4][1] = 0; r[4][2] = 1;
r[5][0] = 1; r[5][1] = 0; r[5][2] = 1;
r[6][0] = 1; r[6][1] = 1; r[6][2] = 1;
r[7][0] = 0; r[7][1] = 1; r[7][2] = 1;
for (k=bbox[4]; k<bbox[5]; k++){for (j=bbox[2]; j<bbox[3]; j++){for (i=bbox[0]; i<bbox[1]; i++){Page 114

115

for (m=0; m<8; m++){int id = pos(i, j, k); // pos(i, j, k) reterns integer index of pixel(i, j, k)
grid[m][0] = i + r[m][0];grid[m][1] = j + r[m][1];grid[m][2] = k + r[m][2];grid[m][3] = rho[id];if (rho[id] < isolevel) cubeindex |= 1 << m;}// All the eight pixels are evaluated. Now calculate vertices for tweleve edges.
// ‘edgeTable’ is a list of IDs used to judge wether the edge intersects theisosurface or not.
// calc_vtx() returns coordinates of a vertex.
if(edgeTable[cubeindex] & 1) vertlist[0] = calc_vtx(isolevel, grid[0], grid[1]);...
if(edgeTable[cubeindex] & 1024) vertlist[10] = calc_vtx(isolevel, grid[2], grid[6]);if(edgeTable[cubeindex] & 2048) vertlist[11] = calc_vtx(isolevel, grid[3], grid[7]);// Build polygons using vertices stored in vertlist.
...
} // end loop(i)} // end loop(j)} // end loop(k)}What is worse, if we try to render an isosurface with the smooth-shading model, redundant vertices of theisosurface should be reduced to a single vertex to calculate a normal vector. Such a situation should be
avoided because of the following three reasons: pixel values are evaluated as many as eight times per
pixel; vertices on the isosurface are generated six times greater than needed; a large number of vertices
generated in this way are compared with each other to check duplication.
Our new algorithm introduced into VESTA eliminates all of these redundant calculations by a refinementof the order of loops, as can be appreciated from Fig. 6.
calculate_isosurface_geometry_new(
float *rho,// 3D pixel data
float isolevel // isosurface levelint bbox[6], // Drawing boundaries
int NPIX[3], // Number of pixels along x, y, z in unit cell){
int i, j, k;aryVector<float*> vtx; // list of vertices on isosurface
unsigned char *cubeindex; // bit flags for each grid recording which pixels are outside/inside of// isosurface
long *edgeList;// edge tables recording integer identifier of vertices on the edges...
cubeindex = new unsigned char[2*(bbox[1]-bbox[0] +1)* (bbox[3]-bbox[2]+1)];
edgeList = new long[6*(bbox[1]-bbox[0] )* (bbox[3]-bbox[2])]for (k=bbox[4]; k<=bbox[5]; k++){...
// copy cubeindex(i,j,k) to cubeindex(i,j,k-1), reset cubeindex(i,j,k).
// copy edgeList(i,j,k) to edgeList(i,j,k-1).
for (j=bbox[2]; j<=bbox[3]; j++){for (i=bbox[0]; i<=bbox[1]; i++){int M = pos(i, j, k); // pos(i, j, k) reterns integer index of pixel(i, j, k)
if (rho[M] > isolevel){...
// register bit flags to 8 grids around this pixel that this pixel is inside// of isosurface}
if(i > bbox[0]){...
// Calculate vertices between p(i-1, j, k) and p(i, j, k),// add to vtx and register it to edgeList.
Page 115

116

}if(j > bbox[2]){...
// Calculate vertices between p(i, j-1, k) and p(i, j, k),// add to vtx and register it to edgeList.
}
if(k > bbox[4]){...
// Calculate vertices between p(i, j, k-1) and p(i, j, k),// add to vtx and register it to edgeList.
}
if(i > bbox[0] && j > bbox[2] && k > bbox[4]){...
// Generate polygons for grid(i, j, k) using the bit flag cubeindex(i, j, k)// and edgeList.
}} // end loop(i)} // end loop(j)} // end loop(k)}Note that cubeindex is now changed to an array of indices for two sheets with k=k-1 and k=k in grids
arranged three-dimensionally. Instead of carrying out a loop for grids to check pixel values, our new
algorithm directly carries out loops for pixels and updates the indices of eight grids around the pixel inevery cycle. In the same cycle, the coordinates of vertices on the three edges of grid g(i,j,k) are calculated
and stored in an array vtx. For example, in cycle (i=2, j=2, k=k), the coordinates of vertices betweenp(1,2,k) and p(2,2,k), p(2,1,k) and p(2,2,k) (bold lines in Fig. 6), and p(2,2,k-1) and p(2,2,k) are calculated.
Other vertices of grid g(2,2,k) have already been calculated in other cycles, (i=1,j=2,k=k), (i=2,j=1,k=k),etc. Then, in the same cycle, polygons for grid g(2,2,k) are generated using a list of vertices stored in
vtx.
This algorithm has another advantage that the memory size for data at vertices is significantly reduced
owing to the reuse of data at vertices among neighboring polygons.

7. Other new features
7.1 Cutoff planes
Drawing boundaries are fundamentally specified by inputting ranges along x, y, and z axes in the“Boundary” dialog box, where we can further specify “Cutoff planes”. Each cutoff plane is specified with
Miller indices h, k, and l, and a central distance from the origin (0,0,0). After atoms, bonds, andisosurfaces within the x, y, and z ranges have been generated, those lying outside of the cutoff planes are
excluded. Therefore, this feature is particularly useful to visualize distribution of 3D pixel data on latticeplanes in addition to isosurfaces. The central distance of a cutoff plane may be specified in the unit ofeither its lattice-plane spacing, d, or Å.
7.2 Hiding objects efficiently
Two or more atoms, bonds, and polyhedra can now be selected with mouse dragging and hidden bypressing the Delete key. Pressing the Esc key resumes the hidden objects.
7.3 Improvement in depth-cueing
Depth-cueing was revised to allow more flexible settings. An OpenGL API, glFog, with a‘GL_LINEAR’ mode is used to enable depth-cueing. It blends a ‘fog’ color with the original color ofeach object using the blending factor f. Both of the starting depth, start, and the ending depth, end, aredefined by users. The factor f at depth z is computed byend − z.
f =end − start
Page 116

117

VESTA automatically assigns the background of the canvas to the fog color Cf. Then, the color, Cr, of arendering object is replaced by
Cr ' = f * Cr + (1 − f ) * Cf .
When VESTA displays objects on the OpenGL canvas, the depth of each object, z, is normalized in sucha way that the radius of a bounding sphere for the scene becomes 0.9. Then, start = 0.0 and end = 1.0, forexample, clearly render the half of the scene closer than z = 0.0 without any depth-cueing whereas thefarthest objects (z = 0.9) are completely invisible.

8. Collaboration with external programs
8.1 ORFFE
ORFFE [20] calculates geometrical parameters from data in file *.xyz created by RIETAN-FP, outputting
them in file *.ffe. When reading in *.lst and/or *.ins, VESTA also inputs *.ffe automatically provided that*.ffe shares the same folder with *.lst and/or *.ins. Otherwise, *.ffe can be input by pressing the “Read*.ffe” button in the “Geometrical Parameters” dialog box. This dialog box lists interatomic distances andbond angles recorded in *.ffe.

VESTA allows us to locate the bonds and bond angles displayed in the “Geometrical Parameters” dialog
box on a graphic window. On selection of a bond (2 atoms) or a bond angle (3 atoms) in this dialog box,
the corresponding object in a ball-and-stick model is highlighted, and vice versa (Fig. 7). Thus, atom pairs
and triplets associated with geometrical parameters on which restraints are imposed in Rietveld analysis
with RIETAN-FP are easily recognized in the ball and stick model.

Fig 7: "Geometrical Parameters" dialog box showing a list of bond angles recorded for fluorapatite in*.ffe. An O3–P–O2 angle is highlighted in the graphic window.

Because ORFFE calculates estimated standard deviations (e.s.d.’s) of geometrical parameters with both
diagonal and off-diagonal terms in the variance-covariance matrix, the resulting values of e.s.d.’s are
improved compared with those given by VESTA using only diagonal terms.
Page 117

118

8.2 RIETAN-FP
wxWidgets provides us with function wxExecute and class wxProcess to call external programs
easily from existing processes. Therefore, we can virtually extend VESTA by running other applications
as a child process, yet keeping its core code simple and small. VESTA utilizes this framework to simulate
powder diffraction patterns with RIETAN-FP. On selection of the “Powder Diffraction Pattern…” item
under the “Utilities” menu, a series of procedures, i.e., generation of an input file, *.ins, for RIETAN-FP,
execution of RIETAN-FP, and graphic representation of the resulting data in file, *.itx, with a graphing
program such as Igor Pro and gnuplot, is executed by VESTA as if they were implemented in VESTA.

9. Summary
With all the advanced features and high performance described above, VESTA is expected to contributemany investigations of crystal and electronic structures. It will act as a ‘mediator’ between structure
analyses and electronic-structure calculations. We will polish it up further to make it more useful andmore powerful.

References[1] F. Izumi and R. A. Dilanian, in: Recent Research Developments in Physics, vol. 3, part II,
Transworld Research Network, Trivandrum (2002) pp. 699–726,.
[2] F. Izumi: Rigaku J., 36, No. 1 (2005) 18.
[3] F. Izumi and R. A. Dilanian: Commission on Powder Diffr., IUCr Newslett., No. 32 (2005) 59.
[4] F. Izumi and Y. Kawamura: Bunseki Kagaku, 55 (2006) 391.
[5] Information obtainable from http://www.wxwidgets.org/[6] J. Smart, K. Hock, and S. Csomor: Cross-Platform GUI Programming with wxWidgets, PrenticeHall (2005).
[7] F. Izumi and T. Ikeda: Mater. Sci. Forum, 321–324 (2000) 198.
[8] F. Izumi and K. Momma: Proc. XX Conf. Appl. Crystallogr., Solid State Phenom., in press.
[9] B. Quentrec and C. Brot: J. Comp. Phys., 13 (1975) 430.
[10] M. P. Allen and D. J. Tildesley: Computer simulation of liquids, Clarendon Press, Oxford (1987) p.
149.
[11] K. Refson: Computer Phys. Commun., 126 (2000) 310.
[12] M. N. Burnett and C. K. Johnson: Report ORNL-6895, Oak Ridge National Laboratory (1996).
[13] K. Komatsu, T. Kuribayashi, A. Sano, E. Ohtani, and Y. Kudoh: Acta Crystallogr., Sect. E, 62(2006) 216[14] L. M. Gelato and E. Parthé: J. Appl. Crystallogr., 20 (1987) 139.
[15] W. H. Baur: Acta Crystallogr., Sect. B, 30 (1974) 1195.
[16] K. Robinson, G. V. Gibbs, and P. H. Ribbe: Science,172 (1971) 567.
[17] I. D. Brown and D. Altermatt: Acta Crystallogr., Sect. B, 41 (1985) 244.
[18] G. Sakane, H. Kawasaki, T. Oomori, M. Yamasaki, H. Adachi, and T. Shibahara: J. Cluster Sci., 13(2002) 75.
[19] H. Adachi, M. Tsukada, and C. Satoko: J. Phys. Soc. Jpn., 45 (1978) 875.
[20] W. R. Busing, K. O. Martin, and H. A. Levy: Report ORNL-TM-306, Oak Ridge National
Laboratory (1964).

Page 118

119

Visual Graphic Library VGLIB5 for Crystallographic Programs on
Windows PCs
Kenji Okada*a, Ploenpit Boochatuma, Keiichi Noguchib and Kenji OkuyamacaFaculty of Science, King Mongkut's University of Technology Thonburi, Bangmod, Tungkru, Bangkok
10140, Thailand, bInstrumentation Analysis Center, Tokyo University of Agriculture and Technology, Koganei, Tokyo 184-8588, Japan, and cDepartment of Macromolecular Science, Graduate School of Science, Osaka University, 1-1 Machikaneyama, Toyonaka, Osaka 560-0043, Japan; Email:*kokada@kmutt.ac.th, ploenpit.boo@kmutt.ac.th, knoguchi@cc.tuat.ac.jp, okuyamak@chem.sci.osakau.ac.jp ; WWW: http://www.ccp14.ac.uk/ccp/web-mirrors/okada/, http://www.chem.sci.osakau.ac.jp/lab/tashiro/index.html

Abstract
VGLIB5 (Visual Graphic Library version 5) is a graphic library for scientific simulation program. The
capabilities of the VGLIB5 are: 1) Fortran callable routines (CALCOMP and/or Basic like), 2) Display on
MS-Windows (PCs) or X-Windows (HP/IBM/SGI/SUN), 3) Prepare HP-GL 758X plotter files, 4)
Prepare Postscript files, and 5) Prepare a VTR tape using IMAGE memory. And the basic concept is avery simple. This library 1) does not depend on hardware (from super-computer to PCs) and OS, 2) iscallable from Fortran and/or C languages, 3) can accept the input controls from keyboard and mouse, andoutput the results to color display, VTR, HP-GL plotter and Postscript printers, and 4) has adopted thelayered structure for easy maintenance.

1 Introduction
Several crystallographic subroutine libraries [1] and several graphics user interfaces (GUI) [2] for crossplatform are also reported on IUCr Computing Commission newsletters in detail. Applications ofcomputer graphics are allpied covering polysemy such as Film, Game, Animation, Scientific/
Visualization simulation, Web graphs, Artitecture/Product design and Print/Publishing. These
applications are developed and distributed as a software package or a handmade software. To develope a
new graphical software in scientific simulation, firstly we must examine the target platforms (mainframes,
Workstations, Personal Computers, and graphic terminals) with operating system. Secondary the newsoftware adapts an exsisting and widely used graphic library that has a graphic application programming
interface (API). Most graphic libraries are dependent on the platform, and like a graphics processing unit,
do not exhibit the interface specification, and have not become open source. Thirdly this software shouldbe implemented widely using programming languages such as Fortran, C/C++ or Visual Basic.
Adopting the graphic library having interface to Fortran and/or C/C++ languages, we once more examine
the input/output functions. In scientific simulation, input devices mostly used are digital camera, scanner,
OCR (Image/Text), keyboard and mouse, and output devices are display, printer/plotter, video taperecorder (VTR) and/or files. After ACM-SIGGRAPH [3] was established in 1969, there are many graphic
software libraries as standards that have ‘de-facto’ standards for the portability of graphic programs suchas Graphical Kernel System (GKS, GKS-3D) [4], Programmers Hierarchical Interactive Graphics System(PHIGS, PEX) [5], PostScript [6], or X Window System (X) [7]. Recently windows based graphic
libraries such as OpenGL [8], PGPLOT [9], Gnuplot [10], Alias [11] and AVS [12] are used in MSWindows and X-Windows of Unix/Linux computers. Several libraries are free of charge.
If the new planned program in scientific simulation is very simple as like as crystallographic computation
and uses limited input/output devices such as no input and three outputs (display, plotter/postscript fileand VTR), these graphic libraries appeared on the market in the world are very heavy to execute our new
program. The essential functions of the graphics library in these simulations are draw/display colored

Page 119120

points, lines, planes, fill area, texts, view-port, and etc. If these functions are callable from Fortran and/or
C/C++ languages, it is the very graphic library that we desire.
In 1991, the first version of a graphic library GRLIB (Graphic Library) was proposed for the scientificsimulation program using Fortran language [13]. This GRLIB did not depend on any platform such as
super-computer (Cray/COS), mainframe (CDC6600/SCOPE) and 32 bits PCs (MS-DOS), and was able totreat most popular plotter devices that time having Calcomp/PLOT10 protocols. The GRLIB2 (version 2)
was developed in 1996 [14] adding VTR features using image memory for IBM 5080 display of
mainframe (IBM3090/ MVS), workstation (HP900/HP-UX) and PCs (MS-DOS). The VGLIB3 (Visual
Graphic Library, version 3) as an implemented version of GRLIB2 was developed in 1997 [15] adding
the features of CRT display and HP-GL protocol under MS-Windows PCs (NT 3.x/95). The VGLIB4(version 4) adopted layer approach and added the Postscript protocol on MS-Windows PCs(NT3.x/4.0/95/98) [16]. In 2005, the VGLIB5 (version 5) was implemented as a unified graphic libraryfor scientific simulation from the VGLIB4. This VGLIB5 written in Fortran90/95 is used in DS5(DIRECT-SEARCHER Automatic System version 5) for structure analysis of small molecules running on
PCs [17], and works on X-Windows (Unix/ Linux). In this paper we focus on the layered structural design
and features of DSLIB5.

2 Description
2.1 Basic Concept
The basic concept in the VGLIB5 for scientific simulation is very simple. This visual graphic library 1)
does not depend on hardware (from super-computer to PCs) and operating system (OS), 2) is callable
from Fortran and/or C languages, 3) can accept the input controls from keyboard and mouse, and output
the results to color display, VTR, HP-GL plotter and Postscript printers, and 4) has the layered structure
for easy maintenance.
2.2 Capabilities of VGLIB5 (MS-Windows and Unix/Linux):
There are five capabilities: 1) Fortran callable routines (CALCOMP and/or Basic like), 2) Display on
MS-Windows (PCs) or X-Windows (HP/IBM/SGI/SUN), 3) Prepare HP-GL 758X plotter file, 4) Prepare
Postscript file, and 5) Prepare VTR tape using IMAGE memory.
2.3 Layered Structure
The VGLIB5 has the layered approach (Fig. 1). The bottom layer is the driver groups depending on eachdevice (8 drivers), the second one is common routines of basic primitives and functions, and the third one
is application routines according to each purpose. Each routine of three layers can be called directly fromthe user program.

user program (Fortran)
applications (A-)

Third layer

Second layer

First layer

Draw Arrow
Draw Contour line
Free Mesh draw and Contour Z(i,j) value
Fill Area with Cell Edge Values

common (C-)
drivers (D-, G-, I-, M-, P-, Ps-, T-, X-)

VGLIB5.lib
VGLIB5.abuffer circle clear close color
cursor factor font
hardcopy
image line
mouse open paint
paper pen
pixel rotate scale
text
unit view VTR window

D- M506 graphic adapter
G- PC-CRT (Windows NT4.0/95/98)
I- IBM5080 graphic adapter
M- PC-Mouse (Windows NT4.0/95/98)
P- HP-GL plotters (CALCPMP like)Ps- PostScript printer
T- IMAGE Memory
X- HP, IBM, SGI, SUN X-window (UNIX, C)

Fig 1: Layered structure of VGLIB5
Page 120

121

The driver layer consists of eight series as follows. The routines in X-series equal ones in G-series. (justdiffer the platform)
SeriesDGIMPPSTX-File
VGLIBD.for
VGLIBG.for
VGLIBI.for
VGLIBM.for
VGLIBP.for
VGLIBPS.forVGLIBT.for
VGLIBXI.c
VGLIBXS.c

Comment
No. of routines
for M506 graphic adapter
M506, 9for PC-CRT (Windows)
PCs, 36
for IBM5080 graphic adapter
IBM5080, 2
for PC-Mouse (Windows)
Mouse, 4
for CALCPMP Plotter
Plotter, 13
for PostScript printerPostscript, 10
for IMAGE Memory
IMAGE memory, 10
for HP, IBM X-window of UNIX Fortran X-window, ANSI C, 36
for SGI, SUN X-window of UNIX Fortran X-window, ANSI C, 36

The common layer has three series used in commonly such as text, for the display and paper handling.
SeriesC-

File
VGLIBC1.for
VGLIBC2.for
VGLIBC3.forComment
Text data
VGxxx routines
set CRT/Paper

No. of routinesalphabetic, numeric, symbols, 1
display control, 20
view port, paper size, etc., 4

The application layer has the collection of the routines with a certain purpose.
Series File
Comment
No. of routinesAVGLIBA.for application
arrow, contour, grading, etc., 4
2.4 Colors and Fonts
Actual colors and color codes of MS- and X-Windows are quite different. The VGLIB5 unified thesecolor codes from 0 to 16 as follows in MS-Windows: 0(black), 1(light blue), 2(light red), 3(lightmagenta), 4(light green), 5(light cyan), 6(yellow), 7(bright white), 8(gray), 9(blue), 10(red), 11(magenta),12(green), 13(cyan), 14(brown), 15(white), and 16(gray). When user want use more than sixteen colors,
user must select one within these 16 colors. Fonts used in MS-Windows are restricted to eight kinds:
1(Curie), 2(Helv.), 3(tms rms), 4(modern), 5(script), 6(roman), 7(system), and 8(preview). In X-windows,
color codes are: 0(black), 1(blue), 2(red), 3(magenta), 4(green), 5(cyan), 6(yellow), 7(white), 8(lightgray), 9(coral), 10(slate blue), 11(orange), 12(spring green), 13(blue violet), 14(khaki), 15(lime green),16(gray). And fonts are: 1(variable, courie), 2(12X24, Helv), 3(variable, tms rms), 4(variable, Modern),5(variable, Script), 6(variable, Roman), 7(variable, System), 8(variable, Preview).
2.5 Cartesian Coordinates and Viewports
The VGLIB5 adapts the right-hand Cartesian coordinate system as both papers and displays that havenormally left-hand and physical dot resolution (VGA, SVGA, VGA) coordinate system. User mustspecify a view port based on the system.
2.6 Device Selection
One integer IDBG(1) at the time of opening is the specific indicator of the target devices.
IDBG(1)=IGRPS*1000+IGRVTR*100+IGRPLT*10+IGRCRT, where IGRPS is for PS printer, IGRVTR
is for VRT, IGRPLT is for HP-GL Plot, and IGRCRT is for display, respectively. In the VGLIB5, IGRPS=0 (No write for PS), =1 (PS printer), IGRVTR=0 (No output for VTR), =1 (Image Memory --> VTRserver), =2 (Image Memory --> IBM/506 --> VTR), =3 (IBM/506-direct --> VTR), IGRPLT =0 (No writefor plot tape), =1 (HP-GL Plot), IGRCRT =0 (No display), =1 (PC-CRT), =2 (X-Window), =3(IBM/M506-direct), =4 (IBM/5080 file), =5 (Image Memory), =6 (Image Memory --> PC-CRT), =7(Image Memory --> IBM/M506, for IGRVTR=2).

Page 121122

2.7 Calling Sequences
All calling sequences look like the routines of Basic language. Typical examples are:C-series

G-series

M-series

P-series

PS-series

subroutine VGCIRCLE2(X,Y,R,ICOLI)
subroutine VGCLEAR
subroutine VGCLOSE
subroutine VGCOLOR4(ICOLI)
subroutine VGDISPLAY(IXPOS,IYPOS)
subroutine VGFACTOR(XF,YF)
subroutine VGFILLA(N,XX,YY,ICOLI)
subroutine VGLINE3(X1,Y1,X2,Y2,ICOLI)
subroutine VGLINE4(N,XX,YY,ICOLI)
subroutine VGNUMBER(X,Y,SIZE,FPN,THETA,M)
subroutine VGOPEN(I16,IDBG,CSIZE,PENW)
subroutine VGPASIZE(CSIZE)
subroutine VGPENTYPE(I,ILIMIT,LNT)
subroutine VGPENW(PENW)
subroutine VGROTATE(THETA,ITRX,ITRY,ITRXPS,ITRYPS,TRAXCRT,TRAYCRT)
subroutine VGREC(ISW)!VTR
subroutine VGSTBY(NFRAME)!VTRsubroutine VGSIMBOL(X,Y,SIZE,NBCD,THETA,N
subroutine VGTEXT(X,Y,HEIGHT,CHARA,THETA,NCHARA,SPACE,ICOLI)
subroutine VGUNIT(C)subroutine VGWINDOW(X1,Y1,X2,Y2)
subroutine CRTSIZE(IXMAX,IYMAX,IXCRTSIZE,IYCRTSIZE)!CRTsubroutine CRTA4A3(IX0,IY0,IX1,IY1)!CRT
subroutine CRTXYSET!CRTsubroutine PAPERFRAME(XMINCR,YMINCR,XMAXCR,YMAXCR,ICOLI)!Papersubroutine GCOLOR1(ITEXT,ICOL1,ICOL2)
subroutine GCOLOR2(ICOL1,IBGR)
subroutine GCOPY(IFUNC)
subroutine GCRLOCATE(IX,IY,MODE1)
subroutine GCRSOL(MODE1)
subroutine GGET(X1,Y1,X2,Y2,IMAGE,LENGTH)
subroutine GCRPOS(IX,IY)
subroutine GLINE(X1,Y1,X2,Y2,ICOL1,MODE,ICOL2,IFILMASK)
subroutine GPAINT(N,XX,YY,ICOL1)
subroutine GPAINT2(X,Y,ICOL1,IFILMASK,ICOL2)
subroutine GPRESET(X,Y)
subroutine GPSET(X,Y,ICOL1)
INTEGER*4 FUNCTION GPOINT(X,Y)
subroutine GPUT(X1,Y1,X2,Y2,IMAGE,LENGTH,MODE,ICOL1,ICOL2)
subroutine GPUTG3(X,Y,NCHAR,CBUF,IDEG10,ICOL1)
subroutine GPUTT3(X,Y,NCHAR,CBUF,ICOL1)
subroutine GRFLUSH!X-series only
subroutine GRFONTS(IFONT,IHEIGHT,IWIDE)
subroutine GSVIEW(IX1,IY1,IX2,IY2,NCHAR,CBUF)
subroutine GWINDOW(X1,Y1,X2,Y2)
subroutine GWTAPE(IWD)
subroutine Mouse_LR(KEYSTATE,X,Y)!check mouse click
subroutine Mouse_M(KEYSTATE,X,Y)!check mouse move
subroutine Mouse_P(X,Y)!get mouse position
subroutine Mouse_R(KEYSTATE,X,Y)!check mouse (right)
subroutine DASHP(X,Y,W)
subroutine NEWPEN(I)subroutine NUMBER(X,Y,SIZE,FPN,THETA,M)
subroutine PLOT(X,Y,I)
subroutine PLOTS(CBUF,N,LN,I16,IDBG)
subroutine PLTAPE(LN)
subroutine SYMBOL(X,Y,SIZE,NBCD,THETA,N)
subroutine PSFILLA(N,XX,YY,ICOLI)
subroutine PSPENW(PENW)
subroutine PSPLOT(X,Y,IPEN)

Page 122

123

3 Application
The VGLIB5 is used for all graphical subroutines of DS5 [17]. This DS5 (Direct-Searcher automatic
system version 5) is an integrated crystallographic program for the crystal structure analysis of organic
compounds running on PCs. Each subprogram (ORTEP3, PLUTO, ROTEN, ROTENP, Shake, etc.) in the
DS5 is chosen out eighteen programs from the DS*SYSTEM4 [18]. The ROTEN calculates the difference−6molecular potential energy using a function of the type Eij = − Aij rij + Bij exp(− C ij rij ) after rotations of
one or two molecular fragments about given direction. And the ROTENP draws calculated difference
potential-energy profiles (1D) of the ΔE and contour lines (2D) for the rotation of two molecularfragments. Figure 2 shows the subroutine ROTENP source code. Several definitions and calculation parts
are omitted for easy understanding.
C******************************************************************************SUBROUTINE ROTENP(ISWRP,CAT1,DCONT,PRSCALE,PRFACT)ROTENP...
ROTENP
C*** Calculation
ROTENP...
ROTENP
C*** QuickWin Windows='VGLIB 5.0 Graphic'
ROTENP
IDBG(1)=1011!l.u. is 55=PS, 44=PLT, 33=PC-CRT
ROTENPROTENP
C*** Open VGLIB5.lib
ROTENPCALL VGOPEN('A4R',5.0)!PENW=5.0
ROTENPROTENP
C*** Set CRT Window
ROTENPC**
Get CRT Size, Paper A4R-size
ROTENPCALL CRTSIZE(MAXPX,MAXPY,IXCRTSIZE,IYCRTSIZE) !get current CRT
ROTENPCALL CRTA4A3(MX0,MY0,MX1,MY1)!get paper MinMax ROTENPCALL GSVIEW(MX0,MY0,MX1,MY1,5,'VGLIB')!set View
dot ROTENPCALL CRTXYSET!get XMINCRT,.. cm ROTENPCALL GWINDOW(XMINCRT,YMINCRT,XMAXCRT,YMAXCRT) !cm, Window, cm
ROTENPROTENPC**
Set Color code and Draw Paper FrameROTENPICOLI=7
ROTENPCALL VGCOLOR4(ICOLI)ROTENPCALL PAPERFRAME(XMINCRT,YMINCRT,XMAXCRT,YMAXCRT,ICOLI)ROTENPROTENP
C*** Display One A4R ImageROTENPCALL MOJIWK_ROTP!X,Y axes
ROTENPROTENP
C*** Display Profile or Contour lines
ROTENP
IF(NFR.EQ.1) THEN
!1D profile
ROTENPCALL GRAPH_ROTP
ROTENP
ELSE!2D contour
ROTENPCALL CONTR_ROTP(1,361,TH1,1,LOOP1,1,361,TH2,1,LOOP2,
ROTENP*ENRGP,DCONT,ICOLI)ROTENPENDIF
ROTENPROTENP
C*** Close PS, Plot and CRT
ROTENPCALL VGCLOSE!Graphics
ROTENP
RETURNROTENPEND
ROTENPFig 2: The source code of ROTENP subprogram

Page 123

124

The HP-GL/Postscript files and display image on PCs from the ROTENP are shown in Fig. 3.

(a) HP-GL/Postscript files(b) Display on PCs

Fig 3: The output from ROTENP subprogram in DS5.

Figures 4 and 5 are the output of subroutine Shake, ORTEP3 and PLUTO in the DS5. The Shake (former
ShakePSD [19]) is an automatic general phase solver being able to handle both heavy-atom methods anddirect methods within one program, and finds out with certainty molecule fragments by a single computer
execution. This Shake checks for a heavy atom in the input chemical formula. If the molecule includes asulphur or a heavier atom, heavy-atom methods are processed to solve the Patterson function (PSL) andsearch for all remaining atoms (SEARCHER). Otherwise, the Shake executes in direct methods, calculates
normalized structure factors Eo (h) (NORMAL) and refines the phase angles φ (h) using the tangent
formula (TANGENT) or the minimal function (MINIMAL). The outputs of the Shake are 2D projection
diagrams of the molecules in the unit cell with the final R-factor and the bond distancesFig 4: The output from Shake subprogram in DS5.

Page 124125

Fig 5: The output from ORTEP3 and PLUTO subprograms in DS5.
Another examples shown in Figs. 6 and 7 are the use of mouse in interactive execution of PreLALS
workbench [20] for helical polymers. The PreLALS workbench is designed to aid users in the task ofvisualizing chemical structures using three-dimensional models, editing and the data manipulation for
WinLALS program [21] that refines the internal coordinates based on linked-atom least-squares (LALS)
method for helical polymers. It combines the views of model building (MB), analyses, and datapreparation tools with easy-to-use graphical user interfaces. User can specify an already-defined atom towhich it is attached, denoted its precursor, and giving its position in terms of its relation to its precursor in
the polymer chain by clicking the displayed atom position. Eight green atoms are the polymer tree
sequence that is clicked in order. If user clicks a certain range (ix=0-33 and iy=0-20 dots), the program
displays EXIT characters and returns to main program. When other ranges are clicked, the program
requests the Re-entry click once more.
C**************************************************************************************SUBROUTINE MB_Tree(Lchecked)
MB_Tree...
MB_TreeC
MB_Tree
CHARACTER CATMKIND*1
MB_Tree
LOGICAL
Lchecked
MB_Tree...
MB_TreeC
MB_Tree
C*** Exit or Retry
MB_Tree
200
CALL Filled_Rectangle(0,0,123,22,6,0)!6=yellow
MB_Tree
CALL GTEXTOUT(1,1,'EXIT or RETRY ?',0,4)!0=blk,4=couri,h20w16
MB_Tree
CALL Mouse_LR(KEYSTATE,IXP,IYP)
MB_TreeC
MB_TreeC**
EXIT
MB_TreeIF(IXP.LT.33.AND.IYP.LT.20) THEN
MB_Tree
ITRY=0
MB_Tree
CALL Clear_Graphic!clear display
MB_Tree
CALL XDraw_Mol!display molecule
MB_Tree...
MB_Tree
RETURN
MB_TreeC
MB_TreeC**
Retry
MB_Tree
ELSEIF(IXP.GT.65.AND.IXP.LT.105.AND.IYP.LT.15) THEN
MB_Tree
ITRY=1
MB_Tree
CALL Filled_Rectangle(0,0,35,22,6,0)!6=yellow
MB_Tree
CALL GTEXTOUT(1,1,'EXIT',0,4)!0=blk,4=couri,h20w16
MB_Tree
CALL Tree!display tree
MB_Tree
ENDIF
MB_TreeGO TO 200
MB_Tree
END
MB_TreeFig 6: Mouse clicks the tree atoms in PreLALS.

Page 125126

Fig 7: The tree output from Figure routine of PreLALS.

4 Conclusion
It is very important for the chemists or researchers that the graphic library which is able to display anddraw the graphical results of molecular structure easily exists. If a developer can develop a new graphic
software without the dependency on hardware and OS, it is very desirable since the futility of time andthe restriction on use will be eased. New developed visual graphic library VGLIB5 can help the softwaredeveloper who want to use Fortran and/or C languages, to display the scientific results on graphic
terminals, to prepare drawing files for HP-GL plotters or postscript files, and to prepare the VTR tape ofscientific animation.

Page 126

127

References
CCSL, http://www.ill.fr/dif/ccsl/html/ccsldoc.html; CCTBX, http://cci.lbl.gov/; CrysFML,
http://www-llb.cea.fr/fullweb/powder.htm; Clipper C++, http://www.yorvic.york.ac.uk/~cowtan/[2] CRYSTALS and Cameron in C++ with wxWindows, http://www.xtl.ox.ac.uk/; Jana2000 in Fortran95, http://www-xray.fzu.cz/jana/jana.html; WinGX in Clearwin,
http://www.chem.gla.ac.uk/~louis/software/wingx/, OpenGL in C/C++,
http://www.ccp14.ac.uk/ccp/web-mirrors/marchingcubefourierviewer/; Maud in Java,
http://www.ing.unitn.it/~luttero/; Java applets, http://www.univlemans.fr/enseignements/physique/02/; Tcl/Tk in Fortran, http://www.ncnr.nist.gov/xtal;
ISAW in Java, http://www.pns.anl.gov/computing/isaw/; CCP4i,
http://www.ccp4.ac.uk/martyn/martyn.html; Others (Qt, FOX, etc.),
http://www.atai.org/guitool/[3] ACA-SIGGRAPH, http://www.siggraph.org/[4] GKS, GKS-3D, a) International Organization for Standardization. The Graphical Kernel System(GKS). Technical Report ISO 7942, ISO Geneva, 1985. b) International Organization for Standardization. The Graphical Kernel System for Three Dimensions (GKS-3D). Technical Report ISO
8805, ISO Geneva, 1987. c) International Organization for Standardization. The Graphical Kernel
System (GKS) language bindings -- Part 1: Fortran. Technical Report ISO 8651-1, ISO Geneva,
1988. d) International Organization for Standardization. The Graphical Kernel System for Three
Dimensions (GKS-3D) language bindings -- Part 1: Fortran. Technical Report ISO 8806-1, ISO
Geneva, 1988.
[5] PHIGS, PEX, a) Getting Started with SunPHIGS- PHIGS Overview, Sun related notes, October 4,
1991. b) http://www.itl.nist.gov/iaui/vvrg/cugini/pvt/hy-std.html c)
http://www.faqs.org/faqs/graphics/pex-faq/[6] Postscript, http://www.adobe.com/products/postscript/main.html[7] X-Windows, http://www.x.org/[8] OpenGL http://www.opengl.org/ and http://www.sgi.com/products/software/opengl/[9] PGPLOT, http://www.astro.caltech.edu/~tjp/pgplot/[10] Gnuplot, http://www.gnuplot.info/[11] Alias, http://www.alias.com/eng/index.shtml[12] AVS, http://www.avs.com/index_wf.html[13] Okada, K. & Koyama, H., (1991). J. Appl. Cryst., 24(6), 1067-1070.
[14] Okada, S. & Okada, K. (1996). Comput. Chem., 20(2), 267-270.
[15] Okada, K. & Okada, S. (1997). J. Chem. Inf. Comput. Sci., 37(3), 522-528.
[16] Okada, S. & Okada, K. (2000). Z. Kristallogr., 215, 131-143.
[17] Okada, K. & Boochathum, P. (2005). J. Appl. Cryst., 38, 842-846.
[18] Okada, S. & Okada, K., (2000). Z. Kristallogr., 215, 131-143.
[19] Okada, S. & Okada, K., (2000). J. Appl. Cryst., 33(2), 406-414.
[20] Okada, K., Boochathum, P., Noguchi, K., Okuyama, K. & Katsube, Y. (2005) J. Comput. Aided
Chem., 6, 12-22.
[21] Okada, K., Noguchi, K., Okuyama, K. & Arnott, S., (2003). Comput. Biol. Chem., 27(3), 265-285.
[1]Page 127

128

Notes on the calculation of the derivatives for least-squares crystal
structure refinement(updated 6th June 2008)

Riccardo Spagna
Istituto di Cristallografia - CNR, Sede di Monterotondo, Area della Ricerca di Roma 1, Via Salaria Km.
29, 00016 Monterotondo Stazione (Roma), Italy, E-mail: riccardo.spagna@ic.cnr.it ; WWW:
http://www.ic.cnr.it/spagna.php

I. Introduction
This is not an original paper on least squares methods. This is only a contribution to the crystallographic
community on well established algorithms to calculate derivatives useful for crystal structure refinement
using the least squares methods. Almost all of the equations collected here can be found in the literature.
The aim of this work is to help the next generation of crystallographers who wants to face with computing
problems by least squares methods: they can find here many of the things they need.
All the algorithms described here are implemented in the SIR package (Burla, et al., 2005)

II. Background
The least-squares method is the refinement method most used for small-medium size molecules. In thefollowing, we recall briefly the procedure commonly used (see also Giacovazzo, 2002).
The structure factor may be written as:
Fh = ∑ f j exp(2πi ⋅ h ⋅ rj )jwhere fj is the scattering factor of the j-th atom in the unit cell at the sinθh value of h (=hkl), including the
exponential term for the atomic thermal motion; rj are the positional parameters (x,y,z) of the j-th atom.
To find the best atomic parameters describing the structure, the function being minimized by the leastsquares method is the residual:(

M = ∑ wh Fh2
oss− K 2 Fhh

) = ∑ w (ΔF )
2

2
calc

2

h

2

h

h

where |Fh|2oss is the observed intensity and wh is weights to be assigned to each of them.
The theory of least squares suggests for wh the relationships:
wh ≈

1

σ h2

Many authors have studied the problem concerning the choice of the weights and considered functions
based on the observations or on a mix of these with the estimated standard uncertainty σh . Examples ofthese weighting schemes were suggested by Cruickshank (1965), i.e.
wh = 1(a + b F + c F ) ,2hhPage 128

129

and by Sheldrick, used in the program SHELX:
wh = 1 2,
σ h + bP + cP 2
where2
F 2 + 2 Fcalc
P = oss
3

(

)

(

)

See also Spagna & Camalli, (1999) for an extensive analysis of weighting schemes.
Because the |Fh|2calc values are not linear functions of the m atomic parameters rj, approximate values are
obtained by expanding in a Taylor series around rj, and truncating after the first term:
2

⎛
⎧⎪ 2
⎫⎪ ⎞
∂ Fh calc2
M = ∑ wh ⎜ Fh oss − K 2 ⎨ Fh calc + ∑ 2 Fh calcΔr j ⎬ ⎟ =
⎜
∂r j
⎪⎩
⎪⎭ ⎟⎠
h
j
⎝
2

⎛
⎞
∂ Fh calc= ∑ wh ⎜ ΔF 2 h − ∑ K 2 2 Fh calcΔr j ⎟
⎜
⎟
∂r j
h
j
⎝
⎠
M is a minimum with respect to the Δri if the derivates ∂M ∂Δri are zero:⎛⎞⎛∂ Fh calc∂ Fh calc ⎞∂M⎟=0Δr j ⎟⎜ K 2 2 Fh calc
= ∑ wh ⎜ ΔF 2 h − ∑ K 2 2 Fh calc
⎜
⎟⎜
⎟
∂
∂Δri
∂
r
r
h
j
j
i
⎝
⎠⎝
⎠

for i=1,…,m

and the normal equations are obtained:
⎛
⎞⎛
⎞
∂ Fh
∂ Fh
∂ Fh
∑h wh ⎜⎜ ∑j K 2 2 Fh calc ∂r calc ⎟⎟⎜⎜ K 2 2 Fh calc ∂r calc Δri ⎟⎟ = ∑h wh ΔF 2 h K 2 2 Fh calc ∂r calc
j
i
i
⎝
⎠⎝
⎠
Solving these equations, the shifts Δri are obtained and applied to the parameters ri . Several cycles of refinement are required to achieve convergence.
Statistical descriptors (Schwarzenbach et al, 1989) have to be considered for evaluating the refinement, as
the classical R factor∑h Fh oss − (K Fh )calc
R=,∑ Fh osshthe weighted wR factor∑ w (FhwR =2− (K Fh ) calc
2

oss

h

h

(

∑ wh Fh

oss

2

,

)

2

2

)

h

the goodness of fit (where n-m is the number of degrees of freedom, n = number of observations and m =number of variables of the model)S=∑ w (Fh2h− (K Fh ) calc
2

oss

h

)

2

(n − m )In some case (for example when the data are bad or not enough), we can introduce some restraints (thistechnique increases the number of observations). The function being minimized becomes:(

M = ∑ wh Fh
h

2
oss

− K 2 Fh) + ∑ w (g − g ) ,
2

2
calc

2

q

q

qo

q

where gqo is the function of the q-th restraint, gq is its optimal value and wq is the weight.
The approximate values are obtained expanding the gq’s in Taylor series.
Page 129

130

2

2

⎛
⎧⎪ 2
⎫⎪ ⎞
⎛
⎞
∂ Fh calc∂g qo
2
Δr j ⎬ ⎟ + ∑ wq ⎜ g q − g qo − ∑Δr j ⎟ =M = ∑ wh ⎜ Fh oss − K 2 ⎨ Fh calc + ∑ 2 Fh calc
⎜
⎟
⎜
∂r j
∂r j
⎪⎩
⎪⎭ ⎟⎠
h
j
q
j
⎝
⎠
⎝
2

⎛
⎛
⎞
⎞
∂ Fh
∂g qo
∑h wh ⎜⎜ ΔF 2 h − ∑j K 2 2 Fh calc ∂r calc Δr j ⎟⎟ + ∑q wq ⎜⎜ Δg − ∑j ∂r Δr j ⎟⎟
j
j
⎝
⎝
⎠
⎠

2

Setting to zero the derivates of M with respect to the Δri ,⎛⎞⎛⎛⎞⎞ ∂g qo
∂ Fh
∂ Fh
∂g qo
∑h wh ⎜⎜ ΔF 2 h − ∑j K 2 2 Fh calc ∂r calc Δr j ⎟⎟⎜⎜ K 2 2 Fh calc ∂r calc ⎟⎟ + ∑q wq ⎜⎜ Δg − ∑j ∂r Δr j ⎟⎟ ∂r = 0
j
i
j
⎝
⎠⎝
⎝
⎠
⎠ i
the normal equations are obtained:⎧⎪⎛ ∂g qo ⎞ ∂g qo ⎫⎪⎛∂ Fh calc ⎞∂ Fh calc ⎞⎛ 2
2
⎟
⎜
⎟
⎜
⎟
⎜
K
F
w
w
K
F
Δr =
2
2
+
⎨∑ h ⎜ ∑h calch calcq⎜∑⎟ ∂r ⎬⎪ i
⎟ ∑
⎟⎜
r
r
r
∂
∂
∂
j
q
j
⎪⎩ h
j
i
i
j
⎠
⎝
⎠
⎠⎝
⎝
⎭
∂ Fh calc∂g qo= ∑ wh ΔF 2 h K 2 2 Fh calc
+ ∑ wq Δg
∂ri
∂ri
h
q
The system of normal equations can be written
MΔr = b ,where M is the n2 symmetric normal matrix, Δr is the unknown shift and b is the know term. Δr and b are
vectors of order n. The solution Δr is obtained by inverting the normal matrix and by multiplying it by theb vector:Δr = bM −1
The diagonal terms M-1ii provide an approximate value of the standard uncertainties of the variables ri:
such variables ri can be normalized by dividing them by the quantity Mii1/2 .
The corresponding normalized matrix is obtained by replacing the Mij elements by:
M ij
M ij' =
M ii M jj
The normalized M’ij value corresponds to the correlation coefficient between the parameters ri and rj andvalues less than unity are normally obtained. Values greater than unity show evidence of strong correlation between the i and j parameters.

III. Structure factor derivatives
For a crystal structure with s symmetry operators of the space group and m symmetry-independent atoms,
a generalized form of the structure factor (the subscript calc is omitted) is:1) for isotropic thermal motion:⎞⎛⎡ B i ⎛ 2 sin ϑh ⎞ 2 ⎤⎜Fh = ∑ ∑ f i exp(2πi ⋅ h ⋅ ri )exp ⎢- ⎜⎟ ⎥ (occi )⎟ ,⎟⎜n =1, s i =1, m⎢⎣ 4 ⎝ λ ⎠ ⎥⎦⎠⎝2) for anisotropic thermal motion:⎛⎞⎡⎤
Fh = ∑ ⎜ ∑ f i exp(2πi ⋅ h ⋅ ri )exp ⎢− ∑∑ β ij hi h j ⎥ (occi )⎟⎜⎟n =1, s⎝ i =1, m
⎣ i j
⎦
⎠

Page 130

131

The first sum is over the s symmetry operators and the inner sum is over the m atoms; occi is the site occupation of i-th atom (normally = 1.0, different values are related to possible vacancies in the crystal, orto special positions of the atom);2
B i = 8π 2 u i ,is the isotropic T.F (thermal factor) (where <ui2> is the mean squares amplitude of the thermal vibrationof the atom).
Writing the reciprocal of the interplanar spacing dh:
2

2

⎛ 1 ⎞
⎛ 2 sin ϑh ⎞⎜⎟ = ⎜⎜ ⎟⎟ = h 2 a *2 + k 2 b *2 +l 2 c *2 +2hka * b * cos γ * +2hla * c * cos β * +2klb * c * cos α * we
⎝ λ ⎠⎝ dh ⎠
can represent the T.F. in the general temperature factor expression
T .F . = exp − β11 h 2 + β 22 k 2 + β 33 l 2 + β 12 hk + β 13 hl + β 23 kl ,where βij are the six independent components of the anisotropic thermal motion described as an ellipsoid.

[()]

The anisotropic thermal parameter can be written also as function on Uij (parameters expressed in termsof mean-squares amplitudes of vibration in Å) or on Bij (in the same units as the conventional isotropic
thermal parameter B):⎡⎤
T .F . = exp ⎢− 2π 2 ∑∑ U ij hi h j a i * a j *⎥ ,
i
j
⎣
⎦
⎡ 1
⎤
T .F . = exp ⎢− ∑∑ Bij hi h j a i * a j *⎥⎣ 4 i j⎦In the following, we consider the βij parameters.
The Fh. may be written as:
Fh = Ah + iBh = Fh exp(iφ )Fh = Ah cos φ + Bh sin φ

Fh =

2

Ah + Bh

(3,1)

2

(3,2)

Hence, if pj is a parameter of the j-th atom, deriving the equation (3,1), gives
∂ Fh
∂B
∂A
∂φ
= h cos φ + h sin φ + (− Ah sin φ + Bh cos φ )
∂p j
∂p j
∂p j
∂p j
It is easy to see that(− Ah sin φ + Bh cos φ ) = 0

Page 131132

Thus,
∂ Fh

∂B
∂Ah
(3,3)
cos φ + h sin φ
∂p j
∂p j
∂p j
Of course, we can arrive to the same result by deriving the equation (3,2). We obtain∂ Fh
A ∂Ah Bh ∂Bh∂A∂B ⎞ 2 Ah ∂Ah 2 Bh ∂Bh
1 ⎛⎜
+
= h
+
=
2 Ah h + 2 Bh h ⎟ =⎟⎜Fh ∂p j Fh ∂p j
∂p j
∂p j ⎠ 2 Fh ∂p j 2 Fh ∂p j
∂p j
2 Fh ⎝=

ReplacingAh= cos φFhBh= sin φFhgives the previous relationship (3,3).
Accordingly
2
⎞
⎛ ∂A
∂ Fh
∂ Fh
∂A
∂B
∂B
= 2 Fh= 2 Fh ⎜ h cos φ + h sin φ ⎟ = 2 Ah h + 2 Bh h
⎟
⎜ ∂p
∂p j
∂p j
∂p j
∂p j
∂p j
⎠
⎝ j
We may obtain (3,4) directly from the relationship:222
Fh = Ah + Bh

(

(3,4)

)

We calculate the explicit expressions of the Fh derivatives with respect to the unknown variables xj , yj, zj,
Bj, β(11)j β(12)j β(13)j.., occj and overall parameters K and B(overall), considering isotropic T.F. and for sakeof simplicity omitting the explicit indication of the loop on symmetry operators
2⎡⎛ sin ϑh ⎞ ⎤Ah = ∑ f j cos(2π ⋅ h ⋅ rj )exp ⎢- B j ⎜⎟ ⎥ (occ j ) = ∑ A j⎝ λ ⎠ ⎦⎥jj⎣⎢
2⎡
⎛ sin ϑh ⎞ ⎤Bh = ∑ f j sin (2π ⋅ h ⋅ rj )exp ⎢- B j ⎜⎟ ⎥ (occ j ) = ∑ B j⎝ λ ⎠ ⎥⎦
jj⎢⎣

Atomic coordinates xj :2⎡
∂A j
⎛ sin ϑh ⎞ ⎤= (− 2πh ) f j sin (2π ⋅ h ⋅ rj )exp ⎢- B j ⎜⎟ ⎥ (occ j ) = −2πhB j∂x j⎝ λ ⎠ ⎥⎦
⎢⎣
2
⎡
∂B j
⎛ sin ϑh ⎞ ⎤= (2πh ) f j cos(2π ⋅ h ⋅ rj )exp ⎢- B j ⎜⎟ ⎥ (occ j ) = 2πhA j∂x j⎝ λ ⎠ ⎦⎥⎣⎢
Page 132

133

∂ Fh

=

∂x j

∂Ah
∂B
A ∂Ah Bh ∂BhA ∂A j Bh ∂B j
A
B
+
= h
+
cos φ + h sin φ = h= h (− 2πhB j ) + h (2πhA j )
∂x j
∂x j
Fh ∂x jFh ∂x jFh ∂x jFh ∂x jFhFh2⎡
⎛ sin ϑh ⎞ ⎤= (− 2πk ) f j sin (2π ⋅ h ⋅ rj )exp ⎢- B j ⎜⎟ ⎥ (occ j ) = −2πkB j∂y j⎝ λ ⎠ ⎦⎥
⎣⎢

∂A j

∂B j

⎡

2

⎤

⎛ sin ϑ ⎞= (2πk ) f cos(2π ⋅ h ⋅ r )exp ⎢- B ⎜⎟ ⎥ (occ ) = 2πkAh

⎝ λ ⎠ ⎦⎥
⎣⎢
∂ Fh
∂A
A
∂B
B
= h cos φ + h sin φ = h (− 2πkB j ) + h (2πkA j )
∂y j
∂y j
Fh
∂y j
Fh
∂y j

j

j

j

j

j

2
⎡
⎛ sin ϑh ⎞ ⎤= (− 2πl ) f j sin (2π ⋅ h ⋅ rj )exp ⎢- B j ⎜⎟ ⎥ (occ j ) = −2πlB j∂z j⎝ λ ⎠ ⎥⎦
⎢⎣
2
⎡
∂B j
⎛ sin ϑh ⎞ ⎤= (2πl ) f j cos(2π ⋅ h ⋅ rj )exp ⎢- B j ⎜⎟ ⎥ (occ j ) = 2πlA j∂z j⎝ λ ⎠ ⎥⎦
⎢⎣
∂ Fh
∂A
A
∂B
B
= h cos φ + h sin φ = h (− 2πlB j ) + h (2πlA j )
∂z j
∂z j
Fh
∂z j
Fh

∂A j

Atomic isotropic thermal parameters Bj :
2
2
2
⎡
∂A j
⎛ sin ϑh ⎞⎛ sin ϑh ⎞ ⎤⎛ sin ϑh ⎞= −⎜⎟ f j cos(2π ⋅ h ⋅ rj )exp ⎢- B j ⎜⎟ Aj⎟ ⎥ (occ j ) = −⎜
∂B j
⎝ λ ⎠
⎝ λ ⎠ ⎥⎦
⎝ λ ⎠
⎢⎣
2
2
2
⎡
⎛ sin ϑh ⎞⎛ sin ϑh ⎞ ⎤⎛ sin ϑh ⎞= −⎜⎟ f j sin (2π ⋅ h ⋅ rj )exp ⎢- B j ⎜⎟ ⎥ (occ j ) = −⎜
⎟ Bj
∂B j
⎝ λ ⎠
⎝ λ ⎠ ⎦⎥
⎝ λ ⎠
⎣⎢

∂B j

∂ Fh
∂B j

=

2
⎤ Bh ⎡ ⎛ sin ϑh ⎞ 2 ⎤∂Ah∂BA ⎡ ⎛ sin ϑh ⎞A
cos φ + h sin φ = h ⎢− ⎜⎟ j⎥+
⎟ Bj ⎥
⎢− ⎜
∂B j
∂B j
Fh ⎣⎢ ⎝ λ ⎠
F
λ
⎝
⎠
h ⎣
⎢
⎦⎥
⎦⎥

Atomic anisotropic thermal parameters βij :∂A j= (- h 2 ) f j cos(2π ⋅ h ⋅ rj )exp[- hβ ij h ](occ j ) = (- h 2 )A j
∂β (11) j∂B j∂β (11) j∂ Fh∂β (11) j∂A j∂β (12 ) j∂B j∂β (12 ) j∂ Fh∂β (12 ) j

[

( )

]

( )

= - h 2 f j sin (2π ⋅ h ⋅ rj )exp - hβij h (occ j ) = - h 2 B j=∂Ah∂β (11) jcos φ +[( ) ][( ) ]A∂BhB
sin φ = h - h 2 A j + h - h 2 B jFh∂β (11) j
Fh[]= (- hk ) f j cos(2π ⋅ h ⋅ rj )exp - hβ ij h (occ j ) = (- hk )A j[]

= (- hk ) f j sin (2π ⋅ h ⋅ rj )exp hβ ij h (occ j ) = (- hk )B j=∂Ah
∂β (12 ) j

cos φ +∂Bh∂β (12 ) j

sin φ =

[

]

[

Ah
B
(- hk )A j + h (- hk )B j
FhFhPage 133

]
134

∂A j
∂β (13 ) j∂B j∂β (13 ) j∂ Fh∂β (13 ) j∂A j∂β (22 ) j∂B j∂β (22 ) j∂ Fh∂β (22 ) j∂A j∂β (23 ) j∂B j∂β (23 ) j∂ Fh∂β (23 ) j∂A j∂β (33 ) j∂B j∂β (33 ) j∂ Fh∂β (33 ) j

[

]

[

]

= (- hl ) f j cos(2π ⋅ h ⋅ rj )exp - hβ ij h (occ j ) = (- hl )A j
= (- hl ) f j sin (2π ⋅ h ⋅ rj )exp - hβ ij h (occ j ) = (- hl )B j=∂Ah
∂β (13 ) j

cos φ +∂Bh∂β (13 ) j

sin φ =

[

]

[

Ah
B
(- hl )A j + h (- hl )B j
Fh
Fh

( )

[

]

( )

( )

[

]

( )

]

= - k 2 f j cos(2π ⋅ h ⋅ rj )exp - hβ ij h (occ j ) = - k 2 A j= - k 2 f j sin (2π ⋅ h ⋅ rj )exp - hβ ij h (occ j ) = - k 2 B j=∂Ah∂β (22 ) j

cos φ +∂Bh∂β (22 ) j

sin φ =[( ) ][( ) ]AhB- k 2 Aj + h - k 2 B j
Fh
Fh

[

]

[

]

= (- kl ) f j cos(2π ⋅ h ⋅ rj )exp - hβ ij h (occ j ) = (- kl )A j
= (- kl ) f j sin (2π ⋅ h ⋅ rj )exp - hβ ij h (occ j ) = (- kl )B j=∂Ah
∂β (23 ) j

cos φ +∂Bh∂β (23) j

sin φ =

[

]

[

Ah
B
(- kl )A j + h (- kl )B j
Fh
Fh

( )

[

]

( )

( )

[

]

( )

]

= - l 2 f j cos(2π ⋅ h ⋅ rj )exp - hβ ij h (occ j ) = - l 2 A j= - l 2 f j sin (2π ⋅ h ⋅ rj )exp - hβ ij h (occ j ) = - l 2 B j=∂Ah∂β (33 ) j

cos φ +∂Bh∂β (33 ) j

sin φ =[( ) ][( ) ]AhB- l 2 Aj + h - l 2 B j
FhFhSite occupation factors occj :
∂A j
Aj
=
∂occ j occ j∂B j∂occ j∂ Fh∂occ j

=
=

Bj
occ j
∂Ah
∂Bh
A Aj
B Bj
+ h
cos φ +
sin φ = h∂occ j∂occ jFh occ j Fh occ jOverall isotropic vibrations B(overall):2∂ Fh⎛ sin ϑh ⎞
= -⎜
⎟ Fh
∂B(overall ) ⎝ λ ⎠Page 134

135

All the previous derivatives have to be multiplied by (wh K2), where K is the factor to put Fcalc on thesame scale as Fobs , and wh are the weights.
Overall scale factor K:∂ Fh= wh Fhwh∂K
and2∂K 2 Fh2= wh 2 K Fh
wh∂K

IV. Effect of anomalous scattering

Under particular conditions, the atomic scattering factor f0, value defined away from the absorption edge,
is modified by introducing two quantities, one real ∆f’ (with the same direction of f0) and one imaginary∆f” with a phase angle of 90° respect to the real component, called real and imaginary dispersion correction respectively. In these case the scattering is called anomalous:f = f 0 + Δf '+iΔf ' 'Therefore, the real correction is added to the normal scattering factor:
2⎡⎛ sin ϑh ⎞ ⎤Ah = ∑ ( f 0 + Δf ' ) j cos(2π ⋅ h ⋅ rj )exp ⎢- B j ⎜⎟ ⎥ (occ j ) = ∑ A j⎝ λ ⎠ ⎥⎦jj⎢⎣
2⎡
⎛ sin ϑh ⎞ ⎤Bh = ∑ ( f 0 + Δf ' ) j sin (2π ⋅ h ⋅ rj )exp ⎢- B j ⎜⎟ ⎥ (occ j ) = ∑ B j⎝ λ ⎠ ⎥⎦
jj⎢⎣
while for the imaginary correction i∆f” we define the structure factor contributions:2⎡
Δf ' '⎛ sin ϑ h ⎞ ⎤C h = ∑ Δf ' ' j cos 2π ⋅ h ⋅ rj exp ⎢- B j ⎜Aj⎟ ⎥ occ j = ∑ C j = ∑⎝ λ ⎠ ⎦⎥jjj ( f 0 + Δf ' )
⎣⎢

(

)

(

)

2
⎡
Δf ' '⎛ sin ϑ h ⎞ ⎤Dh = ∑ Δf ' ' j sin (2π ⋅ h ⋅ rj )exp ⎢- B j ⎜Bj⎟ ⎥ (occ j ) = ∑ D j = ∑⎝ λ ⎠ ⎦⎥jjj ( f 0 +Δ f ' )⎣⎢Page 135

136

Under this condition, the Fh. may be written as:

Fh = ( Ah − Dh ) + i (Bh + C h )tan φ h =(Bh + C h )( Ah − Dh )⎛⎞⎛⎞Δf ' '
Δf ' 'Fh = ( Ah − Dh ) cos φ h + (Bh + C h ) sin φ h = ⎜⎜ Ah − ∑B j ⎟⎟ cos φ h + ⎜⎜ Bh + ∑A j ⎟⎟ sin φ hj ( f0 + f ')j ( f0 + f ')
⎝
⎠
⎝
⎠
⎛
⎞
∂ Fh ⎛ ∂Ah ∂Dh ⎞⎟ cos φ + ⎜ ∂Bh + ∂C h ⎟ sin φ
−
=⎜
⎜ ∂p
⎟
∂p j ⎜⎝ ∂p j ∂p j ⎟⎠⎝ j ∂p j ⎠and F–h:F− h = ( Ah + Dh ) − i (Bh − C h )(− Bh + C h )( Ah + Dh )F− h = ( Ah + Dh ) cos φ − h + (− Bh + C h )sin φ −htan φ − h =The derivatives of Fh and F-h are calculated respect to pj considering the general equations:⎞⎛∂ Fh ⎛ ∂Ah ∂Dh ⎞⎟ cos φ + ⎜ ∂Bh + ∂C h ⎟ sin φ
=⎜
−
⎟
⎜ ∂p
∂p j ⎜⎝ ∂p j ∂p j ⎟⎠⎝ j ∂p j ⎠For h:For –h:______________________________

Atomic coordinates xj :∂A j
= −2πhB j
∂x j

∂x j

∂B j

∂B j

∂x j
∂C j
∂x j

∂A j

= 2πhA j=∂x j

Δf ' ' ∂A j
Δf ' '= −2πhBj =( f 0 + Δf ' ) ∂x j
( f 0 + Δf ' )

∂C j
∂x j

= 2πhB j= 2πhA j= 2πh

Δf ' '
B j = 2πhD j( f 0 + Δf ' )= 2πh

Δf ' '
A j = 2πhC j( f 0 + Δf ' )= −2πhD j
∂D j
∂x j

=

∂D j

Δf ' ' ∂B j
Δf ' '= 2πh
Aj =( f 0 + Δf ' ) ∂x j
( f 0 + Δf ' )∂x j= 2πhC j∂ Fh∂x j= 2πh(− B j − C j )cos φ h + 2πh(A j − D j )sin φ h∂ F− h∂x j= 2πh(B j − C j )cos φ − h + 2πh(A j + D j )sin φ − hPage 136

137

Atomic isotropic thermal parameters Bj
2∂A j⎛ sin ϑh ⎞
= −⎜
⎟ Aj
∂B j
⎝ λ ⎠

∂A j

⎛ sin ϑh ⎞
= −⎜
⎟ Aj
∂B j
⎝ λ ⎠

2

∂B j

⎛ sin ϑh ⎞
= −⎜
⎟ Bj
∂B j
⎝ λ ⎠

2

∂B j

2

∂C j

⎛ sin ϑh ⎞
= −⎜
⎟ Cj
∂B j
⎝ λ ⎠

2

∂C j

2

∂D j

2

∂D j

2

⎛ sin ϑh ⎞
= +⎜
⎟ Bj
∂B j
⎝ λ ⎠
⎛ sin ϑh ⎞
= −⎜
⎟ Cj
∂B j
⎝ λ ⎠

⎛ sin ϑh ⎞
= −⎜
⎟ Dj
∂B j
⎝ λ ⎠

⎛ sin ϑh ⎞
= +⎜
⎟ Dj
∂B j
⎝ λ ⎠

2

∂ Fh

⎛ sin ϑh ⎞= −⎜⎟ {(A j − D j )cos φ h + (B j + C j )sin φ h }
∂B j
⎝ λ ⎠
∂ F− h∂B j
Atomic anisotropic thermal parameters βij :∂A j= (- h 2 )A j
∂β (11) j∂B j∂β (11) j∂C j∂β (11) j∂D j∂β (11) j∂ Fh∂β (11) j

2⎛ sin ϑh ⎞= −⎜⎟ {(A j + D j )cos φ −h + (− B j + C j )sin φ − h }
⎝ λ ⎠
∂A j
∂β (11) j
∂B j

( )

= - h2 B j∂β (11) j
∂C j

( )

= - h2 C j∂β (11) j
∂D j

( )

= - h2 D j∂β (11) j( )= - h2 Aj( )= h2 B j( )= - h2 C j( )= h2 D j( )= - h 2 {(A j − D j )cos φ h + (B j + C j )sin φ h }∂ F− h∂β (11) j( )= - h 2 {(A j + D j )cos φ − h + (− B j + C j )sin φ − h }and so on for the other parameters βij

Page 137

138

Site occupation factors occj :
∂A j
Aj
=
∂occ j occ j∂occ j

∂B j

Bj

∂B j

occ j

∂occ j

Cj

∂C j

occ j

∂occ j

Dj

∂D j

occ j

∂occ j∂occ j∂C j∂occ j∂D j∂occ j∂ Fh∂occ j

=
=
=

=

∂A j

=

Aj
occ j

=−
=

Bj
occ j

Cj
occ j

=−

Dj
occ j

1
{(A j − D j )cos φh + (B j + C j )sin φh }occ j
∂ F− h∂occ j=

1{(A j + D j )cos φ−h + (− B j + C j )sin φ−h }occ jPage 138

139

V. Inclusion of secondary extinction correction

The integrated intensity of a diffracted beam in the kinematical approximation is given by:2
I h = I 0 K 1 K 2 LPTY Fh
Where:
I0 e’ l’intensità del fascio incidente2⎛ e2 ⎞
K 1 = ⎜⎜ 2 ⎟⎟ takes into account the universal constants in the Thomson equation ;⎝ mc ⎠K 2 =Vx
λ 3 (Vx is the volume of the crystal and V is the volume of the unit cell).
2
V1
is the Lorentz coefficientsin 2θ
P is the polarization correction
T is the absorption correctionL=−1⎡ ⎛ 2 p2 ⎞ ⎤ 2⎟⎟ X 0 ⎥is the extinction coefficient (where p n = 1 + cos 2n 2θ is the polarization correcY = ⎢1 + ⎜⎜⎣ ⎝ p1 ⎠ ⎦tion).
|Fh | is the structure factor.

We may write the the integrated intensity:224⎛ e2 ⎞ ⎛ V⎞⎛ 1 ⎞⎛ cos 2θ M + cos 2θ ⎞ ⎡ ⎛ 2 p 2 ⎞ ⎤⎟⎟T ⎢1 + ⎜⎜⎟⎟ X 0 ⎥I h = I 0 ⎜⎜ 2 ⎟⎟ ⎜ x2 λ3 ⎟⎜⎟⎜⎜2
2⎠⎝ sin 2θ ⎠⎝ cos 2θ M + cos 2θ ⎠ ⎣ ⎝ p1 ⎠ ⎦⎝ mc ⎠ ⎝ V

−1

2

Fh

2

We report the procedure to refine the extinction parameter following A.C. Larson (1969) .
The structure factor corrected for extinction factor is defined as:
−1

(

)

−1
⎛
p ⎞ 4
2
4
Fc * = Fc ⎜⎜1 + 2r * Q0T 2 ⎟⎟ = Fc 1 + 2r * Fc δp
1 ⎠⎝Where r* is a function of the extinction factor and δ is:2

δ=

1 cos 2 2θ M + cos 4 2θ⎜⎟t
V 2 ⎜⎝ mc 2 ⎟⎠ sin 2θ cos 2 2θ M + cos 2 2θλ3 ⎛ e 2 ⎞ _Page 139

The Thompson differential cross section σ for the charged particles (area/solid angle) is⎛ q2 ⎞σ = ⎜⎜ 2 ⎟⎟⎝ mc ⎠

2

where q is the charge per particle, and m is the mass per particle. Note that this is the square of theclassical radius of a point particle of mass m and charge q. For an electron, the differential cross section isthen:2
σ = 7.94079...x10 −26 cm sr__and set t = 1.0 ( t takes into account of the transmission factor and of the Vx volume of the crystal), δ may
be written:
λ3 1 cos 2 2θ M + cos 4 2θ
δ = 0.0794 2
V sin 2θ cos 2 2θ M + cos 2 2θNow, rewrite the relationship for the structure factor and considering the scale factor K, we can write:()⎛
λ3 1 pol1 + cos 4 2θ ⎞2⎜⎟⎟
Fc * = K Fc 1 + 2r * Fc δ
= K Fc ⎜1 + 2r * Fc 0.0794 2
2
sin
2
θ
V
pol
1
cos
2
θ
+
⎝
⎠
In SHELX programs this expression is approximated by:
−1

2

4

1 ⎞
2
⎛
Fc * = K Fc ⎜1 + 0.001r * Fc λ3⎟
sin 2θ ⎠⎝−1

4

Now, we calculate the derivative of |Fc*| respect to |Fc|:
12
2
1 + 2r * Fc δ − Fc (4r * Fc δ )1 + r * Fc δ
∂ Fc *
4
=K
=K
5
5
2
2
∂ Fc
4
4
1 + 2r * Fc δ
1 + 2r * Fc δ

(

)

(

)

(

(

The partial derivatives become:Atomic parameters:(1 + r * F δ ) ∂ F=K=∂ F ∂p∂p(1 + 2r * F δ ) ∂p

∂ Fc *

2∂ Fc * ∂ Fc

i

c

c

c

2

i

c

5

4

i

Overall scale factor K:∂ Fc *∂K(2= Fc 1 + 2r * Fc δ

)

−1

4

Extiction parameter:∂ Fc *

(

)

−5
1
2
3
4
= − K Fc δ 1 + 2r * Fc δ
2∂r *Page 140

)
)

−1

4

VI. Refinement of Twinned Structures

Here we consider only twins by hemihedry (a particular case of merohedry) defined as regular aggregatesconsisting of only two microscopic domains of the same species whose lattices differ in orientation. In
this case, we need an orientation matrix, R (the twinning law) and the fractional contribution, x ,of thesmaller domain. Yeates (1997) described a method to estimate the twinning fraction. For more information on twinned structures please see Giacovazzo, (1992) and also visit the web site:
http://www.lcm3b.uhp-nancy.fr/mathcryst/twins.htm
For the refinement of twinned structures, see also Herbest-Irmer & Sheldrick, (1998).
We follow the procedure as described by H D Flack,(1983), considering the enantiomorph-polarity parameter x a special case of twinned crystal.
Fh , x2

2= (1 − x) Fh + x FRh

2

Rewrite the relationships of the structure factors:
Fh = Ah + iBh = Fh exp(iφ )Fh = Ah cos φ + Bh sin φ
andFRh = ARh + iB Rh = FRh exp(iφ )FRh = ARh cos φ + BRh sin φ
The function being minimized 2by the least-squares method becomes:
2
2
2
2
2 2
M = ∑ wh Fh oss − K 2 Fh , x= ∑ wh Fh oss − K 2 (1 − x) Fh + x FRh
h

)

(

[

(

])

h

[

2

]

⎛
⎞
⎡
∂ Fh
∂ FRh ⎤22
2
M = ∑ wh ⎜ Fh oss − K 2 (1 − x) Fh + x FRh − K 2 ∑ ⎢(1 − x)2 Fh
Δr j ⎟ =+ x 2 FRh
⎥
⎜
⎟
∂r j
∂r j ⎦⎥
h
j ⎣
⎢
⎝
⎠
⎛
⎞
⎡
∂ Fh
∂ FRh ⎤
Δr
= ∑ wh ⎜ ΔF 2 h , x − K 2 ∑ ⎢(1 − x)2 Fh+ x 2 FRh⎥ j ⎟⎟
⎜
r
r
∂
∂
h
j ⎢
j
j ⎥
⎦
⎣
⎝
⎠

2

Setting to zero the derivates of M with respect to the Δri .
⎛⎞⎡∂ FRh ⎤∂ Fh∂M
Δr j ⎟+ x 2 FRh= ∑ wh ⎜ ΔF 2 h , x − K 2 ∑ ⎢(1 − x)2 Fh⎥⎜⎟∂r j ⎥⎦
∂r j
∂Δri
h
j ⎢
⎣
⎝
⎠
⎡
∂ FRh ⎤∂ Fh
K 2 ⎢(1 − x)2 Fh+ x 2 FRh
⎥=0
∂ri ⎦
∂ri
⎣

the normal equations are obtained:⎛ ⎡⎞ 2⎡∂ FRh ⎤∂ FRh ⎤
∂ Fh
∂ Fh
2⎜
⎟
(
1
)
2
2
r
x
F
Δ
+ x 2 FRh
w
K
x
F
+
−
⎢
⎥
⎥=
∑h h ⎜ ∑jhRh
j K ⎢(1 − x ) 2 Fh
⎟ ⎣
r
r
r
∂
r
∂
∂
∂
⎢
⎥
j
j
i
i
⎦
⎣
⎦
⎝
⎠
⎡
∂ FRh ⎤∂ Fh
+ x 2 FRh= ∑ wh ΔF 2 h , x K 2 ⎢(1 − x)2 Fh
⎥
∂ri ⎦
∂ri
h
⎣
Considering:
Fh , x2= (1 − x)( Ah cos φ h + Bh sin φ h ) + x( ARh cos φ Rh + BRh sin φ Rh )2

we have:

Page 1412

2∂ Fh , x⎛∂ Fh∂ FRh ⎞⎟= ⎜ (1 − x)2 Fh+ x 2 FRh
⎜
⎟
∂
p
∂
p
j
j ⎠
⎝

∂p j
∂ Fh
∂p j

=

∂ FRh
∂p j

∂Ah
∂B
cos φ h + h sin φ h
∂p j
∂p j

=

∂ARh
∂B
cos φ Rh + Rh sin φ Rh
∂p j
∂p j

Atomic coordinates rj :2⎡
∂Ah , j⎛ sin ϑh ⎞ ⎤= −(2πh ) f j sin (2π ⋅ h ⋅ rj )exp ⎢- B j ⎜⎟ ⎥ (occ j ) = −2πhBh , j∂rj⎝ λ ⎠ ⎦⎥⎣⎢
∂ARh , j∂rj

2⎡⎛ sin ϑh ⎞ ⎤= −(2πRh ) f j sin (2π ⋅ Rh ⋅ rj )exp ⎢- B j ⎜⎟ ⎥ (occ j ) = −2πRhB Rh, j
λ
⎝
⎠ ⎦⎥
⎣⎢

2
⎡
⎛ sin ϑh ⎞ ⎤= (2πh ) f j cos(2π ⋅ h ⋅ rj )exp ⎢- B j ⎜⎟ ⎥ (occ j ) = 2πhAh , j∂rj⎝ λ ⎠ ⎥⎦⎢⎣
2⎡
∂BRh , j⎛ sin ϑh ⎞ ⎤= (2πRh ) f j cos(2π ⋅ Rh ⋅ rj )exp ⎢- B j ⎜⎟ ⎥ (occ j ) = 2πRhARh , j∂rj⎝ λ ⎠ ⎥⎦⎢⎣

∂Bh , jAtomic isotropic thermal parameters Bj :2
∂Ah , j⎛ sin ϑh ⎞= −⎜⎟ Ah , j∂B j⎝ λ ⎠∂ARh , j∂B j∂Bh , j2

⎛ sin ϑh ⎞= −⎜⎟ ARh , j
⎝ λ ⎠2⎛ sin ϑh ⎞= −⎜⎟ Bh , j
∂B j
⎝ λ ⎠

∂BRh , j∂B j

2⎛ sin ϑh ⎞= −⎜⎟ BRh , j
⎝ λ ⎠Atomic anisotropic thermal parameters βij :∂Ah , j= (- hi h j ) f j cos(2π ⋅ h ⋅ rj )exp[- hβ ij h ](occ j ) = (- hi h j )Ah , j∂β (ij ) j∂ARh , j∂β (ij ) j∂Bh , j∂β (ij ) j∂B Rh , j∂β (ij ) j[]= (- Rhi Rh j ) f j cos(2π ⋅ Rh ⋅ rj )exp - Rhβ ij Rh (occ j ) = (- Rhi Rh j )ARh , j[]= (- hi h j ) f j sin (2π ⋅ h ⋅ rj )exp - hβ ij h (occ j ) = (- hi h j )Bh , j[]= (- Rhi Rh j ) f j sin (2π ⋅ Rh ⋅ rj )exp - Rhβ ij Rh (occ j ) = (− Rhi Rh j )B Rh , jPage 142

Site occupation factors occj :Ah , j∂Ah , j=∂occ j occ j∂ARh , j=∂occ j∂Bh , j=∂occ j∂BRh , j=∂occ jARh , jocc jBh , jocc jBRh , jocc jTwin fractional parameter x:∂ Fh , x22= − Fh + FRh∂x2

all the previous derivatives have to be multiplied by (wh K2).

VII. Enantiomorph-polarity parameter

The enantiomorph-polarity parameter x for the observed intensity of the reflection h (as defined by H D
Flack, 1983) is:

Fh , x2

2= (1 − x) Fh + x F− h2where |Fh|2 and |F-h|2 are the intensity of the two enantiomers.
The function being minimized by the least-squares method becomes:(

M = ∑ wh Fh
h

2
oss

− K 2 Fh , x) = ∑ w (F

2 2

h

h

2
oss

[

2

− K 2 (1 − x) Fh + x F− h

2

])

2

h

[

2

]

⎛
⎞
⎡
∂ Fh
∂ F− h ⎤222
M = ∑ wh ⎜ Fh oss − K 2 (1 − x) Fh + x F− h − K 2 ∑ ⎢(1 − x)2 Fh+ x 2 F− h
Δr j ⎟ =⎥⎜⎟∂r j∂r j ⎥⎦
h
j ⎢
⎣
⎝
⎠
2

⎛
⎞
⎡
∂ Fh
∂ F− h ⎤= ∑ wh ⎜ ΔF 2 h , x − K 2 ∑ ⎢(1 − x)2 Fh+ x 2 F− h
Δr j ⎟⎥⎜⎟∂r j ⎦⎥
∂r j
h
j ⎢
⎣
⎝
⎠
Setting to zero the derivates of M with respect to the Δri .
⎛
⎞
⎡
∂ Fh
∂ F− h ⎤∂M
Δr j ⎟= ∑ wh ⎜ ΔF 2 h , x − K 2 ∑ ⎢(1 − x)2 Fh+ x 2 F− h
⎥
⎜
⎟
∂Δri
∂r j
∂r j ⎥⎦
h
j ⎢
⎣
⎝
⎠
⎡
∂ Fh
∂ F− h ⎤K 2 ⎢(1 − x)2 Fh+ x 2 F− h
⎥=0
∂ri
∂ri ⎦
⎣
the normal equations are obtained:

Page 143

⎛⎡∑ w K ⎜⎜ ∑ ⎢(1 − x)2 F
2hh⎝ j ⎢⎣

h

∂ Fh
∂r j

+ x 2 F− h

⎞ 2⎡
∂ Fh
∂ F− h ⎤∂ F− h ⎤+ x 2 F− h
⎥ Δr j ⎟⎟ K ⎢(1 − x)2 Fh
⎥=
r
r
∂
∂
∂r j ⎥⎦
i
i
⎦
⎠ ⎣

⎡
∂ Fh
∂ F− h ⎤= ∑ wh ΔF 2 h , x K 2 ⎢(1 − x)2 Fh+ x 2 F− h
⎥
∂ri
∂ri ⎦
h
⎣
We consider now the anomalous scattering effect, and as we have seen before we have:for h:Fh = ( Ah − Dh ) + i (Bh + C h )(Bh + C h )( Ah − Dh )Fh = ( Ah − Dh ) cos φ h + (Bh + C h )sin φ htan φ h =and for –h:
F− h = ( Ah + Dh ) − i (Bh − C h )(− Bh + C h )( Ah + Dh )F− h = ( Ah + Dh ) cos φ − h + (− Bh + C h )sin φ −htan φ − h =The structure factor now is:Fh , x2= (1 − x)[( Ah − Dh ) cos φ h + (Bh + C h )sin φ h ] + x[( Ah + Dh ) cos φ − h + (− Bh + C h )sin φ −h ]2

we have:∂ Fh , x2⎛∂ Fh∂ F− h ⎞⎟= ⎜ (1 − x)2 Fh+ x 2 F− h
⎜
⎟
p
p
∂p j
∂
∂
j
j ⎠
⎝
⎛
⎞
∂ Fh ⎛ ∂Ah ∂Dh ⎞⎟ cos φ h + ⎜ ∂Bh + ∂C h ⎟ sin φ h
=⎜
−
⎜ ∂p
⎟
∂p j ⎜⎝ ∂p j ∂p j ⎟⎠⎝ j ∂p j ⎠⎛⎞∂ F− h ⎛ ∂Ah ∂Dh ⎞⎟ cos φ − h + ⎜ − ∂Bh + ∂C h ⎟ sin φ −h
=⎜
+
⎜ ∂p
⎟
⎜ ∂p
∂p j
∂p j ⎟⎠j⎝ j ∂p j ⎠⎝Flack parameter x:∂ Fh , x∂x22= − Fh + F− h2Page 144

2

VIII. Metric and vector notation

We assumed the tensor notation according to the Levi-Civita notation. A crystallographic cell in the real
space (a,b,c,α,β,γ) with volume V is written as a i , while the reciprocal cell is a i and the metric tensors

G ij and G ij , direct and reciprocal metric tensors respectively, are defined as following:⎛ a2⎜
G ij = ⎜ ab cos γ⎜ ac cos β⎝

ab cos γb2bc cos α

ac cos β ⎞ ⎛ g 11
⎟ ⎜bc cos α ⎟ = ⎜ g 21
c 2 ⎟⎠ ⎜⎝ g 31

g 12
g 22
g 32

g 13 ⎞⎟
g 23 ⎟
g 33 ⎟⎠⎛a *2
a * b * cos γ * a * c * cos β *⎞ ⎛⎜ g 11⎜⎟
b *2
b * c * cos α * ⎟ = ⎜ g 21
G ij = ⎜ a * b * cos γ *⎜ a * c * cos β * b * c * cos α *
⎟ ⎜g
2
c
*
⎝
⎠ ⎜⎝ 31

(

g 12
g 22
g 32

g 13 ⎞⎟
g 23 ⎟⎟
g 33 ⎟⎠)

With respect to the a i base, vectors are written as r i = r x , r y , r z , and with respect to the a i base, vec-

tors are written as ri = (rx , ry , rz ) , i.e. a vector r can be represented by the r i or ri , contravariant and covariant components respectively:

The squared length of r can be expressed in terms of his components taking into account the metric tensor
with Einstein’s summation convention as follows:2
r = G ij r i r j = G ij ri r j
and it easy to show that ri = G ij r j and if we perform the inverse operation, we have r i = G ij r j with( ) and then we obtain

G ij = G ij

−1

2

r = ri r j
If the coordinate system is a orthogonal monometric base ( G ij = G ij = I ), the contravariant and covariant
components are identical:
r j = riPage 145

IX. Rigid body constraint

A rigid body is formed by a number of atoms having known fixed geometry. Our approach follows the
traditional refinement of the centroid and of three Eulerian angles. In fact, the position and the orientationof a rigid body may be described by three positional and three rotational parameters. Therefore, for eachrigid body of n atoms the number of independent positional parameters reduces from 3n to 6.
The calculations could be performed according to the following scheme.
1) Define a rigid body in a Z-matrix representation. In the Z-matrix approach used to define connectivity between atoms in a molecule the position of each atom (except the first three) is definedwith respect to three previously defined atoms. The parameters one needs are distances (d), angles(α) and dihedral angles (γ).
In this example•

a Carbon atom•

is connected to atom number 5 with a Bond Distance of 1.4 Angstroms,•

The vector from the Carbon atom to atom number 5 and the vector from atom number 5
to atom number 4 make a Bond Angle of 120.0 degrees.

•

The two planes constituted by atoms (Carbon-5-4) and (5-4-3) make an Dihedral/torsion
angle of 0.0 degrees.

The first atom in the Z-matrix has no previously defined atoms to refer to and is the origin, thesecond atom is always connected to the first atom by just a bond distance, and the third atom isconnected to the first two by just a bond distance and a bond angle. The vector (2-1) defines the xaxis , the plane which contains (1-2-3) define where the y axis lies, and then the z axis is obtained
as vector perpendicular to that plane.
A fine Z-matrix editor can be found at
http://www.cmbi.ru.nl/molden/zmat/zmat.html
Page 146

For a benzene group, the Z-matrix representation is:

Atom
Atom
Bond
Angle
Bond Dihedral Dihedral
Name Connect Distance Connect Angle Connect Angle
C1
C2

1

1.38

C3

2

1.38

1

120.0

C4

3

1.38

2

120.0

1

0.00

C5

4

1.38

3

120.0

2

0.00

C6

5

1.38

4

120.0

3

0.00

2) Transform the coordinates in Z-matrix representation in its local Cartesian frame x (in Ångstroms). In this case, the base ai is orthogonal and the metric tensor G ij = I , therefore we do notconsidered the metric tensor in the calculation. The general algorithm is the following:
r1 = (0,0,0)r2 = (d 2 ,0,0)
For the atom r3:
Calculate the versor pi along x-axis as follows:u i = r2 − r12

u = ui • ui
u=

u

2

ui
u
Calculate the versor qi along z-axis:
v i = p i ∧ (0,1,0)
pi =

vi
v
Calculate the versor si along y-axis:
si = qi ∧ pithen we can calculate the position for the atom r3
r3 = r2 − p i d 3 cos α 3 + s i d 3 sin α 3
For the next atom i (atom connect j, bond distance di, angle connect k, bond angle αi, dihedralconnect l, dihedral angle ψi):
Calculate the versor pi along k-j direction to establish the local x-axis:
u i = r j − rk
qi =

ui
u
Calculate the vector along l-k direction:w i = rl − rk
Calculate the cross product of wi and pi to establish the versor qi along the local z-axis:
vi = pi ∧ wi
pi =

vi
q =
v
i

Page 147

Calculate the cross product of pi and qi to establish the versor si along the local y-axis:
si = qi ∧ pi
ri = r j − p i d i cos α i + s i d i sin α i cosψ i + q i d i sin α i sinψ i3) If the matrix G=U-1R connects the local Cartesian system to the crystallographic system, where U
is the orthogonalization matrix of the crystallographic cell and R is orientation matrix (the productof three rotation matrix), we have:x = x 0 + GX
where x are the coordinates of atoms and x0 are the coordinates of the origin of the group in the
crystallographic cell, X are the coordinates of atoms in the local Cartesian system of the group.
4) The contribution FhG to the structure factors is given by:2n⎡⎛ sin ϑ h ⎞ ⎤G
Fh = ∑ f j exp(2πi ⋅ h ⋅ x j )exp ⎢- B j ⎜⎟ ⎥ (occ j )⎝ λ ⎠ ⎥⎦
j =1
⎢⎣
2
⎡
⎛ sin ϑ h ⎞ ⎤= ∑ f j exp 2πi ⋅ h ⋅ x + GX j exp ⎢- B j ⎜⎟ ⎥ (occ j )⎝ λ ⎠ ⎥⎦j =1⎢⎣
5) Define the derivatives with respect to the rigid body parameters (x0,y0,z0,θ,ψ,φ):

(

n

∂ Fh

G

∂p j

(

))

0

G

G

∂B
∂A
= h cos φ + h sin φ
∂p j
∂p j

Atomic coordinates shift x0 :
G
n ∂A
∂ Ah
j
=∑
∂x o
j =1 ∂x j
∂ Bh

G

∂x o

n

∂B j

j =1

∂x j

=∑

Rotational parameters θ,ψ,φ:G
3 ∂A ∂x
3 ∂A ∂GX
3 ∂A
n
n
n
∂ Ah
∂R
ji
ij
j
j
j
U −1
X ij
= ∑∑
= ∑∑
= ∑∑
∂θ
∂θ
∂θ
j =1 i =1 ∂x ji ∂θ
j =1 i =1 ∂x ji
j =1 i =1 ∂x ji
∂ Bh

G

∂θ
∂ Ah

G

G

G

∂ϕ
∂ Bh

j =1 i =1∂x ji ∂θn

3

∂A j ∂x ji

j =1 i =1∂x ji ∂ψn

3

∂B j ∂x ji

j =1 i =1∂x ji ∂ψn

3

∂A j ∂x ji

j =1 i =1∂x ji ∂ϕn

3

∂B j ∂x ji

j =1 i =1∂x ji ∂ϕ

= ∑∑

∂ψ
∂ Ah

∂B j ∂x ji

= ∑∑

∂ψ
∂ Bh

3

n

= ∑∑

G

∂ϕ

= ∑∑
= ∑∑

3

∂B j

j =1 i =1

∂x ji

n

3

∂A j

j =1 i =1

∂x ji

n

3

∂B j

j =1 i =1

∂x ji

n

3

∂A j

j =1 i =1

∂x ji

n

3

∂B j

j =1 i =1

∂x ji

n

= ∑∑

= ∑∑
= ∑∑

= ∑∑
= ∑∑

U −1

∂R
X ij
∂θ

U −1

∂R
X ij
∂ψ

U −1

∂R
X ij
∂ψ

U −1

∂R
X ij
∂ϕ

U −1

∂R
X ij
∂ϕ
Page 148

6) To calculate the derivative respect the rotational parameters, we have to define the orientation matrix (Andreev et al.,1997):⎡ cosψ cos ϕ − cos θ sin ϕ sinψR = ⎢⎢− sinψ cos ϕ − cos θ sin ϕ cosψ⎢⎣sin θ sin ϕcosψ sin ϕ + cos θ cos ϕ sinψ− sinψ sin ϕ + cos θ cos ϕ cosψ− sin θ cos ϕsin θ sinψ ⎤cosψ sin θ ⎥⎥cos θ ⎥⎦and the orthogonalization matrix from the cell parameters a,b,c,α,β,γ:⎡ a sin β
U = ⎢⎢ 0⎢⎣a cos β− b sin α cos γ * 0⎤b sin α sin γ * 0⎥⎥b cos αc ⎥⎦Then, we calculate an approximate G matrix from the relationshipx = x 0 + GX
where x, x0 and X are known and we obtain the R matrix from:
R = UGand values of the Eulerian angles can be readily calculated as follows:θ = acos(R33 )
⎧
⎡
⎤
R31
⎪sin ϕ = ⎢⎥⎪⎢ 1 − R33 2 ⎥
⎣
⎦
⎪
⎨
⎡
⎤
⎪
R32
⎥
⎪cos ϕ = − ⎢⎢ 1 − R33 2 ⎥
⎪⎩
⎣
⎦

(

)

(

)

⎧
⎡
⎤
R13
⎪sinψ = ⎢⎥⎪⎢ 1− R 2 ⎥
33
⎣
⎦
⎪
⎨
⎡
⎤
⎪
R23
⎢
⎥
⎪cosψ =2 ⎥⎢⎪⎩⎣ 1 − R33 ⎦

(

)

(

)

giving the initial value of θ,φ and ψ .
Now we can update the x coordinates of the atoms of the group, respect to the coordinates X of themodel, knowing the Eulerian angles:
G = U −1 Rx = x 0 + GX
Calculate the derivatives of the R matrix for the Eulerian angles:⎡ sin θ sin ϕ sinψ∂R ⎢= sin θ sin ϕ cosψ∂θ ⎢⎢⎣ cos θ sin ϕ− sin θ cos ϕ sinψ− sin θ cos ϕ cosψ
− cos θ cos ϕ

cos θ sinψ ⎤cosψ cos θ ⎥⎥− sin θ ⎥⎦Page 149⎡− cosψ sin ϕ − cos θ cos ϕ sinψ∂R ⎢= sinψ sin ϕ − cos θ cos ϕ cosψ∂ϕ ⎢⎢⎣sin θ cos ϕ

cosψ cos ϕ − cos θ sin ϕ sinψ− sinψ cos ϕ − cos θ sin ϕ cosψsin θ sin ϕ

0⎤
0⎥⎥
0⎥⎦

⎡− sinψ cos ϕ − cos θ sin ϕ cosψ∂R ⎢= − cosψ cos ϕ + cos θ sin ϕ sinψ
∂ψ ⎢
⎢⎣
0

− sinψ sin ϕ + cos θ cos ϕ cosψ
− cosψ sin ϕ − cos θ cos ϕ sinψ0

sin θ cosψ ⎤− sinψ sin θ ⎥⎥⎥⎦0

obtaining:∂x∂R= U −1
X
∂θ
∂θ
∂x
∂R
= U −1
X
∂ϕ
∂ϕ
∂x
∂R
= U −1X∂ψ∂ψA good collection of useful routines for this argument can be found at the DYNAMO site:
http://www.ibs.fr/ext/labos/LDM/projet6/Main.html
DYNAMO is a library of Fortran 90 modules that has been designed for the simulation of molecular systems using molecular mechanical (MM) and hybrid quantum mechanical (QM)/MM potential energyfunctions.

Page 150

X. Bond distance restraint

The bond distance is the calculated distance between the atom A and the atom B . The positions of theatoms (A, B) are represented by rn =(xn,yn,zn) (n = 1,2)

and the inter-atomic vectors is:()

u i = r1 − r2 → u 1 , u 2 , u 3 = [( x1 − x 2 ), ( y1 − y 2 ), ( z 1 − z 2 )]The interatomic distance is obtained by:2⎧
g11 ( x1 − x 2 )+ g12 ( x1 − x 2 )( y1 − y 2 ) + g13 ( x1 − x 2 )( z1 − z 2 ) ⎫
⎪
⎪
2
2
i
j
u = u • G ij u = ⎨+ g 21 ( y1 − y 2 )(x1 − x 2 )+ g 22 ( y1 − y 2 )+ g 23 ( y1 − y 2 )( z1 − z 2 )⎬2
⎪ + g ( z − z )( x − x ) + g ( z − z )( y − y )⎪+ g 33 ( z1 − z 2 )
2
1
2
32
1
2
1
2
⎩ 31 1⎭u=u

2

The derivatives of u with respect to r is :
∂u
1
1
1
=
⋅ ∂ (u i • G ij u j ) =⋅ 2Gij u j = Gij u j
∂r 2u
2u
u

(

)

Then we can calculate the derivatives of u with respect to the coordinates x,y,z of the two atoms.

Atom 1
Parameter x1∂u 1= ⋅ [g11 (x1 − x 2 ) + g12 ( y1 − y 2 ) + g13 ( z1 − z 2 )]∂x1 uParameter y1∂u 1= ⋅ [g 21 (x1 − x 2 ) + g 22 ( y1 − y 2 ) + g 23 ( z1 − z 2 )]∂y1 uParameter z1∂u 1= ⋅ [g 31 (x1 − x 2 ) + g 32 ( y1 − y 2 ) + g 33 ( z1 − z 2 )]∂z1 uAtom 2
Parameter x21∂u∂u= − ⋅ [g11 ( x1 − x 2 ) + g12 ( y1 − y 2 ) + g13 ( z1 − z 2 )] = −
∂x 2
u
∂x1
Page 151

Parameter y2∂u1∂u= − ⋅ [g 21 (x1 − x 2 ) + g 22 ( y1 − y 2 ) + g 23 ( z1 − z 2 )] = −
∂y 2
u
∂y1
Parameter z2∂u1∂u= − ⋅ [g 31 ( x1 − x 2 ) + g 32 ( y1 − y 2 ) + g 33 ( z1 − z 2 )] = −
∂z 2
u
∂z1

XI. Bond angle restraint

The bond angle τ at the atom B is the angle between the bond A—B and the bond B—C. The positions of
the atoms (A, B,C) are represented by rn =(xn,yn,zn) (n = 1,2,3)

and the inter-atomic vectors are:()
v = r − r → (v , v , v ) = [( x − x ), ( y − y ), ( z − z )](u − v ) = w = r − r → (w , w , w ) = [(x − x ), ( y − y ), (z − z )]u i = r1 − r2 → u 1 , u 2 , u 3 = [( x1 − x 2 ), ( y 1 − y 2 ), ( z 1 − z 2 )]
1

i

3

2

3

2

i

3

1

i

1

2

2

3

2

3

2

3

3

1

3

1

3

1

3

We have the relationships :
2

2

2

2

u − v = w = u + v − 2 u v cos τ2

cos τ =

2u +v −w

22u v
and the angle τ between the two vectors u and v is obtained:⎛u2 + v2 − w2 ⎞⎟
τ = acos⎜
⎜
⎟
2u v
⎝
⎠

The interatomic distances are:2⎧
g11 ( x1 − x 2 )+ g12 ( x1 − x 2 )( y1 − y 2 ) + g13 ( x1 − x 2 )( z1 − z 2 ) ⎫
⎪
⎪
2
2
i
j
u = u • G ij u = ⎨+ g 21 ( y1 − y 2 )( x1 − x 2 )+ g 22 ( y1 − y 2 )+ g 23 ( y1 − y 2 )( z1 − z 2 )⎬2
⎪ + g ( z − z )( x − x ) + g ( z − z )( y − y )⎪+ g 33 ( z1 − z 2 )
2
1
2
32
1
2
1
2
⎩ 31 1⎭u=u

2Page 1522⎧+ g12 (x3 − x 2 )( y 3 − y 2 ) + g 13 ( x3 − x 2 )( z 3 − z 2 ) ⎫g 11 (x3 − x 2 )
⎪
⎪
2
2
i
j
+ g 22 ( y 3 − y 2 )+ g 23 ( y 3 − y 2 )( z 3 − z 2 )⎬v = v • G ij v = ⎨+ g 21 ( y 3 − y 2 )( x3 − x 2 )2⎪ + g (z − z )( x − x ) + g (z − z )( y − y )⎪+ g 33 ( z 3 − z 2 )
2
3
2
32
3
2
3
2
⎩ 31 3
⎭

v=

v

2

2
⎧
g11 ( x1 − x3 )+ g 12 (x1 − x3 )( y1 − y 3 ) + g13 ( x1 − x3 )( z1 − z 3 ) ⎫⎪⎪22w = w i • G ij w j = ⎨+ g 21 ( y1 − y 3 )( x1 − x3 )+ g 22 ( y1 − y 3 )+ g 23 ( y1 − y 3 )( z1 − z 3 )⎬2
⎪ + g (z − z )( x − x ) + g ( z − z )( y − y )⎪+ g 33 ( z1 − z 3 )
3
1
3
32
1
3
1
3
⎩ 31 1⎭w=

w

2

It is useful to rewrite the relationship to obtain the angle in the form:⎛ u 2 + v 2 − w2 ⎞
⎛u
v
w2 ⎞
⎟⎟ = acos⎜⎜ +⎟⎟ = acos(T )τ = acos⎜⎜
−
2uv
⎝
⎠
⎝ 2v 2u 2uv ⎠Then using the chain rule, the derivatives of the function with respect to an atomic position r and a generic distance involved d are:
∂τ
1
∂T ∂d
=−
∑
∂r
sin τ
∂d ∂r
Considering the distance u, the derivatives are:
∂T
1
v
w2
u 2 − v 2 + w2=
− 2 + 2 =∂u 2v 2u2u v
2u 2 v∂u11=⋅ ∂ (u i • G ij u j ) = Gij u j∂r 2uu
We obtain:
1 ⎛ u 2 − v 2 + w2 ⎞ 1∂τ⎜⎜⎟⎟ Gij u j=−2sin τ ⎝
∂r2u v
⎠uConsidering the distance v:
∂T
u
1
w2
− u 2 + v 2 + w2=− 2 ++=
2u 2uv 2
∂v
2v
2uv 2
∂v 1
1
=
⋅ ∂ ( v i • G ij v j ) = Gij v j∂r 2vv
We obtain:
1 ⎛ − u 2 + v 2 + w2 ⎞ 1∂τ⎜⎜⎟⎟ Gij v j=−2sin τ ⎝
∂r
2uv
⎠v
Considering the distance w:
∂T
2w
=−
∂w
2uv
∂w
1
1
=
⋅ ∂ (w i • G ij w j ) = Gij w j∂r 2 w
w
We obtain:∂τ1 ⎛ 2w ⎞ 1
1 1
j=
Gij w j⎜⎟ Gij w =∂r sin τ ⎝ 2uv ⎠ w
sin τ uv

Page 153

Now , we are able to calculate the derivatives with respect to the coordinates x,y,z of the three atoms involved.
⎫∂τ1 ⎧ 1 ⎛ − u 2 + v 2 − w2 ⎞1 ⎛ u 2 − v 2 − w2 ⎞
1
j
j
j
⎟
⎜
⎟
=
+
+
⋅
G
u
G
v
G
w
⎨ ⎜⎜
⎬
ij
⎟ ij
⎟ ij
∂r sin τ ⎩ u ⎝v ⎜⎝uv
2u 2 v
2uv 2⎠⎠⎭Atom 1
Parameter x1∂τ1 ⎧ 1 ⎛ − u 2 + v 2 − w2 ⎞⎟⎟[g11 (x1 − x 2 ) + g12 ( y1 − y 2 ) + g13 ( z1 − z 2 )] +=⎨ ⎜∂x1 sin τ ⎩ u ⎜⎝2u 2 v⎠1⎫+ [g11 (x1 − x3 ) + g12 ( y1 − y 3 ) + g 13 ( z1 − z 3 )]⎬uv⎭
Parameter y1∂τ1 ⎧ 1 ⎛ − u 2 + v 2 − w2 ⎞⎟⎟[g 21 (x1 − x 2 ) + g 22 ( y1 − y 2 ) + g 23 ( z1 − z 2 )] +=⎨ ⎜∂y1 sin τ ⎩ u ⎜⎝2u 2 v⎠
1[g 21 (x1 − x3 ) + g 22 ( y1 − y3 ) + g 23 (z1 − z 3 )]⎫⎬
uv⎭
Parameter z1∂τ1 ⎧ 1 ⎛ − u 2 + v 2 − w2 ⎞⎟⎟[g 31 ( x1 − x 2 ) + g 32 ( y1 − y 2 ) + g 33 ( z1 − z 2 )] +=⎨ ⎜∂z1 sin τ ⎩ u ⎜⎝2u 2 v⎠++

1[g 31 (x1 − x3 ) + g 32 ( y1 − y3 ) + g 33 (z1 − z 3 )]⎫⎬
uv⎭

Atom 2
Parameter x2∂τ1 ⎧ 1 ⎛ − u 2 + v 2 − w2 ⎞⎟⎟[g 11 (x1 − x 2 ) + g 12 ( y1 − y 2 ) + g 13 ( z1 − z 2 )] +=⎨− ⎜∂x 2 sin τ ⎩ u ⎜⎝2u 2 v⎠⎫1 ⎛ u 2 − v 2 − w2 ⎞
⎟
(
)
(
)
[
g
x
x
g
y
y
g
z
z
]
− ⎜⎜
−
+
−
+
−
(
)
⎬
11
3
2
12
3
2
13
3
2
⎟
v⎝
2uv 2
⎠
⎭
Parameter y2∂τ1 ⎧ 1 ⎛ − u 2 + v 2 − w2 ⎞⎟⎟[g 21 (x1 − x 2 ) + g 22 ( y1 − y 2 ) + g 23 ( z1 − z 2 )] +=⎨− ⎜∂y 2 sin τ ⎩ u ⎜⎝2u 2 v⎠⎫1 ⎛ u 2 − v 2 − w2 ⎞⎟⎟[g 21 ( x3 − x 2 ) + g 22 ( y 3 − y 2 ) + g 23 ( z 3 − z 2 )]⎬
− ⎜⎜
2
v⎝
2uv
⎠
⎭
Parameter z2∂τ1 ⎧ 1 ⎛ − u 2 + v 2 − w2 ⎞⎟⎟[g 31 (x1 − x 2 ) + g 32 ( y1 − y 2 ) + g 33 ( z1 − z 2 )] +=⎨− ⎜∂z 2 sin τ ⎩ u ⎜⎝2u 2 v⎠⎫1 ⎛ u 2 − v 2 − w2 ⎞⎟⎟[g 31 ( x3 − x 2 ) + g 32 ( y 3 − y 2 ) + g 33 ( z 3 − z 2 )]⎬
− ⎜⎜
2
v⎝
2uv
⎠
⎭

Atom 3
Parameter x3

Page 154∂τ
1 ⎧1 ⎛ u 2 − v 2 − w2 ⎞⎟⎟[g11 ( x3 − x 2 ) + g 12 ( y 3 − y 2 ) + g13 ( z 3 − z 2 )] +=⎨ ⎜∂x3 sin τ ⎩ v ⎜⎝
2uv 2
⎠

1
[g11 (x1 − x3 ) + g12 ( y1 − y3 ) + g13 ( z1 − z 3 )]⎫⎬
uv⎭
Parameter y3∂τ1 ⎧1 ⎛ u 2 − v 2 − w2 ⎞⎟⎟[g 21 ( x3 − x 2 ) + g 22 ( y 3 − y 2 ) + g 23 ( z 3 − z 2 )] +=⎨ ⎜∂y 3 sin τ ⎩ v ⎜⎝
2uv 2
⎠
−

1
[g 21 (x1 − x3 ) + g 22 ( y1 − y3 ) + g 23 ( z1 − z 3 )]⎫⎬
uv⎭
Parameter z3∂τ1 ⎧1 ⎛ u 2 − v 2 − w2 ⎞⎟⎟[g 31 ( x3 − x 2 ) + g 32 ( y 3 − y 2 ) + g 33 ( z 3 − z 2 )] +=⎨ ⎜∂z 3 sin τ ⎩ v ⎜⎝
2uv 2
⎠
−

−

1
[g 31 (x1 − x3 ) + g 32 ( y1 − y3 ) + g 33 ( z1 − z 3 )]⎫⎬
uv⎭

XII. Torsion angle restraint

The torsion (or twist) angle τ about the line between atoms B--C of the sequence of four atoms A--B--C-D is defined as the rotation angle required to correspond the projection of the line B--A to the projectionof the line C--D, seen along the direction of the line B--C. The sign of the angle is positive if the rotation
is clockwise.

The positions of the atoms (A,B,C,D) are represented by rn=(xn,yn,zn) (n=1,2,3,4) and the interatomic vectors are:Page 155()
v = r − r → (v , v , v ) = [( x − x ), ( y − y ), ( z − z )]w = r − r → (w , w , w ) = [( x − x ), ( y − y ), ( z − z )]u i = r1 − r2 → u 1 , u 2 , u 3 = [( x1 − x 2 ), ( y1 − y 2 ), ( z 1 − z 2 )]
i

1

4

2

3

4

3

i

1

3

2

3

4

3

4

3

3

2

3

2

3

2

3

2

We calculate the cross product pi of vectors ui and wi (pi is a vector normal to the plane defined by thevectors ui and wi) and the cross product qi of the vectors vi and wi (qi is a vector normal to the plane defined by the vectors vi and wi). Furthermore, we calculate the vectors pi and qi and the magnitude of thevector wi.

[(

)(

)(

p i = G ij u i ∧ w j → V ( p1 , p 2 , p3 ) = V u 2 w 3 − u 3 w 2 , u 3 w 1 − u 1 w 3 , u 1 w 2 − u 2 w 1
p =G pj
i

)]

ij

(
(
(

p 1 = g 11V u 2 w 3 − u 3 w 2
p 2 = g 21V u 2 w 3 − u 3 w 2
p 3 = g 31V u 2 w 3 − u 3 w 2) + g V (u w − u w ) + g V (u w − u w )) + g V (u w − u w ) + g V (u w − u w )) + g V (u w − u w ) + g V (u w − u w )
12

3

1

1

3

13

1

2

2

1

22

3

1

1

3

23

1

2

2

1

32

3

1

1

3

33

1

2

2

1

2

p = pi • p j
p=

p

2

[(

)(

)(

q i = G ij v i ∧ w j → V (q1 , q 2 , q3 ) = V v 2 w 3 − v 3 w 2 , v 3 w 1 − v 1 w 3 , v 1 w 2 − v 2 w 1
q =G qj
i

ij

(
(
(

q 1 = g 11V v 2 w 3 − v 3 w 2
q 2 = g 21V v 2 w 3 − v 3 w 2
q 3 = g 31V v 2 w 3 − v 3 w 2) + g V (v w − v w ) + g V (v w − v w )) + g V (v w − v w ) + g V (v w − v w )) + g V (v w − v w ) + g V (v w − v w )
12

3

1

1

3

13

1

2

2

1

22

3

1

1

3

23

1

2

2

1

32

3

1

1

3

33

1

2

2

1

2

q = qi • q j
q=

q

2

2

w = w i • G ij w j
w=

w

2

We have the following relationships, the scalar product:p i • q j = p q cos τpi • q jcos τ =(p • q )w
i

=

j

pqw
pq
and the cross and triple products:
p i ∧ q j = p q sin τ(p ∧ q • w ) = p q w sin τ(p ∧ q • w )sin τ =
i

j

j

i

j

j

pqw
Then we can calculate the tan τ :Page 156)](p ∧ q • w )isin τtan τ =
=
cos τ

j

j

pqw
i
p •q j w()(p ∧ q • w ) ⋅
=
i

j

j

pqw

(

)

pqw
pi ∧ q j • w j
S
=
=
i
i
T
p •q j w
p •q j w

(

)

(

)

pqw
and obtain the angle τ :⎛S⎞
τ = arctan τ = arctan⎜ ⎟⎝T⎠
The differential equation has the following form:⎛
1
T2
T2 ⎛ 1S⎛ S ⎞⎞⎛S⎞⎛S⎞⎞d(τ ) = d⎜⎜ arctan⎜ ⎟ ⎟⎟ =d ⎟= 2d ⎟= 2d S − 2 dT ⎟ =
2 ⎜
2 ⎜
2 ⎜
T
⎝ T ⎠⎠⎠⎝⎛ S ⎞ ⎝T⎠ T +S ⎝T⎠ T +S ⎝T
1+ ⎜ ⎟⎝T⎠1(T. d S − S. d T)
= 2
T + S2Using the chain rule, we write the derivative of τ with respect to the atomic coordinates x,y,z of the fouratoms involved.
∂S∂T∂ (τ )e(rj , j=1,4) to obtain.
In the above equation, we have to calculate the derivatives
∂r j
∂r j
∂r j
Rewrite S e T:
G ij p j
p1 p 2 p 3
S = p i ∧ q j • w j = V q 1 q 2 q 3 = V G ij q j = VS'
w1 w 2 w 3
wi

(

)

(

)

(

)

(

)

T = p i • q j w = p 1 q1 + p 2 q 2 + p 3 q3 w = G ij p j • q j w = T' w

where:

[(
[(

)(
)(
[

)(
)(

)]
)]

G ijV u 2 w 3 − u 3 w 2 , u 3 w 1 − u 1 w 3 , u 1 w 2 − u 2 w 1
S' = G ijV v 2 w 3 − v 3 w 2 , v 3 w 1 − v 1 w 3 , v 1 w 2 − v 2 w 1 =w1 , w 2 , w 3]

G ij V {[( y1 − y 2 )(z 3 − z 2 ) − (z1 − z 2 )( y 3 − y 2 )], [(z1 − z 2 )(x 3 − x 2 ) − (x1 − x 2 )(z 3 − z 2 )], [(x1 − x 2 )( y 3 − y 2 ) − ( y1 − y 2 )(x 3 − x 2 )]}= G ij V {[( y 4 − y 3 )(z 3 − z 2 ) − (z 4 − z 3 )( y 3 − y 2 )], [(z 4 − z 3 )(x 3 − x 2 ) − (x 4 − x 3 )(z 3 − z 2 )], [(x 4 − x 3 )( y 3 − y 2 ) − ( y 4 − y 3 )(x 3 − x 2 )]}{(x 3 − x 2 ), ( y 3 − y 2 )(z 3 − z 2 )}andT' = G ijV {[( y1 − y2 )(z3 − z2 ) − (z1 − z2 )( y3 − y2 )], [(z1 − z2 )(x3 − x2 ) − (x1 − x2 )(z3 − z2 )], [(x1 − x2 )( y3 − y2 ) − ( y1 − y2 )(x3 − x2 )]} •V {[( y4 − y3 )(z3 − z2 ) − (z4 − z3 )( y3 − y2 )], [(z4 − z3 )(x3 − x2 ) − (x4 − x3 )(z3 − z2 )], [(x4 − x3 )( y3 − y2 ) − ( y4 − y3 )( x3 − x2 )]}For the vector pi, we have:
ij
∂p j
∂p j
∂p i ∂ G p j∂G ij== G ij+pj= G ij
∂r
∂r
∂r
∂r
∂r
ij
∂G
being null the term p j, and likewise for qi :
∂r
i
∂
q
∂q
j
= G ij∂r∂r
Then we have to calculate:⎛ ∂S' ij ∂p j ∂S' ij ∂q j ∂S' ∂w i ⎞
∂S
∂S'
⎟
=V
= V ⎜⎜ i G++G∂r∂r ∂q i∂r ∂w i ∂r ⎟⎠
∂r
⎝ ∂p

(

)

Page 157

and∂p j ∂T' ∂q i ⎞
⎛ ∂T'
∂T
∂T'
⎟
=w
= w⎜⎜ i G ij+∂r∂r∂r ∂q i ∂r ⎟⎠⎝ ∂p
The derivatives of S’ e T’ with respect to r1 (x1,y1,z1) , r2 (x2,y2,z2) , r3 (x3,y3,z3) , r4 (x4,y4,z4) are the following.
Atom 1
Parameter x1
G V {0,−(z 3 − z 2 ), ( y 3 − y 2 )}ij

∂S' ij ∂p j
=
G
∂x1
∂p i

qi
wi

∂S' ij ∂q j
=0
G
∂x1
∂q i
∂S' ∂w i⋅=0∂w i ∂x1ij∂T' ij ∂p j
= G V {0,−(z 3 − z 2 ), ( y 3 − y 2 )}• q i
G
i
∂x1
∂p
∂T' ∂q i⋅=0∂q i ∂x1
Parameter y1
G V {( z 3 − z 2 ),0,−( x3 − x 2 )}ij

∂S' ij ∂p j
=
G
∂y1
∂p i

qi
wi

∂S' ij ∂q j
=0
G
∂y1
∂q i
∂S' ∂w i⋅=0∂w i ∂y1ij∂T' ij ∂p j
G=
G
V {( z 3 − z 2 ),0,−( x3 − x 2 )}• q i∂y1∂p i∂T' ∂q i⋅=0∂q i ∂y1
Parameter z1
G V {− ( y 3 − y 2 ), ( x3 − x 2 ),0}∂S' ij ∂p j
qi
=
G
∂z1
∂p i
wi
ij

Page 158

∂S' ij ∂q j
=0
G
∂z1
∂q i
∂S' ∂w i⋅=0∂w i ∂z1ij∂T' ij ∂p j
= G V {− ( y 3 − y 2 ), ( x3 − x 2 ),0}• q i
G
i
∂z1
∂p
∂T' ∂q i⋅=0∂q i ∂z1
Atom 2
Parameter x2
G V {0, [(z 3 − z 2 ) − ( z1 − z 2 )], [− ( y 3 − y 2 ) + ( y1 − y 2 )]}∂S' ij ∂p j
qi
=
G
i
∂x 2
∂p
wi
ij

pi

ij
∂S' ij ∂q j
= G V {0,−( z 4 − z 3 ), ( y 4 − y 3 )}
G
i
∂x 2
∂q
wi

p1

p2

∂S' ∂w⋅= q1 q 2i∂w ∂x 2
−1 0
i

p3
q3
0

ij
∂T' ij ∂p j
= G V {0, [( z 3 − z 2 ) − ( z1 − z 2 )], [− ( y 3 − y 2 ) + ( y1 − y 2 )]}• q i
G
i
∂x 2
∂p
∂T' ∂q i⋅= p i • V {0,−( z 4 − z 3 ), ( y 4 − y 3 )}∂q i ∂x 2

Parameter y2
G V {[− ( z 3 − z 2 ) + ( z1 − z 2 )],0, [( x3 − x 2 ) − ( x1 − x 2 )]}∂S' ij ∂p j
qi
=
G
i
∂y 2
∂p
wi
ij

pi

ij
∂S' ij ∂q j
= G V {( z 4 − z 3 ),0,−( x 4 − x3 )}
G
i
∂y 2
∂q
wi

p1

∂S' ∂w= q1⋅i∂w ∂y 2
0
i

p2

p3

q2 q3
−1 0

ij
∂T' ij ∂p j=
G
V {[− ( z 3 − z 2 ) + (z1 − z 2 )],0, [( x3 − x 2 ) − (x1 − x 2 )]}• q i
G
∂y 2
∂p i
∂T' ∂q i⋅= p i • V {( z 4 − z 3 ),0,−( x 4 − x3 )}∂q i ∂y 2

Page 159

Parameter z2
G V {[( y 3 − y 2 ) − ( y1 − y 2 )], [− (x3 − x 2 ) + ( x1 − x 2 )],0}∂S' ij ∂p j
qi
=
G
∂z 2
∂p i
wi
ij

pi

∂q j
ij

ij
∂S'
= G V {− ( y 4 − y3 ), ( x 4 − x3 ),0}
G
i
∂z 2
∂q
wi

p1

∂S' ∂w= q1⋅
i∂w ∂z 2
0
i

p2

p3

q2
0

q3
−1

ij
∂T' ij ∂p j
= G V {[( y 3 − y 2 ) − ( y1 − y 2 )], [− ( x3 − x 2 ) + ( x1 − x 2 )],0}• q i
G
i
∂z 2
∂p
∂T' ∂q i⋅= p i • V {− ( y 4 − y 3 ), ( x 4 − x3 ),0}∂q i ∂z 2

Atom 3

Parameter x3
G V {0, ( z1 − z 2 ), [− ( y1 − y 2 )]}ij∂S' ij ∂p j
=
G
∂x3
∂p i

qi
wi
pi

∂q j
ij

ij
∂S'
= G V {0, [(z 4 − z 3 ) + ( z 3 − z 2 )], [− ( y 3 − y 2 ) − ( y 4 − y 3 )]}
G
i
∂x3
∂q
wi

p1

∂S' ∂w= q1⋅
i∂w ∂x3
1
i

p2

p3

q2
0

q3
0

ij
∂T' ij ∂p j
= G V {0, ( z1 − z 2 ), [− ( y1 − y 2 )]}• q i
G
i
∂x3
∂p
∂T' ∂q i⋅= p i • V {0, [( z 4 − z 3 ) + ( z 3 − z 2 )], [− ( y 3 − y 2 ) − ( y 4 − y 3 )]}∂q i ∂x3

Parameter y3
G V {− ( z1 − z 2 ),0, ( x1 − x 2 )}∂S' ij ∂p j
qi
=
G
i
∂y 3
∂p
wi
ij

Page 160

pi

ij∂S' ij ∂q j
= G V {[− ( z 3 − z 2 ) − ( z 4 − z 3 )],0, [( x 4 − x3 ) + (x3 − x 2 )]}
G
i
∂y 3
∂q
wi

p1

∂S' ∂w
= q1
⋅
i
y
∂
∂w
3
0
i

p2

p3

q2
1

q3
0

ij
∂T' ij ∂p j
= G V {− ( z1 − z 2 ),0, ( x1 − x 2 )}• q i
G
i
∂y 3
∂p
∂T' ∂q i⋅= p i • V {[− (z 3 − z 2 ) − ( z 4 − z 3 )],0, [(x 4 − x3 ) + ( x3 − x 2 )]}∂q i ∂y 3

Parameter z3
G V {( y1 − y 2 ),−( x1 − x 2 ),0}∂S' ij ∂p j
qi
=
G
i
∂z 3
∂p
wi
ij

pi

ij
∂S' ij ∂q j
= G V {[( y 4 − y 3 ) + ( y 3 − y 2 )], [− ( x3 − x 2 ) − ( x 4 − x3 )],0}
G
i
∂z 3
∂q
wi

p1

∂S' ∂w= q1⋅
i∂w ∂z 3
0
i

p2

p3

q2
0

q3
1

ij
∂T' ij ∂p j=
G
V {( y1 − y 2 ),−( x1 − x 2 ),0}• q i
G
∂z 3
∂p i
∂T' ∂q i⋅= p i • V {[( y 4 − y3 ) + ( y 3 − y 2 )], [− ( x3 − x 2 ) − ( x 4 − x3 )],0}∂q i ∂z 3

Atom 4

Parameter x4∂S' ij ∂p j
=0
G
∂x 4
∂p i
pi

ij
∂S' ij ∂q j
= G V {0,−( z 3 − z 2 ), ( y 3 − y 2 )}
G
i
∂x 4
∂q
wi

∂S' ∂w i=0⋅∂w i ∂x 4∂T' ij ∂p j
=0
G
∂x 4
∂p i
∂T' ∂q i⋅= p i • V {0,−( z 3 − z 2 ), ( y 3 − y 2 )}∂q i ∂x 4

Page 161

Parameter y4∂S' ij ∂p j
=0
G
∂y 4
∂p i
∂q j
ij

pi

ij
∂S'
= G V {( z 3 − z 2 ),0,−( x3 − x 2 )}
G
i
∂y 4
∂q
wi

∂S' ∂w i=0⋅∂w i ∂y 4∂T' ij ∂p j
=0
G
∂y 4
∂p i
∂T' ∂q i⋅= p i • V {( z 3 − z 2 ),0,−( x3 − x 2 )}∂q i ∂y 4
Parameter z4∂S' ij ∂p j
=0
G
∂z 4
∂p i
pi

ij
∂S' ij ∂q j
G=
V {− ( y 3 − y 2 ), ( x3 − x 2 ),0}
G
∂z 4
∂q i
wi

∂S' ∂w i=0⋅∂w i ∂z 4∂T' ij ∂p j
=0
G
∂z 4
∂p i
∂T' ∂q i⋅= p i • V {− ( y 3 − y 2 ), ( x3 − x 2 ),0}∂q i ∂z 4

XIII. Planarity restraint

We define the least-squares plane the best plane through a group of atoms A, B, C,….The positions of theatoms (A, B,C,…) are represented by rn =(xn,yn,zn) (n = 1,2,3,…) and we want minimize the sum of the
distances to the best plane.

Page 162

r1 = ( x1 , y1 , z1 )r2 = ( x 2 , y 2 , z 2 )r3 = ( x3 , y 3 , z 3 )...........
rn = ( x n , y n , z n )The equation of the best fitting plane is:ax + by + cz + d = 0
The distances of the atoms by the plane are:ax1 + by1 + cz1 + d = d 1
ax 2 + by 2 + cz 2 + d = d 2
ax3 + by3 + cz 3 + d = d 3...........
ax n + by n + cz n + d = d n
We calculate the derivative of dj with respect to rj .
∂d j ∂ (ax j + by j + cz j + d )
=
∂r j
∂r j
The derivatives with respect to the coordinates x,y,z of the atoms are:
Atomo j
∂d j
=a
∂x j
∂d j
∂y j
∂d j
∂z j

=b
=c

Page 163

XIV. Sum restraint

We want to keep constant the sum of the values of a parameter of some atoms. For example, in the spacegroups with floating origin along z-axis we keep constant the sum of the z coordinates of all the atoms.
z1 + z 2 + z 3 + ... + z n = K
The derivative of K with respect to zj is:∂K ∂( z1 + z 2 + z 3 + ... + z n )
=1
=
∂z j
∂z j

XV. Excessive shifts restraint

We want to impose limits against excessive shifts increasing the diagonal element of the normal matrix
for the atomic parameter p. If σ is the maximum permissible breadth for the shift from the current value
for this parameter, we can write:( p − p 0 )2
M =
2

σ

where p0 is the former value of the parameter. The derivative of M with respect to p is:
1
∂M
= 2
∂p σ

XVI. References
Andreev, Y.G., Lightfoot, P. & Bruce, P.G. J. Appl. Cryst. (1997), 30, 294-305.
Burla, M.C., Caliandro, R., Camalli, M., Carrozzini, B., Cascarano, G.L., De Caro, L., Giacovazzo, C.,
Polidori, G. & Spagna, R. J. Appl. Cryst. (2005), 38, 381-388.
Cruickshank, D.W. J. (1965), Computing Methods in Crystallography, pp. 112-116. Oxford: Pergamon
Press.
Flack, H. D. Acta Cryst. (1983), A39, 876-881.
Giacovazzo, C. (2002), Fundamentals of Crystallography, 2nd edn. Oxford: Oxford University Press.
Herbest-Irmer, R. & Sheldrick, G. M. Acta Cryst.(1998), B54, 443-449.
Larson, A.C. (1969) Crystallographic Computing, pp. 291-294. Copenhagen: Munksgaard.
Schwarzenbach, D., Abrahams, S. C., Flack, H.D., Gonshorek, W., Hahn, T., Huml, K., Marsh, R., E.,
Prince, E., Robertson, B. E., Rollett, J.S. & Wilson, A.J.C. Acta Cryst. (1989), A45, 63-75.
Sheldrick, G.M. (1997), SHELXL97. Program for the Refinement of Crystal Structures. University of
Goettingen, Germany.
Spagna, R. & Camalli, M. J. Appl. Cryst. (1999), 32, 934-942.
Yeates, T. O. Methods in Enzymology (1997), 276, 344-358.

Page 164

Call for Contributions to the Next CompComm Newsletter
The eigth issue of the Compcomm Newsletter is expected to appear around November of 2007 with theprimary theme to be determined. If no-one is else is co-opted, the newsletter will be edited by Lachlan
Cranswick.
Contributions would be also greatly appreciated on matters of general interest to the crystallographic
computing community, e.g. meeting reports, future meetings, developments in software, algorithms,
coding, historical articles, programming languages, techniques and other news.
Please send articles and suggestions directly to the editor.

Lachlan M. D. Cranswick
Canadian Neutron Beam Centre (CNBC),
National Research Council of Canada (NRC),
Building 459, Station 18, Chalk River Laboratories,
Chalk River, Ontario, Canada, K0J 1J0
Tel: (613) 584-8811 ext: 3719
Fax: (613) 584-4040
E-mail: lachlan.cranswick@nrc.gc.ca
WWW: http://neutron.nrc-cnrc.gc.ca/peep_e.html#cranswick

Page 165