Computer Simulation of liquids M.P.ALLEN H.H.Wills Physics Laboratory University of Bristol and D.J.TILDESLEY Department of Chemistry The University,Southampton CLARENDON PRESS OXFORD
To Diane and Pauline
PREFACE This is a 'how-to-do-it'book for people who want to use computers to simulate the behaviour of atomic and molecular liquids.We hope that it will be useful to first-year graduate students,research workers in industry and academia,and to teachers and lecturers who want to use the computer to illustrate the way liquids behave. Getting started is the main barrier to writing a simulation program.Few people begin their research into liquids by sitting down and composing a program from scratch.Yet these programs are not inherently complicated: there are just a few pitfalls to be avoided.In the past,many simulation programs have been handed down from one research group to another and from one generation of students to the next.Indeed,with a trained eye,it is possible to trace many programs back to one of the handful of groups working in the field 20 years ago.Technical details such as methods for improving the speed of the program or for avoiding common mistakes are often buried in the appendices of publications or passed on by word of mouth.In the first six chapters of this book,we have tried to gather together these details and to present a clear account of the techniques,namely Monte Carlo and molecular dynamics.The hope is that a graduate student could use these chapters to write his own program. The field of computer simulation has enjoyed rapid advances in the last five years.Smart Monte Carlo sampling techniques have been introduced and tested,and the molecular dynamics method has been extended to simulate various ensembles.The techniques have been merged into a new field of stochastic simulations and extended to cover quantum-mechanical as well as classical systems.A book on simulation would be incomplete without some mention of these advances and we have tackled them in Chapters 7 to 10. Chapter 1I contains a brief account of some interesting problems to which the methods have been applied.Our choices in this chapter are subjective and our coverage far from exhaustive.The aim is to give the reader a taste rather than a feast.Finally we have included examples of computer code to illustrate points made in the text,and have provided a wide selection of useful routines which are available on-line from two sources.We have not attempted to tackle the important areas of solid state simulation and protein molecular mechanics. The techniques discussed in this book are useful in these fields,but additionally much weight is given to energy minimization rather than the simulation of systems at non-zero temperatures.The vast field of lattice dynamics is discussed in many other texts. Both of us were fortunate in that we had expert guidance when starting work in the field,and we would like to take this opportunity to thank P.Schofield (Harwell)and W.B.Streett (Cornell),who set us on the right
viii PREFACE road some years ago.This book was largely written and created at the Physical Chemistry Laboratory,Oxford,where both of us have spent a large part of our research careers.We owe a great debt of gratitude to the head of department,J.S.Rowlinson,who has provided us with continuous en- couragement and support in this venture,as well as a meticulous criticism of early versions of the manuscript.We would also like to thank our friends and colleagues in the Physics department at Bristol and the Chemistry depart- ment at Southampton for their help and encouragement,and we are indebted to many colleagues,who in discussions at conferences and workshops, particularly those organized by CCP5 and CECAM,have helped to form our ideas.We cannot mention all by name,but should say that conversations with D.Frenkel and P.A.Madden have been especially helpful.We would also like to thank M.Gillan and J.P.Ryckaert,who made useful comments on certain chapters,and I.R.McDonald who read and commented on the completed manuscript.We are grateful for the assistance of Mrs L.Hayes,at Oxford University Computing Service,where the original Microfiche was produced. Lastly,we thank Taylor and Francis for allowing us to reproduce diagrams from Molecular Physics and Advances in Physics,and ICL and Cray Research (UK)for the photographs in Fig.1.1.Detailed acknowledgements appear in the text. Books are not written without a lot of family support.One of us(DJT) wants to thank the Oaks and the Sibleys of Bicester for their hospitality during many weekends in the last three years.Our wives,Diane and Pauline,have suffered in silence during our frequent disappearances,and given us their unflagging support during the whole project.We owe them a great deal. Bristol M.P.A. Southampton D.J.T. May 1986
CONTENTS LIST OF SYMBOLS I INTRODUCTION 1 1.1 A short history of computer simulation 1 1.2 Computer simulation:motivation and applications 4 1.3 Model systems and interaction potentials 6 1.3.1 Introduction 6 1.3.2 Atomic systems 7 1.3.3 Molecular systems 12 1.3.4 Lattice systems 16 1.3.5 Calculating the potential 18 1.4 Constructing an intermolecular potential 1.4.1 Introduction 1.4.2 Building the model potential 1.4.3 Adjusting the model potential 1.5 Studying small systems 1.5.1 Introduction 1.5.2 Periodic boundary conditions 1.5.3 Potential truncation 20000023234792 1.5.4 Computer code for periodic boundaries 1.5.5 Spherical boundary conditions 2 STATISTICAL MECHANICS 33 2.1 Sampling from ensembles 2.2 Common statistical ensembles 3339 2.3 Transforming between ensembles 43 2.4 Simple thermodynamic averages 46 2.5 Fluctuations 51 2.6 Structural quantities 54 2.7 Time correlation functions and transport coefficients 58 2.8 Long-range corrections 64 2.9 Quantum corrections 65 2.10 Constraints 68 3 MOLECULAR DYNAMICS 71 3.1 Equations of motion for atomic systems 71 3.2 Finite difference methods 3 3.2.1 The Verlet algorithm 78 3.2.2 The Gear predictor-corrector 8 3.2.3 Other methods 84 3.3 Molecular dynamics of rigid non-spherical bodies 3.3.I Non-linear molecules 8 3.3.2 Linear molecules 90