JOVANA
Explore Library Glossary Getting Started Three Levels Fields How it works Mission
Join the mission
Back to the library
信息 / 计算机 1953

用快速计算机进行的状态方程计算

梅特罗波利斯、阿丽亚娜·罗森布卢斯、马歇尔·罗森布卢斯、奥古斯塔·特勒 与 爱德华·特勒

无法逐一检验所有可能?那就在它们之间随机游走——而且要走得聪明——一个简单的平均,便成了正确答案。

Choose your version
In depth · the introduction

当一个问题的可能性多到永远无法一一检验时,你依然能得到正确答案——靠的是在它们之间随机游走,而且要走得聪明。

核心想法

科学里的许多问题,最终都归结为对数目惊人的「排列」求平均——比如一团气体的平均压强,是对它分子所有可能的排列取平均。这些排列多到根本加不完,而其中绝大多数,其实无足轻重。

1953 年,洛斯阿拉莫斯的一个团队,让一台计算机去探索那些真正要紧的排列,办法是走一趟「有引导的随机游走」。无论你身在何处,都试一小步随机改变。若它通向一个更可能的去处,就去;若通向一个更不可能的去处,也去——但只以一个会随着「更糟」而变小的概率去。这样游走,你造访每一种排列的次数,恰好与它应得的相称,于是把一路所见简单地一平均,就是答案。

它是如何诞生的

它诞生在武器实验室和它们最早的电子计算机里。在洛斯阿拉莫斯,尼古拉斯·梅特罗波利斯,物理学家夫妇马歇尔与阿丽亚娜·罗森布卢斯,以及爱德华与奥古斯塔·特勒,把这个想法放到 MANIAC 上去运行——那是最早的存储程序计算机之一。「蒙特卡洛」这个借自赌城的名字,几年前由斯坦尼斯瓦夫·乌拉姆与约翰·冯·诺伊曼所创,用来指「靠随机来解题」这个更宽泛的想法。

1953 年这篇论文里谁做了什么,至今仍有争议。马歇尔·罗森布卢斯晚年说,真正的工作是他和阿丽亚娜做的——程序是她写的——而算法却冠着梅特罗波利斯的名;他还说,爱德华·特勒贡献了一个关键的早期想法。阿丽亚娜·罗森布卢斯,那位真正写下代码的人,正是历史记得最少的一个。

它为何重要

它把「可能性多到数不清」从一条死路,变成了一项寻常的计算,并帮助让计算机模拟成为做科学的第三种方式,与理论、实验并列。今天,这同一个把戏,藏在临床试验与选举预测背后的统计里,藏在天气与新材料背后的模拟里,也藏在现代机器学习的大量角落里。

一个可以想象的画面

想象在黑暗中、靠步行去绘制一座大城最热闹的地方。你没法走遍每一条街。于是你溜达:往近处迈一步;若觉得更热闹,就继续走;若更冷清,就有时折返、有时不。每过一分钟,标下你所在之处。走得够久,你那一串标记,便描出了这城的人潮——尽管你从未见过整张地图。算法,正是这样去抽取一个物理系统里「热闹的」、最可能的那些排列。

可交互的 Metropolis 抽样器:一条有两个峰的目标概率曲线,柱子显示一条受引导的随机游走到过的地方;按下推进,柱子便爬升去贴合曲线,而提议步长的滑块会改变接受率。

它的位置

这一想法,立于马尔可夫链之上——下一步只取决于你此刻所在的序列,由安德烈·马尔可夫于 1913 年所研究——也立于柯尔莫哥洛夫 1933 年奠下的概率基础之上。它生长自 1940 年代乌拉姆与冯·诺伊曼的蒙特卡洛方法,于 1970 年被黑斯廷斯推广,如今支撑着贯穿现代科学的贝叶斯统计与大规模模拟。(参见本馆关于马尔可夫的文档。)

The original document
Original source text
N. Metropolis, A. W. Rosenbluth, M. N. Rosenbluth, A. H. Teller & E. Teller · J. Chem. Phys. 21 (1953): 1087–1092
The concrete problem is the equation of state of a two-dimensional fluid of rigid spheres (hard disks): the pressure as a function of density. Computing it means averaging an observable over the Boltzmann distribution on a configuration space whose dimension grows with the number of particles — far too vast to integrate directly, and almost every randomly drawn configuration (overlapping disks) carries essentially no weight.
Importance sampling instead of brute force
Rather than draw configurations uniformly and weight each by its Boltzmann factor, the paper draws configurations with frequency already proportional to that factor. Then a thermodynamic ensemble average is just an ordinary arithmetic mean over the sampled configurations — the heavy weighting is built into which states get visited.
The move-and-accept rule
Such a sample is generated as a Markov chain. Displace one particle by a small random amount and look at the change in energy ΔE. If ΔE ≤ 0, accept the move. If ΔE > 0, accept it only with probability exp(−ΔE/kT); otherwise reject it and count the current configuration again. Iterated, this visits configurations with exactly the Boltzmann frequency, because the rule obeys detailed balance — and time averages along the chain converge to the ensemble average.
Run on the Los Alamos MANIAC for a few hundred disks, the method produced an equation of state that agreed with free-volume theory at high density and with a virial expansion at low density — a hard statistical-mechanics problem solved by sampling, with no closed form and no laboratory.
[ … ]
Metropolis · A. Rosenbluth · M. Rosenbluth · A. Teller · E. Teller · Los Alamos Scientific Laboratory · 1953