以公共产品博弈为例的课堂高性能并行计算
High-performance parallel computing in the classroom using the public goods game as an example
摘要:
计算机在统计物理学中的使用很普遍,因为描述整个系统粒子行为的方程数量庞大,通常不可能精确求解。蒙特卡罗方法是解决统计物理问题的一类特别重要的数值方法。虽然这些方法在原理上很简单,但它们的正确使用需要很好地掌握统计力学,以及相当多的计算资源。本文的目的是演示如何在个人计算机上广泛使用的图形卡可以提高计算能力的蒙特卡罗模拟的数量级,从而允许现场课堂演示的现象,否则将遥不可及。作为一个例子,我们使用的公共产品的游戏在一个正方形的格子,两个战略竞争的共同资源,在社会困境的情况下。我们表明,二阶相变的吸收相在系统中属于定向渗流普适类,我们比较所需的时间,通过主处理器,并通过一个合适的图形卡达到这一结果。在过去的十年中,图形处理单元上的并行计算得到了积极的发展,对于熟悉编程的人来说,今天的入门学习曲线并不陡峭。因此,这个问题是成熟的研究生和高级本科课程,我们希望本文将促进这一进程中的物理教育领域。为此,我们提供了一个记录的源代码,方便再现所提出的结果和进一步发展的蒙特卡罗模拟类似的系统。
英文摘要:
The use of computers in statistical physics is common because the sheer number of equations that describe the behavior of an entire system particle by particle often makes it impossible to solve them exactly. Monte Carlo methods form a particularly important class of numerical methods for solving problems in statistical physics. Although these methods are simple in principle, their proper use requires a good command of statistical mechanics, as well as considerable computational resources. The aim of this paper is to demonstrate how the usage of widely accessible graphics cards on personal computers can elevate the computing power in Monte Carlo simulations by orders of magnitude, thus allowing live classroom demonstration of phenomena that would otherwise be out of reach. As an example, we use the public goods game on a square lattice where two strategies compete for common resources in a social dilemma situation. We show that the second-order phase transition to an absorbing phase in the system belongs to the directed percolation universality class, and we compare the time needed to arrive at this result by means of the main processor and by means of a suitable graphics card. Parallel computing on graphics processing units has been developed actively during the last decade, to the point where today the learning curve for entry is anything but steep for those familiar with programming. The subject is thus ripe for inclusion in graduate and advanced undergraduate curricula, and we hope that this paper will facilitate this process in the realm of physics education. To that end, we provide a documented source code for an easy reproduction of presented results and for further development of Monte Carlo simulations of similar systems.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。