You are on page 1of 7

Monte Carlo Methods

in Statistical Physics
M. E. J. NEWMAN
Santa Fe Institute
and
G. T. BARKEMA
Institute for Theoretical Physics
Utrecht University

C L A R E N D O N PRESS • O X F O R D
Contents

I Equilibrium Monte Carlo simulations


1 Introduction 3
1.1 Statistical mechanics 3
1.2 Equilibrium 7
1.2.1 Fluctuations, correlations and responses 10
1.2.2 An example: the Ising model 15
1.3 Numerical methods 18
1.3.1 Monte Carlo Simulation 21
1.4 A brief history of the Monte Carlo method 22
Problems 29

2 The principles of equilibrium thermal Monte Carlo


Simulation 31
2.1 The estimator 31
2.2 Importance sampling 33
2.2.1 Markov processes 34
2.2.2 Ergodicity 35
2.2.3 Detailed balance 36
2.3 Acceptance ratios 40
2.4 Continuous time Monte Carlo 42
Problems 44

3 The Ising model and the Metropolis algorithm 45


3.1 The Metropolis algorithm 46
3.1.1 Implementing the Metropolis algorithm 49
3.2 Equilibration 53
3.3 Measurement 57
3.3.1 Autocorrelation functions 59
3.3.2 Correlation times and Markov matrices 65
3.4 Calculation of errors 68
3.4.1 Estimation of Statistical errors 68
3.4.2 The blocking method 69
x Contents

3.4.3 The bootstrap method 71


3.4.4 The jackknife method 72
3.4.5 Systematic errors 73
3.5 Measuring the entropy 73
3.6 Measuring correlation functions 74
3.7 An actual calculation 76
3.7.1 The phase transition 82
3.7.2 Critical fluctuations and critical slowing down 84
Problems 85

4 Other algorithms for the Ising model 87


4.1 Critical exponents and their measurement 87
4.2 The Wolff algorithm 91
4.2.1 Acceptance ratio for a Cluster algorithm 93
4.3 Properties of the Wolff algorithm 96
4.3.1 The correlation time and the dynamic exponent . . . 100
4.3.2 The dynamic exponent and the susceptibility 102
4.4 Further algorithms for the Ising model 106
4.4.1 The Swendsen-Wang algorithm 106
4.4.2 Niedermayer's algorithm 109
4.4.3 Multigrid methods 112
4.4.4 The invaded Cluster algorithm 114
4.5 Other spin modeis 119
4.5.1 Potts modeis 120
4.5.2 Cluster algorithms for Potts modeis 125
4.5.3 Continuous spin modeis 127
Problems 132

5 The conserved-order-parameter Ising model 133


5.1 The Kawasaki algorithm 138
5.1.1 Simulation of interfaces 140
5.2 More efficient algorithms 141
5.2.1 A continuous time algorithm 143
5.3 Equilibrium crystal shapes 145
Problems 150

6 Disordered spin modeis 151


6.1 Glassy Systems 153
6.1.1 The random-field Ising model 154
6.1.2 Spin glasses 157
6.2 Simulation of glassy Systems 159
6.3 The entropic sampling method . 161
6.3.1 Making measurements 162
6.3.2 Internal energy and specific heat 163
Contents xi

6.3.3 Implementing the entropic sampling method 164


6.3.4 An example: the random-field Ising model 166
6.4 Simulated tempering 169
6.4.1 The method 169
6.4.2 Variations 174
Problems 177

7 Ice modeis 179


7.1 Real ice and ice modeis 179
7.1.1 Arrangement of the protons 182
7.1.2 Residual entropy of ice 183
7.1.3 Three-colour modeis 186
7.2 Monte Carlo algorithms for Square ice 187
7.2.1 The Standard ice model algorithm 188
7.2.2 Ergodicity 189
7.2.3 Detailed balance 191
7.3 An alternative algorithm 191
7.4 Algorithms for the three-colour model 193
7.5 Comparison of algorithms for square ice 196
7.6 Energetic ice modeis 201
7.6.1 Loop algorithms for energetic ice modeis 202
7.6.2 Cluster algorithms for energetic ice modeis 205
Problems 209

8 Analysing Monte Carlo data 210


8.1 The Single histogram method 211
8.1.1 Implementation 217
8.1.2 Extrapolating in other variables 218
8.2 The multiple histogram method 219
8.2.1 Implementation 226
8.2.2 Interpolating other variables 228
8.3 Finite size scaling 229
8.3.1 Direct measurement of critical exponents 230
8.3.2 The finite size scaling method 232
8.3.3 DifRculties with the finite size scaling method 236
8.4 Monte Carlo renormalization group 240
8.4.1 Real-space renormalization 240
8.4.2 Calculating critical exponents: the exponent v . . . . 246
8.4.3 Calculating other exponents 250
8.4.4 The exponents 6 and 6 251
8.4.5 More accurate transformations 252
8.4.6 Measuring the exponents 256
Problems 258
xii Contents

