Abstract
Hard spheres are arguably one of the most fundamental model systems in soft matter physics, and hence a common topic of simulation studies. Event-driven simulation methods provide an efficient method for studying the phase behavior and dynamics of hard spheres under a wide range of different conditions. Here, we examine the impact of several optimization strategies for speeding up event-driven molecular dynamics of hard spheres and present a light-weight simulation code that outperforms existing simulation codes over a large range of system sizes and packing fractions. The presented differences in simulation speed, typically a factor of five to ten, save significantly on both CPU time and energy consumption and may be a crucial factor for studying slow processes such as crystal nucleation and glassy dynamics.
Graphic Abstract
Similar content being viewed by others
Change history
11 April 2022
A Correction to this paper has been published: https://doi.org/10.1140/epje/s10189-022-00187-1
Notes
Note that in principle, it is possible to implement a variation on this approach where the shell size of a specific particle is temporarily reduced if too many neighbors are encountered [52], but this was found to be unnecessary for the systems considered here, where a good upper bound on the maximum number of nearest neighbors can be estimated.
Note that small modifications to the initialization and output of the code were made to allow the code to read in an initial configuration and report the elapsed time during the simulation.
Note that this effect does not hold for the cell list updates in the CellList code: for a homogeneous system, the average (bidirectional) flux of particles through any cell wall is only a function of the particle density and the typical speed (i.e., temperature) of the particles. While some particles may be trapped for a long time in a single cell, this is compensated by other particles trapped vibrating around the edge of a cell and hence undergoing many cell crossings.
It should be noted that the number of NEC displacements per second in Table 1 is significantly lower than those reported in Ref. [45], especially for larger systems. We attribute this to our protocol of filling up the CPU with an identical number of jobs when performing benchmarks. When running only a single job per CPU, we observe performance in line with Ref. [45], with EDMD still outperforming NEC in terms of displacements per second.
References
P.N. Pusey, W. Van Megen, Nature 320, 340 (1986)
W.K. Kegel, A. van Blaaderen, Science 287, 290 (2000)
C.P. Royall, W.C. Poon, E.R. Weeks, Soft Matter 9, 17 (2013)
D. Frenkel, A.J. Ladd, J. Chem. Phys. 81, 3188 (1984)
T. Biben, J.-P. Hansen, Phys. Rev. Lett. 66, 2215 (1991)
M. Dijkstra, R. van Roij, R. Evans, Phys. Rev. Lett. 81, 2268 (1998)
M. Dijkstra, Phys. Rev. E 58, 7523 (1998)
M. Dijkstra, R. van Roij, R. Evans, Phys. Rev. E 59, 5744 (1999)
L. Filion, M. Hermes, R. Ni, E. Vermolen, A. Kuijk, C. Christova, J. Stiefelhagen, T. Vissers, A. Van Blaaderen, M. Dijkstra, Phys. Rev. Lett. 107, 168302 (2011)
P.K. Bommineni, N.R. Varela-Rosales, M. Klement, M. Engel, Phys. Rev. Lett. 122, 128005 (2019)
P.K. Bommineni, M. Klement, M. Engel, Phys. Rev. Lett. 124, 218003 (2020)
M. Schmidt, H. Löwen, Phys. Rev. E 55, 7228 (1997)
A. Fortini, M. Dijkstra, J. Phys. Condens. Matter 18, L371 (2006)
M. Gordillo, B. Martínez-Haya, J.M. Romero-Enrique, J. Chem. Phys. 125, 144702 (2006)
E.C. Oğuz, M. Marechal, F. Ramiro-Manzano, I. Rodriguez, R. Messina, F.J. Meseguer, H. Löwen, Phys. Rev. Lett. 109, 218301 (2012)
B. De Nijs, S. Dussi, F. Smallenburg, J.D. Meeldijk, D.J. Groenendijk, L. Filion, A. Imhof, A. Van Blaaderen, M. Dijkstra, Nat. Mater. 14, 56 (2015)
G. Jung, C.F. Petersen, Phys. Rev. Res. 2, 033207 (2020)
D. Wang, T. Dasgupta, E.B. van der Wee, D. Zanaga, T. Altantzis, Y. Wu, G.M. Coli, C.B. Murray, S. Bals, M. Dijkstra et al., Nat. Phys. 17, 128 (2021)
S. Auer, D. Frenkel, Nature 409, 1020 (2001)
S. Punnathanam, P. Monson, J. Chem. Phys. 125, 024508 (2006)
L. Filion, M. Hermes, R. Ni, M. Dijkstra, J. Chem. Phys. 133, 244115 (2010)
R. Ni, F. Smallenburg, L. Filion, M. Dijkstra, Mol. Phys. 109, 1213 (2011)
J.T. Berryman, M. Anwar, S. Dorosz, T. Schilling, J. Chem. Phys. 145, 211901 (2016)
D. Richard, T. Speck, J. Chem. Phys. 148, 124110 (2018)
N. Wood, J. Russo, F. Turci, C.P. Royall, J. Chem. Phys. 149, 204506 (2018)
J.R. Espinosa, C. Vega, C. Valeriani, D. Frenkel, E. Sanz, Soft Matter 15, 9625 (2019)
M. Rintoul, S. Torquato, J. Chem. Phys. 105, 9258 (1996)
R.J. Speedy, Mol. Phys. 95, 169 (1998)
M. Leocmach, H. Tanaka, Nat. Commun. 3, 1 (2012)
E. Sanz, C. Valeriani, E. Zaccarelli, W.C. Poon, M.E. Cates, P.N. Pusey, Proc. Natl. Acad. Sci. 111, 75 (2014)
P. Urbani, F. Zamponi, Phys. Rev. Lett. 118, 038001 (2017)
L. Berthier, P. Charbonneau, D. Coslovich, A. Ninarello, M. Ozawa, S. Yaida, Proc. Natl. Acad. Sci. 114, 11356 (2017)
E. Lázaro-Lázaro, J.A. Perera-Burgos, P. Laermann, T. Sentjabrskaja, G. Pérez-Ángel, M. Laurati, S.U. Egelhaaf, M. Medina-Noyola, T. Voigtmann, R. Castañeda-Priego et al., Phys. Rev. E 99, 042603 (2019)
S. Marín-Aguilar, H.H. Wensink, G. Foffi, F. Smallenburg, Phys. Rev. Lett. 124, 208005 (2020)
E. Boattini, F. Smallenburg, L. Filion, Phys. Rev. Lett. 127, 088007 (2021)
E. Boattini, S. Marín-Aguilar, S. Mitra, G. Foffi, F. Smallenburg, L. Filion, Nat. Commun. 11, 1 (2020)
M.N. Rosenbluth, A.W. Rosenbluth, J. Chem. Phys. 22, 881 (1954)
W.W. Wood, J. Jacobson, J. Chem. Phys. 27, 1207 (1957)
D. Frenkel, B. Smit, Understanding Molecular Simulations: From Algorithms to Applications (Academic Press, San Diego, 2002)
C. Dress, W. Krauth, J. Phys. A Math. Gen. 28, L597 (1995)
N.G. Almarza, J. Chem. Phys. 130, 184106 (2009)
D.J. Ashton, N.B. Wilding, R. Roth, R. Evans, Phys. Rev. E 84, 061136 (2011)
L. Berthier, D. Coslovich, A. Ninarello, M. Ozawa, Phys. Rev. Lett. 116, 238002 (2016)
E.P. Bernard, W. Krauth, D.B. Wilson, Phys. Rev. E 80, 056704 (2009)
M. Klement, M. Engel, J. Chem. Phys. 150, 174108 (2019)
E. Sanz, D. Marenduzzo, J. Chem. Phys. 132, 194102 (2010)
A. Cuetos, A. Patti, Phys. Rev. E 92, 022302 (2015)
B.J. Alder, T.E. Wainwright, J. Chem. Phys. 27, 1208 (1957)
A. Scala, T. Voigtmann, C. De Michele, J. Chem. Phys. 126, 134109 (2007)
A. Scala, Phys. Rev. E 86, 026709 (2012)
G. Paul, J. Comput. Phys. 221, 615 (2007)
A. Donev, S. Torquato, F.H. Stillinger, J. Comput. Phys. 202, 737 (2005)
B.D. Lubachevsky, J. Comput. Phys. 94, 255 (1991)
M.N. Bannerman, R. Sargant, L. Lue, J. Comput. Chem. 32, 3329 (2011)
D.C. Rapaport, D.C.R. Rapaport, The Art of Molecular Dynamics Simulation (Cambridge University Press, Cambridge, 2004)
C. De Michele, J. Comput. Phys. 229, 3276 (2010)
M. Marın, D. Risso, P. Cordero, J. Comput. Phys. 109, 306 (1993)
M. Marín, P. Cordero, Comput. Phys. Commun. 92, 214 (1995)
M.A. Khan, M.C. Herbordt, J. Comput. Phys. 230, 6563 (2011)
https://github.com/glotzerlab/hoomd-blue/tree/newtonian_event_chain_monte_carlo. Accessed 14 Oct 2021
J.A. Anderson, J. Glaser, S.C. Glotzer, Comput. Mater. Sci. 173, 109363 (2020)
M. Klement, S. Lee, J.A. Anderson, M. Engel. arXiv preprint arXiv:2104.06829 (2021)
J.A. Anderson, E. Jankowski, T.L. Grubb, M. Engel, S.C. Glotzer, J. Comput. Phys. 254, 27 (2013)
M. Engel, J.A. Anderson, S.C. Glotzer, M. Isobe, E.P. Bernard, W. Krauth, Phys. Rev. E 87, 042134 (2013)
S. Miller, S. Luding, J. Comput. Phys. 193, 306 (2004)
A. Donev, S. Torquato, F.H. Stillinger, J. Comput. Phys. 202, 765 (2005)
L. Hernández de la Peña, R. van Zon, J. Schofield, S.B. Opps, J. Chem. Phys. 126, 074105 (2007)
F. Smallenburg, L. Filion, M. Marechal, M. Dijkstra, Proc. Natl. Acad. Sci. 109, 17886 (2012)
F. Smallenburg, F. Sciortino, Nat. Phys. 9, 554 (2013)
S. Marín-Aguilar, H.H. Wensink, G. Foffi, F. Smallenburg, Soft Matter 15, 9886 (2019)
Acknowledgements
I would like to thank Michael Engel, Marco Klement, and Joshua Anderson for helpful discussions and aid in the comparison with the Newtonian Event Chain algorithm, and Laura Filion for many useful discussions.
Author information
Authors and Affiliations
Additional information
The original online version of this article was revised to correct equation 2.
Rights and permissions
About this article
Cite this article
Smallenburg, F. Efficient event-driven simulations of hard spheres. Eur. Phys. J. E 45, 22 (2022). https://doi.org/10.1140/epje/s10189-022-00180-8
Received:
Accepted:
Published:
DOI: https://doi.org/10.1140/epje/s10189-022-00180-8