to physicists or mathematicians, others to chemists. The chapters of Part II

could be useful in courses or for self-study for those who have missed certain

topics in their education; for this purpose exercises are included. Answers

and further information are available on the book™s website.

The subjects treated in this book, and the depth to which they are ex-

plored, necessarily re¬‚ect the personal preference and experience of the au-

thor. Within this subjective selection the literature sources are restricted

to the period before January 1, 2006. The overall emphasis is on simulation

of large molecular systems, such as biomolecular systems where function is

related to structure and dynamics. Such systems are in the middle of the

hierarchy of models: very fast motions and the fate of electronically excited

states require quantum-dynamical treatment, while the sheer size of the sys-

tems and the long time span of events often require severe approximations

and coarse-grained approaches. Proper and e¬cient sampling of the con-

¬gurational space (e.g., in the prediction of protein folding and other rare

events) poses special problems and requires innovative solutions. The fun

of simulation methods is that they may use physically impossible pathways

to reach physically possible states; thus they allow a range of innovative

phantasies that are not available to experimental scientists.

This book contains sample programs for educational purposes, but it con-

tains no programs that are optimized to run on large or complex systems.

For real applications that require molecular or stochastic dynamics or en-

ergy minimization, the reader is referred to the public-domain program suite

Gromacs (http://www.gromacs.org), which has been described by Van der

Spoel et al. (2005).

Programming examples are given in Python, a public domain interpreta-

tive object-oriented language that is both simple and powerful. For those

who are not familiar with Python, the example programs will still be intel-

ligible, provided a few rules are understood:

• Indentation is essential. Consecutive statements at the same indentation

level are considered as a block, as if “ in C “ they were placed between

curly brackets.

• Python comes with many modules, which can be imported (or of which

certain elements can be imported) into the main program. For example,

after the statement import math the math module is accessible and the

sine function is now known as math.sin. Alternatively, the sine function

may be imported by from math import sin, after which it is known as sin.

One may also import all the methods and attributes of the math module

at once by the statement from math import —.

Preface xiii

• Python variables need not be declared. Some programmers don™t like this

feature as errors are more easily introduced, but it makes programs a lot

shorter and easier to read.

• Python knows several types of sequences or lists, which are very versatile

(they may contain a mix of di¬erent variable types) and can be manipu-

lated. For example, if x = [1, 2, 3] then x[0] = 1, etc. (indexing starts at

0), and x[0 : 2] or x[: 2] will be the list [1, 2]. x + [4, 5] will concatenate

x with [4, 5], resulting in the list [1, 2, 3, 4, 5]. x — 2 will produce the list

[1, 2, 3, 1, 2, 3]. A multidimensional list, as x = [[1, 2], [3, 4]] is accessed

as x[i][j], e.g., x[0][1] = 2. The function range(3) will produce the list

[0, 1, 2]. One can run over the elements of a list x by the statement for i

in range(len(x)): . . .

• The extra package numpy (numerical python) which is not included in the

standard Python distribution, provides (multidimensional) arrays with

¬xed size and with all elements of the same type, that have fast methods

or functions like matrix multiplication, linear solver, etc. The easiest way

to include numpy and “ in addition “ a large number of mathematical and

statistical functions, is to install the package scipy (scienti¬c python). The

function arange acts like range, but de¬nes an array. An array element is

accessed as x[i, j]. Addition, multiplication etc. now work element-wise

on arrays. The package de¬nes the very useful universal functions that

also work on arrays. For example, if x = array([1, 2, 3]), sin(x — pi/2) will

be array([1., 0., ’1.]).

The reader who wishes to try out the sample programs, should install in

this order: a recent version of Python (http://www.python.org), numpy and

scipy (http://www.scipy.org) on his system. The use of the IDLE Python

shell is recommended. For all sample programs in this book it is assumed

that scipy has been imported:

from scipy import *

This imports universal functions as well, implying that functions like sin are

known and need not be imported from the math module. The programs in

this book can be downloaded from the Cambridge University Press website

(http://www.cambridge.org/9780521835275) or from the author™s website

(http://www.hjcb.nl). These sites also o¬er additional Python modules that

are useful in the context of this book: plotps for plotting data, producing

postscript ¬les, and physcon containing all relevant physical constants in SI

xiv Preface

units. Instructions for the installation and use of Python are also given on

the author™s website.

This book could not have been written without the help of many for-

mer students and collaborators. It would never have been written with-

out the stimulating scienti¬c environment in the Chemistry Department of

the University of Groningen, the superb guidance into computer simulation

methods by Aneesur Rahman (1927“1987) in the early 1970s, the pioneering

atmosphere of several interdisciplinary CECAM workshops, and the fruitful

collaboration with Wilfred van Gunsteren between 1976 and 1992. Many

ideas discussed in this book have originated from collaborations with col-

leagues, often at CECAM, postdocs and graduate students, of whom I can

only mention a few here: Andrew McCammon, Jan Hermans, Giovanni Ci-

ccotti, Jean-Paul Ryckaert, Alfredo DiNola, Ra´l Grigera, Johan Postma,

u

Tjerk Straatsma, Bert Egberts, David van der Spoel, Henk Bekker, Pe-

ter Ahlstr¨m, Siewert-Jan Marrink, Andrea Amadei, Janez Mavri, Bert de

o

Groot, Steven Hayward, Alan Mark, Humberto Saint-Martin and Berk Hess.

I thank Frans van Hoesel, Tsjerk Wassenaar, Farid Abraham, Alex de Vries,

Agur Sevink and Florin Iancu for providing pictures.

Finally, I thank my wife Lia for her endurance and support; to her I

dedicate this book.

Symbols, units and constants

Symbols

The typographic conventions and special symbols used in this book are listed

in Table 1; Latin and Greek symbols are listed in Tables 2, 3, and 4. Symbols

that are listed as vectors (bold italic, e.g., r) may occur in their roman italic

version (r = |r|) signifying the norm (absolute value or magnitude) of the

vector, or in their roman bold version (r) signifying a one-column matrix of

vector components. The reader should be aware that occasionally the same

symbol has a di¬erent meaning when used in a di¬erent context. Symbols

that represent general quantities as a, unknowns as x, functions as f (x), or

numbers as i, j, n are not listed.

Units

This book adopts the SI system of units (Table 5). The SI units (Syst`me e

International d™Unit´s) were agreed in 1960 by the CGPM, the Conf´rence

e e

G´n´rale des Poids et Mesures. The CGPM is the general conference of

ee

countries that are members of the Metre Convention. Virtually every coun-

try in the world is a member or associate, including the USA, but not all

member countries have strict laws enforcing the use of SI units in trade

and commerce.1 Certain units that are (still) popular in the USA, such as

inch (2.54 cm), ˚ngstr¨m (10’10 m), kcal (4.184 kJ), dyne (10’5 N), erg

A o

’7 J), bar (105 Pa), atm (101 325 Pa), electrostatic units, and Gauss

(10

units, in principle have no place in this book. Some of these, such as the ˚

A

and bar, which are decimally related to SI units, will occasionally be used.

Another exception that will occasionally be used is the still popular Debye

for dipole moment (10’29 /2.997 924 58 Cm); the Debye relates decimally

1 A European Union directive on the enforcement of SI units, issued in 1979, has been incorpo-

rated in the national laws of most EU countries, including England in 1995.

xv

xvi Symbols, units and constants