II Out-of-equilibrium simulations
9 Out-of-equilibrium Monte Carlo simulations 263
9.1 Dynamics '. 264
9.1.1 Choosing the dynamics 266

10 Non-equilibrium simulations of the Ising model 268


10.1 Phase Separation and the Ising model 268
10.1.1 Phase Separation in the ordinary Ising model 271
10.1.2 Phase Separation in the COP Ising model 271
10.2 Measuring domain size 274
10.2.1 Correlation functions 274
10.2.2 Structure factors 277
10.3 Phase Separation in the 3D Ising model 278
10.3.1 A more efficient algorithm 279
10.3.2 A continuous time algorithm 280
10.4 An alternative dynamics 282
10.4.1 Bulk diffusion and surface diffusion 283
10.4.2 A bulk diffusion algorithm 284
Problems 288

11 Monte Carlo simulations in surface science 289


11.1 Dynamics, algorithms and energy barriers 292
11.1.1 Dynamics of a Single adatom 293
11.1.2 Dynamics of many adatoms 296
11.2 Implementation 301
11.2.1 Kawasaki and bond-counting algorithms 301
11.2.2 Lookup table algorithms 302
11.3 An example: molecular beam epitaxy 304
Problems 306

12 The repton model 307


12.1 Electrophoresis 307
12.2 The repton model 309
12.2.1 The projected repton model 313
12.2.2 Values of the parameters in the model 314
12.3 Monte Carlo Simulation of the repton model 315
12.3.1 Improving the algorithm 316
12.3.2 Further improvements 318
12.3.3 Representing configurations of the repton model . . . 320
12.4 Results of Monte Carlo simulations 322
12.4.1 Simulations in zero electric field 323
12.4.2 Simulations in non-zero electric field 323
Problems 327
Contents xiii

III Implementation
13 Lattices and data structures 331
13.1 Representing lattices on a Computer 332
13.1.1 Square and cubic lattices 332
13.1.2 Triangulär, honeycomb and Kagome lattices 335
13.1.3 Fcc, bcc and diamond lattices 340
13.1.4 General lattices 342
13.2 Data structures 343
13.2.1 Variables 343
13.2.2 Arrays 345
13.2.3 Linked lists 345
13.2.4 Trees 348
13.2.5 Buffers 352
Problems 355

14 Monte Carlo simulations on parallel Computers 356


14.1 Trivially parallel algorithms 358
14.2 More sophisticated parallel algorithms 359
14.2.1 The Ising model with the Metropolis algorithm . . . . 359
14.2.2 The Ising model with a cluster algorithm 361
Problems 362

15 Multispin coding 364


15.1 The Ising model 365
15.1.1 The one-dimensional Ising model . . . 365
15.1.2 The two-dimensional Ising model 367
15.2 Implementing multispin-coded algorithms 369
15.3 Truth tables and Karnaugh maps 369
15.4 A multispin-coded algorithm for the repton model 373
15.5 Synchronous update algorithms 379
Problems 380

16 Random numbers 382


16.1 Generating uniformly distributed random numbers 382
16.1.1 True random numbers 384
16.1.2 Pseudo-random numbers 385
16.1.3 Linear congruential generators 386
16.1.4 Improving the linear congruential generator 390
16.1.5 Shift register generators 392
16.1.6 Lagged Fibonacci generators 393
16.2 Generating non-uniform random numbers 396
16.2.1 The transformation method 396
16.2.2 Generating Gaussian random numbers 399
xiv Contents

16.2.3 The rejection method 401


16.2.4 The hybrid method 404
16.3 Generating random bits 406
Problems 409

References 410

Appendices
A Answers to problems 417

B Sample programs 433


B.l Algorithms for the Ising model 433
B.l.l Metropolis algorithm 433
B.1.2 Multispin-coded Metropolis algorithm 435
B.1.3 Wolff algorithm 437
B.2 Algorithms for the COP Ising model 438
B.2.1 Non-local algorithm 438
B.2.2 Continuous time algorithm 441
B.3 Algorithms for Potts modeis 445
B.4 Algorithms for ice modeis 448
B.5 Random number generators 451
B.5.1 Linear congruential generator 451
B.5.2 Shuffled linear congruential generator 452
B.5.3 Lagged Fibonacci generator 452

Index 455

You might also like