Skip to main content
Log in

Efficient event-driven simulations of hard spheres

  • Tips and Tricks - Soft Matter
  • Published:
The European Physical Journal E Aims and scope Submit manuscript

A Correction to this article was published on 11 April 2022

This article has been updated

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

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3

Similar content being viewed by others

Change history

Notes

  1. It should be noted that variations on EDMD that simulate Brownian [49] or Langevin [50] dynamics have been developed as well.

  2. 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.

  3. 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.

  4. 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.

  5. 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

  1. P.N. Pusey, W. Van Megen, Nature 320, 340 (1986)

    Article  ADS  Google Scholar 

  2. W.K. Kegel, A. van Blaaderen, Science 287, 290 (2000)

    Article  ADS  Google Scholar 

  3. C.P. Royall, W.C. Poon, E.R. Weeks, Soft Matter 9, 17 (2013)

    Article  ADS  Google Scholar 

  4. D. Frenkel, A.J. Ladd, J. Chem. Phys. 81, 3188 (1984)

    Article  ADS  Google Scholar 

  5. T. Biben, J.-P. Hansen, Phys. Rev. Lett. 66, 2215 (1991)

    Article  ADS  Google Scholar 

  6. M. Dijkstra, R. van Roij, R. Evans, Phys. Rev. Lett. 81, 2268 (1998)

    Article  ADS  Google Scholar 

  7. M. Dijkstra, Phys. Rev. E 58, 7523 (1998)

    Article  ADS  Google Scholar 

  8. M. Dijkstra, R. van Roij, R. Evans, Phys. Rev. E 59, 5744 (1999)

    Article  ADS  Google Scholar 

  9. 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)

    Article  ADS  Google Scholar 

  10. P.K. Bommineni, N.R. Varela-Rosales, M. Klement, M. Engel, Phys. Rev. Lett. 122, 128005 (2019)

    Article  ADS  Google Scholar 

  11. P.K. Bommineni, M. Klement, M. Engel, Phys. Rev. Lett. 124, 218003 (2020)

    Article  ADS  Google Scholar 

  12. M. Schmidt, H. Löwen, Phys. Rev. E 55, 7228 (1997)

    Article  ADS  Google Scholar 

  13. A. Fortini, M. Dijkstra, J. Phys. Condens. Matter 18, L371 (2006)

    Article  ADS  Google Scholar 

  14. M. Gordillo, B. Martínez-Haya, J.M. Romero-Enrique, J. Chem. Phys. 125, 144702 (2006)

    Article  ADS  Google Scholar 

  15. 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)

    Article  ADS  Google Scholar 

  16. 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)

    Article  ADS  Google Scholar 

  17. G. Jung, C.F. Petersen, Phys. Rev. Res. 2, 033207 (2020)

    Article  Google Scholar 

  18. 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)

    Article  Google Scholar 

  19. S. Auer, D. Frenkel, Nature 409, 1020 (2001)

    Article  ADS  Google Scholar 

  20. S. Punnathanam, P. Monson, J. Chem. Phys. 125, 024508 (2006)

    Article  ADS  Google Scholar 

  21. L. Filion, M. Hermes, R. Ni, M. Dijkstra, J. Chem. Phys. 133, 244115 (2010)

    Article  ADS  Google Scholar 

  22. R. Ni, F. Smallenburg, L. Filion, M. Dijkstra, Mol. Phys. 109, 1213 (2011)

    Article  ADS  Google Scholar 

  23. J.T. Berryman, M. Anwar, S. Dorosz, T. Schilling, J. Chem. Phys. 145, 211901 (2016)

    Article  ADS  Google Scholar 

  24. D. Richard, T. Speck, J. Chem. Phys. 148, 124110 (2018)

    Article  ADS  Google Scholar 

  25. N. Wood, J. Russo, F. Turci, C.P. Royall, J. Chem. Phys. 149, 204506 (2018)

    Article  ADS  Google Scholar 

  26. J.R. Espinosa, C. Vega, C. Valeriani, D. Frenkel, E. Sanz, Soft Matter 15, 9625 (2019)

    Article  ADS  Google Scholar 

  27. M. Rintoul, S. Torquato, J. Chem. Phys. 105, 9258 (1996)

    Article  ADS  Google Scholar 

  28. R.J. Speedy, Mol. Phys. 95, 169 (1998)

    Article  ADS  Google Scholar 

  29. M. Leocmach, H. Tanaka, Nat. Commun. 3, 1 (2012)

    Article  Google Scholar 

  30. E. Sanz, C. Valeriani, E. Zaccarelli, W.C. Poon, M.E. Cates, P.N. Pusey, Proc. Natl. Acad. Sci. 111, 75 (2014)

    Article  ADS  Google Scholar 

  31. P. Urbani, F. Zamponi, Phys. Rev. Lett. 118, 038001 (2017)

    Article  ADS  Google Scholar 

  32. L. Berthier, P. Charbonneau, D. Coslovich, A. Ninarello, M. Ozawa, S. Yaida, Proc. Natl. Acad. Sci. 114, 11356 (2017)

    Article  ADS  Google Scholar 

  33. 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)

    Article  ADS  Google Scholar 

  34. S. Marín-Aguilar, H.H. Wensink, G. Foffi, F. Smallenburg, Phys. Rev. Lett. 124, 208005 (2020)

    Article  ADS  Google Scholar 

  35. E. Boattini, F. Smallenburg, L. Filion, Phys. Rev. Lett. 127, 088007 (2021)

    Article  ADS  Google Scholar 

  36. E. Boattini, S. Marín-Aguilar, S. Mitra, G. Foffi, F. Smallenburg, L. Filion, Nat. Commun. 11, 1 (2020)

    Article  Google Scholar 

  37. M.N. Rosenbluth, A.W. Rosenbluth, J. Chem. Phys. 22, 881 (1954)

    Article  ADS  Google Scholar 

  38. W.W. Wood, J. Jacobson, J. Chem. Phys. 27, 1207 (1957)

    Article  ADS  Google Scholar 

  39. D. Frenkel, B. Smit, Understanding Molecular Simulations: From Algorithms to Applications (Academic Press, San Diego, 2002)

    MATH  Google Scholar 

  40. C. Dress, W. Krauth, J. Phys. A Math. Gen. 28, L597 (1995)

    Article  ADS  Google Scholar 

  41. N.G. Almarza, J. Chem. Phys. 130, 184106 (2009)

    Article  ADS  Google Scholar 

  42. D.J. Ashton, N.B. Wilding, R. Roth, R. Evans, Phys. Rev. E 84, 061136 (2011)

    Article  ADS  Google Scholar 

  43. L. Berthier, D. Coslovich, A. Ninarello, M. Ozawa, Phys. Rev. Lett. 116, 238002 (2016)

    Article  ADS  MathSciNet  Google Scholar 

  44. E.P. Bernard, W. Krauth, D.B. Wilson, Phys. Rev. E 80, 056704 (2009)

    Article  ADS  Google Scholar 

  45. M. Klement, M. Engel, J. Chem. Phys. 150, 174108 (2019)

    Article  ADS  Google Scholar 

  46. E. Sanz, D. Marenduzzo, J. Chem. Phys. 132, 194102 (2010)

    Article  ADS  Google Scholar 

  47. A. Cuetos, A. Patti, Phys. Rev. E 92, 022302 (2015)

    Article  ADS  Google Scholar 

  48. B.J. Alder, T.E. Wainwright, J. Chem. Phys. 27, 1208 (1957)

    Article  ADS  Google Scholar 

  49. A. Scala, T. Voigtmann, C. De Michele, J. Chem. Phys. 126, 134109 (2007)

    Article  ADS  Google Scholar 

  50. A. Scala, Phys. Rev. E 86, 026709 (2012)

    Article  ADS  Google Scholar 

  51. G. Paul, J. Comput. Phys. 221, 615 (2007)

    Article  ADS  Google Scholar 

  52. A. Donev, S. Torquato, F.H. Stillinger, J. Comput. Phys. 202, 737 (2005)

    Article  ADS  MathSciNet  Google Scholar 

  53. B.D. Lubachevsky, J. Comput. Phys. 94, 255 (1991)

    Article  ADS  MathSciNet  Google Scholar 

  54. M.N. Bannerman, R. Sargant, L. Lue, J. Comput. Chem. 32, 3329 (2011)

    Article  Google Scholar 

  55. D.C. Rapaport, D.C.R. Rapaport, The Art of Molecular Dynamics Simulation (Cambridge University Press, Cambridge, 2004)

    Book  MATH  Google Scholar 

  56. C. De Michele, J. Comput. Phys. 229, 3276 (2010)

    Article  ADS  MathSciNet  Google Scholar 

  57. M. Marın, D. Risso, P. Cordero, J. Comput. Phys. 109, 306 (1993)

    Article  ADS  Google Scholar 

  58. M. Marín, P. Cordero, Comput. Phys. Commun. 92, 214 (1995)

    Article  ADS  Google Scholar 

  59. M.A. Khan, M.C. Herbordt, J. Comput. Phys. 230, 6563 (2011)

    Article  ADS  Google Scholar 

  60. https://github.com/glotzerlab/hoomd-blue/tree/newtonian_event_chain_monte_carlo. Accessed 14 Oct 2021

  61. J.A. Anderson, J. Glaser, S.C. Glotzer, Comput. Mater. Sci. 173, 109363 (2020)

    Article  Google Scholar 

  62. M. Klement, S. Lee, J.A. Anderson, M. Engel. arXiv preprint arXiv:2104.06829 (2021)

  63. J.A. Anderson, E. Jankowski, T.L. Grubb, M. Engel, S.C. Glotzer, J. Comput. Phys. 254, 27 (2013)

  64. M. Engel, J.A. Anderson, S.C. Glotzer, M. Isobe, E.P. Bernard, W. Krauth, Phys. Rev. E 87, 042134 (2013)

    Article  ADS  Google Scholar 

  65. S. Miller, S. Luding, J. Comput. Phys. 193, 306 (2004)

    Article  ADS  Google Scholar 

  66. A. Donev, S. Torquato, F.H. Stillinger, J. Comput. Phys. 202, 765 (2005)

    ADS  MathSciNet  Google Scholar 

  67. L. Hernández de la Peña, R. van Zon, J. Schofield, S.B. Opps, J. Chem. Phys. 126, 074105 (2007)

  68. F. Smallenburg, L. Filion, M. Marechal, M. Dijkstra, Proc. Natl. Acad. Sci. 109, 17886 (2012)

    Article  ADS  Google Scholar 

  69. F. Smallenburg, F. Sciortino, Nat. Phys. 9, 554 (2013)

    Article  Google Scholar 

  70. S. Marín-Aguilar, H.H. Wensink, G. Foffi, F. Smallenburg, Soft Matter 15, 9886 (2019)

    Article  ADS  Google Scholar 

Download references

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

Authors

Additional information

The original online version of this article was revised to correct equation 2.

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

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

Download citation

  • Received:

  • Accepted:

  • Published:

  • DOI: https://doi.org/10.1140/epje/s10189-022-00180-8

Navigation