# Wolff 算法

Wolff 算法是一种用于晶格自旋模型的蒙特卡洛方法：它从一个随机种子出发，生长出一团取向一致的自旋，再一步将其整体翻转。该算法旨在克服伊辛模型及相关系统中的临界慢化：在临界温度附近，自旋的关联区域会变得很大，而一次只翻转一个自旋的局域动力学需要很长时间才能使它们去关联。<sup>[1](https://alps.comp-phys.org/documentation/methods/spinmc/cluster/)</sup> 通过集体翻转一个集团，该算法在临界温度附近能够高效采样。<sup>[2](https://stp.clarku.edu/simulations/ising/ising2d/index.html)</sup> 它属于集团翻转方法家族，是更早的多集团算法的单集团对应版本，并以后者为基础发展而来。<sup>[3](https://doi.org/10.48550/arxiv.cond-mat/9703179)</sup>

| 关键事实 | 数值 |
|---|---|
| 键（添加）概率，伊辛模型 | \( p_{\mathrm{add}} = 1 - e^{-2\beta \cdot J} \)，使每次集团翻转的接受率为 1 <sup>[3](https://doi.org/10.48550/arxiv.cond-mat/9703179)</sup> |
| 二维 \( T_{c} \) 处的关联时间（100×100 晶格） | Wolff \( \tau = 2.80 \pm 0.03 \)，对比 Metropolis \( \tau = 2570 \pm 330 \) 自旋翻转/格点 <sup>[3](https://doi.org/10.48550/arxiv.cond-mat/9703179)</sup> |
| 动力学指数 \( z \)（能量，Wolff） | 二维 0.25(1)，三维 0.33(1)，四维 0.25(1)，而 Metropolis 为 \( z \approx 2 \) <sup>[4](https://surface.syr.edu/cgi/viewcontent.cgi?article=1024&context=phy)</sup><sup> • </sup><sup>[5](https://ar5iv.labs.arxiv.org/html/cond-mat/9510082)</sup> |
| 扫描定义 | \( V/\langle\|C\|\rangle \) 个单集团步骤，因此平均每次扫描翻转 \( V \) 个自旋 <sup>[6](https://www.physik.uni-leipzig.de/~janke/Paper/ising-lect-lviv-draft.pdf)</sup> |
| 磁化率估计量（伊辛） | \( \chi'/\beta = \langle\|C\|\rangle \)，即平均集团大小 <sup>[6](https://www.physik.uni-leipzig.de/~janke/Paper/ising-lect-lviv-draft.pdf)</sup> |
| 原始论文中演示的模型 | 二维 O(n) 西格玛模型，\( n = 1 \)（伊辛）、\( n = 2 \)（XY）、\( n = 3 \)（海森堡） <sup>[7](https://doi.org/10.1103/physrevlett.62.361)</sup> |
| 已知失效模式 | 阻挫磁体和外场中的磁体；这些情形下没有可用的集团方法 <sup>[8](http://physics.bu.edu/py502/slides/d05.pdf)</sup> |

## 工作原理

该方法建立在一个键激活概率之上，该概率的选取使得翻转由此形成的集团总是被接受。对于耦合常数为 \( J \)、逆温度为 \( \beta \) 的伊辛模型，两个平行的相邻自旋以如下概率成键：

\[ p_{\mathrm{add}} = 1 - e^{-2\beta \cdot J}. \]

在此选择下，集团移动的接受概率恒为 1，这是该家族集团算法中实现的“魔法”值。<sup>[9](https://arxiv.org/pdf/cond-mat/9612186)</sup> 原始论文给出了通用形式：自旋 \( \sigma_{x} \) 与 \( \sigma_{y} \) 之间的键以概率 \( P(\sigma_{x}, \sigma_{y}) = 1 - \exp(\min\{0, \beta \cdot \sigma_{x} \cdot [1 - R(r)]\, \sigma_{y}\}) \) 被激活，其中 \( R(r) \) 是一个随机反射，定义为 \( R(t)\,\sigma_{x} = \sigma_{x} - 2(\sigma_{x} \cdot r) \cdot r \)，是一种幂等操作，作用量在该操作下不变。<sup>[7](https://doi.org/10.1103/physrevlett.62.361)</sup>

细致平衡（使集团翻转合法的统计平衡条件）成立，因为集团的更新只改变集团边界链上的作用量，而不改变其内部。<sup>[10](http://latt.if.usp.br/technical-pages/twawesab/Text.html/node1.html)</sup> 遍历性（保证所有自旋构型仍可到达）由以下事实保证：集团始终存在非零概率仅由单个格点组成，因此局域移动仍然可达。<sup>[7](https://doi.org/10.1103/physrevlett.62.361)</sup>

## 执行步骤

一次迭代按如下方式进行。<sup>[2](https://stp.clarku.edu/simulations/ising/ising2d/index.html)</sup><sup> • </sup><sup>[3](https://doi.org/10.48550/arxiv.cond-mat/9703179)</sup>

1. 均匀随机选择一个种子自旋。与其平行的最近邻构成周界列表。
2. 从周界中选取一个自旋，抽取随机数 \( r \)，若 \( r \le p_{\mathrm{add}} \) 则将该自旋加入集团。将其取向相同的邻居加入周界列表。
3. 重复直到周界中不再有自旋，然后翻转整个集团（在伊辛情形下，反转其所有自旋）。

一次移动的开销与集团中的自旋数成正比，因为生长和翻转都随集团大小缩放。<sup>[3](https://doi.org/10.48550/arxiv.cond-mat/9703179)</sup> 由于集团大小各异，一次扫描定义为 \( V/\langle\|C\|\rangle \) 个单集团步骤，使得平均每次扫描翻转 \( V \) 个自旋，自相关时间与其他算法保持可比。<sup>[6](https://www.physik.uni-leipzig.de/~janke/Paper/ising-lect-lviv-draft.pdf)</sup> 文献中反复出现两点实现上的注意事项：根据 Ferrenberg、Landau 和 Wong 的一项研究，该算法对随机数生成器的缺陷异常敏感；<sup>[3](https://doi.org/10.48550/arxiv.cond-mat/9703179)</sup> 其串行集团生长使得单个程序内的并行化变得困难；一次蒙特卡洛扫描的计算时间在理论上按 \( L^{2.25} \) 缩放，最近一项大晶格研究测得为 \( L^{2.16} \)。<sup>[11](https://beta.iopscience.iop.org/article/10.1088/1742-5468/ad4e28/meta)</sup>

## 起源

Ulli Wolff 于 1989 年在《物理评论快报》上以“Collective Monte Carlo Updating for Spin Systems”为题报道了该算法。<sup>[7](https://doi.org/10.1103/physrevlett.62.361)</sup> 该论文将其呈现为一种集体更新方法，在临界点及其附近的系统中同时翻转大团自旋，并在二维 O(n) 西格玛模型中，对处于各自临界温度的 \( n = 1 \)（伊辛）和 \( n = 2 \)（XY）情形，以及 \( n = 3 \)（海森堡）情形进行了演示；在最大到 128² 的晶格上，看不到临界慢化的迹象，长程量估计量的自相关时间为每自旋 1–2 步。<sup>[7](https://doi.org/10.1103/physrevlett.62.361)</sup> 该算法基于更早的工作，后者采用相同的键激活规则，将整个晶格划分为集团，每个集团以概率 1/2 独立翻转；Wolff 的变体每步只构造并更新单个集团。<sup>[3](https://doi.org/10.48550/arxiv.cond-mat/9703179)</sup>

## 变体

原始论文已经包含连续自旋的版本：选择一个种子自旋和一个随机方向向量 \( n \)，邻居以概率 \( P_{\mathrm{add}}(s_{i}, s_{j}) = 1 - \exp[-2\beta (n \cdot s_{i}) \cdot (n \cdot s_{j})] \) 被加入，集团通过关于垂直于 \( n \) 的平面的反射来翻转；这种嵌入集团方案被 Gottlob 和 Hasenbusch（1993）用于海森堡模型的广泛研究。<sup>[3](https://doi.org/10.48550/arxiv.cond-mat/9703179)</sup> 集团方法还可推广到 Potts 自旋和硬圆盘。<sup>[5](https://ar5iv.labs.arxiv.org/html/cond-mat/9510082)</sup> 自旋集团算法的一个扩展在无外场情形下保持了伊辛、Potts 及相关模型中加速动力学的标度行为。<sup>[12](https://link.aps.org/accepted/10.1103/PhysRevE.98.063306)</sup>

## 应用

最清晰的单项比较来自 \( T_{c} \) 处 100×100 晶格上的二维伊辛模型：Wolff 的关联时间为 \( \tau = 2.80 \pm 0.03 \) 自旋翻转/格点，而 Metropolis 为 \( \tau = 2570 \pm 330 \)，约好三个数量级。<sup>[3](https://doi.org/10.48550/arxiv.cond-mat/9703179)</sup> Wolff 算法的拟合动力学指数给出二维 \( z = 0.25 \pm 0.02 \)，与 Coddington 和 Baillie 测得的 \( z = 0.25 \pm 0.01 \) 一致，而 Metropolis 为 \( z = 2.17 \)。<sup>[3](https://doi.org/10.48550/arxiv.cond-mat/9703179)</sup> 一项系统研究报告 Wolff 的 \( z_{\mathrm{int,E}} = 0.25(1) \)（二维）、\( 0.33(1) \)（三维）、\( 0.25(1) \)（四维），并暗示自相关与比热呈线性关系，\( z_{\mathrm{int,E}}^{\mathrm{W}} = \alpha/\nu \)。<sup>[4](https://surface.syr.edu/cgi/viewcontent.cgi?article=1024&context=phy)</sup> 一项 1989 年的直接比较研究发现，在临界点处所有测试的二维和三维伊辛情形中，单集团变体比多集团算法去关联更快，在 64³ 晶格上约快一个数量级。<sup>[13](https://www.sciencedirect.com/science/article/abs/pii/0370269389915633)</sup> 在最大到 32768² 的二维伊辛晶格的现代研究中，Wolff 动力学下的动力学指数趋近于零，自相关时间按 \( L \) 的对数缩放。<sup>[11](https://beta.iopscience.iop.org/article/10.1088/1742-5468/ad4e28/meta)</sup>

该方法还直接给出可观测量。对于伊辛模型，改进的磁化率估计量等于平均集团大小，\( \chi'/\beta = \langle\|C\|\rangle \)；对于连续自旋，经验关系为 XY（n = 2）时 \( \langle\|C\|\rangle \approx 0.81\,\chi'/\beta \)，海森堡（n = 3）时 \( \approx 0.75\,\chi'/\beta \)。<sup>[6](https://www.physik.uni-leipzig.de/~janke/Paper/ising-lect-lviv-draft.pdf)</sup> 这些改进估计量在临界点附近对于能量等短程量可能退化为劣化估计量，而长程量通常仍然受益。<sup>[6](https://www.physik.uni-leipzig.de/~janke/Paper/ising-lect-lviv-draft.pdf)</sup>

## 局限与替代方案

对于具有阻挫（竞争相互作用）的磁体，集团在到达临界点之前就已渗流，此时集团方法没有可用形式；对于外磁场中的磁体也是如此。<sup>[8](http://physics.bu.edu/py502/slides/d05.pdf)</sup> 即使对于伊辛模型，优势也取决于所处的温度区间：在低温下，更新只是来回翻转几乎所有自旋，改进甚微；而在远高于 \( T_{c} \) 时，集团大小约为一个自旋，Metropolis 表现更优；建议将集团更新与局域更新结合使用。<sup>[5](https://ar5iv.labs.arxiv.org/html/cond-mat/9510082)</sup> 在硬件方面，多集团全晶格算法更适合并行化，因为它涉及整个晶格而非单个串行生长的集团。<sup>[14](https://netlib.org/utk/lsi/pcwLSI/text/node292.html)</sup>

由于其对随机数质量的敏感性，一项 2024 年的研究使用最大到 32768² 的二维伊辛晶格的 Wolff 模拟作为伪随机数生成器（Mersenne Twister、加法滞后 Fibonacci、Xorshift、Xorwow）的测试平台，通过临界指数 \( \gamma \)、\( \beta \) 和 \( \alpha \) 的有限尺寸标度来评估它们。<sup>[11](https://beta.iopscience.iop.org/article/10.1088/1742-5468/ad4e28/meta)</sup> 在机器学习方面，神经集团更新使用自回归神经网络来提出针对任意哈密顿量学习到的集团翻转 MCMC 移动；在二维伊辛模型上，其性能与 Wolff 集团更新方法相当，并可扩展到传统集团算法不适用的阻挫 plaquette 模型。<sup>[15](https://ar5iv.labs.arxiv.org/html/2105.05650)</sup>

## References

1. [Cluster Updates – ALPS Software Package](https://alps.comp-phys.org/documentation/methods/spinmc/cluster/)
2. [Simulations for Statistical and Thermal Physics (2D Ising: Metropolis and Wolff)](https://stp.clarku.edu/simulations/ising/ising2d/index.html)
3. [New Monte Carlo algorithms for classical spin systems (Newman & Barkema review)](https://doi.org/10.48550/arxiv.cond-mat/9703179)
4. [Empirical Relations Between Static and Dynamic Exponents for Ising Model Cluster Algorithms](https://surface.syr.edu/cgi/viewcontent.cgi?article=1024&context=phy)
5. [Cluster Monte Carlo Algorithms and Their Applications](https://ar5iv.labs.arxiv.org/html/cond-mat/9510082)
6. [Monte Carlo Simulations in Statistical Physics – From Basic Principles to Advanced Applications (W. Janke)](https://www.physik.uni-leipzig.de/~janke/Paper/ising-lect-lviv-draft.pdf)
7. [Ulli Wolff (1989). Collective Monte Carlo Updating for Spin Systems. Physical Review Letters.](https://doi.org/10.1103/physrevlett.62.361)
8. [Cluster finding/flipping (BU lecture slides)](http://physics.bu.edu/py502/slides/d05.pdf)
9. [Introduction To Monte Carlo Algorithms (Werner Krauth)](https://arxiv.org/pdf/cond-mat/9612186)
10. [The Wolff Algorithm (protocol page)](http://latt.if.usp.br/technical-pages/twawesab/Text.html/node1.html)
11. [Critical exponents testing of a random number generator with the Wolff cluster algorithm](https://beta.iopscience.iop.org/article/10.1088/1742-5468/ad4e28/meta)
12. [Extension of spin-cluster Monte Carlo algorithms (Phys. Rev. E 98, 063306)](https://link.aps.org/accepted/10.1103/PhysRevE.98.063306)
13. [Comparison between cluster Monte Carlo algorithms in the Ising model](https://www.sciencedirect.com/science/article/abs/pii/0370269389915633)
14. [Cluster Algorithms (Netlib lecture notes)](https://netlib.org/utk/lsi/pcwLSI/text/node292.html)
15. [Unbiased Monte Carlo cluster updates with autoregressive neural networks](https://ar5iv.labs.arxiv.org/html/2105.05650)

---
*Initially written Sep 29, 2026 · Reviewed: Sep 30, 2026 · Edited: Oct 15, 2026 · Last review: Sep 30, 2026*

Topic: 物质世界与数学 › 物理学 › 物质与辐射物理学 › Condensed matter physics

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/wolff-algorithm

English original: https://www.edgepedia.org/wolff-algorithm
