# 巨正则蒙特卡洛模拟

巨正则蒙特卡洛（Grand canonical Monte Carlo, GCMC）是一种随机模拟方法，对巨正则（μVT）系综进行采样，其中体积、温度和化学势固定，而粒子数涨落。它用于计算依赖于开放系统平衡的性质，如吸附等温线、密度分布和离子分布。

| 关键事实 | 详情 |
|---|---|
| 采样系综 | 巨正则（μVT）：固定体积、温度和化学势；粒子数涨落<sup>[1](https://doi.org/10.1080/08927022.2017.1375492)</sup> |
| 核心移动 | 平移、旋转、插入和删除，按Metropolis准则接受<sup>[1](https://doi.org/10.1080/08927022.2017.1375492)</sup> |
| 插入接受率 | \( P = \min\left(1, \frac{1}{N_i+1}\frac{V}{\Lambda_i^3} e^{-\beta\Delta U + \beta\mu_i}\right) \)<sup>[2](https://espressomd.github.io/tutorials/grand_canonical_monte_carlo/grand_canonical_monte_carlo.html)</sup> |
| 起源 | D.J.亚当斯（D.J. Adams），《分子物理》（Molecular Physics），1974年（硬球）和1975年（Lennard-Jones流体）<sup>[3](https://doi.org/10.1080/00268977400102551)</sup><sup> • </sup><sup>[4](https://doi.org/10.1080/00268977500100221)</sup> |
| 主要瓶颈 | 凝聚相中无偏插入接受率可降至约0.01%<sup>[5](https://eprints.soton.ac.uk/444466/1/manuscript.pdf)</sup> |
| 标准应用 | 微孔材料中的吸附等温线、气液共存、电解质、生物分子附近的离子<sup>[6](https://wwwafs.portici.enea.it/software/lammps/doc17/html/fix_gcmc.html)</sup> |
| 近期工具 | GPU代码gRASPA和支持机器学习势的Python包HULU<sup>[7](https://pubs.acs.org/jctcce/article/20/23/10649/163686/Efficient-Implementation-of-Monte-Carlo-Algorithms)</sup><sup> • </sup><sup>[8](https://www.sciopen.com/local/article_pdf/10.26599/NR.2026.94908548.pdf)</sup> |

## 工作原理

在巨正则系综中，系统的体积 \( V \)、温度 \( T \) 和可交换组分的化学势 \( \mu_i \) 是固定的，而非粒子数 \( N_i \)；化学势是亥姆霍兹自由能的导数，\( \mu_i = (\partial F/\partial N_i)_{T,V,\{N_j\}_{j\neq i}} \)。<sup>[2](https://espressomd.github.io/tutorials/grand_canonical_monte_carlo/grand_canonical_monte_carlo.html)</sup> 一个状态的平衡概率正比于 \( e^{-\beta(H(\xi) - \sum_i \mu_i N_i)} \)，其中 \( \beta = 1/(k_{\mathrm{B}} \cdot T) \)，巨势由巨配分函数给出，即 \( \Omega = -k_{\mathrm{B}} \cdot T \ln Z^{\mathrm{G}} \)。<sup>[2](https://espressomd.github.io/tutorials/grand_canonical_monte_carlo/grand_canonical_monte_carlo.html)</sup>

接受规则来自细致平衡：正向与反向跃迁速率之比必须等于平衡概率之比，对于对称提议，这给出 \( P_{\mathrm{acc}} = \min(1, p^{\mathrm{eq}}_j/p^{\mathrm{eq}}_i) \)。<sup>[2](https://espressomd.github.io/tutorials/grand_canonical_monte_carlo/grand_canonical_monte_carlo.html)</sup> 将其应用于与理想气体储库的粒子交换，得到插入规则

\[ P_{N_i \to N_i+1} = \min\left(1, \frac{1}{N_i+1} \cdot \left(\frac{V}{\Lambda_i^3}\right) \exp\left(-\beta \cdot \left(U^{N_i+1} - U^{N_i}\right) + \beta \cdot \mu_i\right)\right) \]

和删除规则

\[ P_{N_i \to N_i-1} = \min\left(1, N_i \cdot \left(\frac{\Lambda_i^3}{V}\right) \exp\left(-\beta \cdot \left(U^{N_i-1} - U^{N_i}\right) - \beta \cdot \mu_i\right)\right) \]

其中 \( \Lambda_i \) 是热德布罗意波长。<sup>[6](https://wwwafs.portici.enea.it/software/lammps/doc17/html/fix_gcmc.html)</sup> 同样的规则常使用逸度 \( f \) 表示，插入时为 \( P_{\mathrm{acc}} = \min\left[1, \frac{\beta \cdot f \cdot V}{N+1} e^{-\beta \cdot \Delta E}\right] \)<sup>[1](https://doi.org/10.1080/08927022.2017.1375492)</sup>，或用集总的亚当斯参数 \( B = \beta\mu + \ln(V/\Lambda^3) \) 表示。<sup>[9](https://www2.stat.duke.edu/~scs/Courses/Stat376/Papers/TemperAnneal/GrandCanonicalParTemp.pdf)</sup> 这些是同一准则的不同参数化形式。

## 实施方法

实践者固定 \( T \) 和 \( V \)，选择力场或势函数，并设置储库化学势。由于 \( \mu \) 不便于直接测量，通常通过状态方程（常用Peng-Robinson方程，由流体的临界温度、临界压力和偏心因子参数化）从体相压力获得，或在给定压力下通过Widom插入法计算。<sup>[10](https://www.osti.gov/servlets/purl/3010678)</sup><sup> • </sup><sup>[11](https://www.osti.gov/servlets/purl/2350901)</sup> LAMMPS的fix gcmc也可通过压力和逸度系数接受 \( \mu \)，为保持量纲一致性需要 \( \Lambda \)。<sup>[6](https://wwwafs.portici.enea.it/software/lammps/doc17/html/fix_gcmc.html)</sup>

模拟随后交替进行不同类型的移动。GCMC将保持粒子数不变的位移移动（等价于正则采样）与在均匀随机位置添加或移除单个粒子的插入和删除移动相结合。<sup>[2](https://espressomd.github.io/tutorials/grand_canonical_monte_carlo/grand_canonical_monte_carlo.html)</sup> 在典型的RASPA-2工作流程中，移动从平移、旋转、重插入和交换中以等概率抽取，运行15,000个初始化循环和15,000个生产循环，每个循环包含 \( \max(20, N) \) 步。<sup>[10](https://www.osti.gov/servlets/purl/3010678)</sup> LAMMPS的建议是每个循环尝试的移动次数应大致等于盒子中预期气体分子数，即每个分子每循环约一次平移。<sup>[6](https://wwwafs.portici.enea.it/software/lammps/doc17/html/fix_gcmc.html)</sup> 在μVT模拟中，必须关闭体积移动。<sup>[12](https://dl_monte.gitlab.io/dl_monte-tutorials-pages/tutorial4.html)</sup> 误差通过块平均估计，例如将生产阶段分为5个块并取块平均值的两倍标准差。<sup>[10](https://www.osti.gov/servlets/purl/3010678)</sup> 结果可能对所使用的超额化学势和标准态体积参数敏感。<sup>[5](https://eprints.soton.ac.uk/444466/1/manuscript.pdf)</sup>

## 起源

巨正则蒙特卡洛的插入/删除方法较早由诺曼（Norman）和菲利诺夫（Filinov）于1969年提出，D.J.亚当斯1974年和1975年的有影响力论文发展了通过周期性随机添加和删除分子来产生密度和浓度涨落的算法。<sup>[9](https://www2.stat.duke.edu/~scs/Courses/Stat376/Papers/TemperAnneal/GrandCanonicalParTemp.pdf)</sup> 亚当斯于1974年在《分子物理》（第28卷，第5期，第1241-1252页）发表了硬球流体的方法<sup>[3](https://doi.org/10.1080/00268977400102551)</sup>，并于1975年在《分子物理》（第29卷，第1期，第307-311页）将巨正则系综方法应用于Lennard-Jones流体。<sup>[4](https://doi.org/10.1080/00268977500100221)</sup> 早期应用紧随其后：GCMC被用于探究12-6氩流体在约化温度1.15下的气液转变<sup>[13](https://www.sciencedirect.com/science/article/abs/pii/002199917590042X)</sup>，到1980年已被应用于电解质溶液，在精度和速度上与传统NVT蒙特卡洛相当，同时增加了固定化学势的能力。<sup>[14](https://www.tandfonline.com/doi/abs/10.1080/00268978000100891)</sup>

## 变体

当目标状态密度高或分子具有内部自由度时，整分子无偏插入会失败。对于链状分子，普通GCMC收敛很差，因为交换步骤中成功插入的概率非常低；将GCMC与构型偏倚蒙特卡洛（CBMC）结合，逐段生长链，使链状分子的插入成为可能，正如在硅沸石（silicalite）中丁烷和己烷吸附所展示的那样。<sup>[15](https://doi.org/10.1080/00268979500101011)</sup> RASPA-2将GCMC与CBMC耦合，以提高插入和删除接受率，并采样丙烷弯曲角等构象自由度。<sup>[10](https://www.osti.gov/servlets/purl/3010678)</sup>

对于带电或分子组分，构型偏倚和生长扩展系综，以及连续分数组分蒙特卡洛，是文献中提到的缓解采样问题的技术。<sup>[16](https://pmc.ncbi.nlm.nih.gov/articles/PMC7254863/)</sup> 空腔偏倚蒙特卡洛尝试在未占据区域插入，被描述为缓解高密度插入的最显著的早期尝试。<sup>[9](https://www2.stat.duke.edu/~scs/Courses/Stat376/Papers/TemperAnneal/GrandCanonicalParTemp.pdf)</sup> 混合GCMC/MD方案在分子动力学片段之间插入粒子；在蛋白质结合位点中，GCMC/MD平衡水分布的速度远快于NVT模拟，后者对晶体学水的采样很差。<sup>[5](https://eprints.soton.ac.uk/444466/1/manuscript.pdf)</sup> 格子GCMC用自由能网格替代连续位置，并在标准Metropolis方案下使用平移、插入和删除移动。<sup>[17](https://pubs.rsc.org/en/content/articlehtml/2025/lf/d4lf00354c)</sup>

## 应用

GCMC是计算微孔材料吸附等温线和气液共存曲线的标准做法<sup>[6](https://wwwafs.portici.enea.it/software/lammps/doc17/html/fix_gcmc.html)</sup>，包括金属有机框架和沸石咪唑酯框架（ZIFs）中CO2、甲烷、乙烷和丙烷的吸附。<sup>[10](https://www.osti.gov/servlets/purl/3010678)</sup><sup> • </sup><sup>[18](https://pubs.rsc.org/en/content/articlehtml/2014/ra/c4ra03768e)</sup> 通过Widom插入法，无限稀释下的亨利常数 \( K_{\mathrm{H}} \) 和吸附热 \( Q_{\mathrm{st}} \) 由插入能的玻尔兹曼加权平均导出。<sup>[8](https://www.sciopen.com/local/article_pdf/10.26599/NR.2026.94908548.pdf)</sup> 在软物质和生物物理中，GCMC与分子动力学结合构成了用于药物设计的配体竞争饱和位点识别（SILCS）方法以及蛋白质和核酸周围单原子离子分布采样的基础。<sup>[19](https://pmc.ncbi.nlm.nih.gov/articles/PMC10330275/)</sup>

近期工具链着力改善吞吐量和势函数精度。gRASPA是一个开源GPU代码，实现了NVT、巨正则、NVT吉布斯、Widom插入和连续分数组分蒙特卡洛，增加了用于精确自由能计算的巨正则转移矩阵蒙特卡洛（GC-TMMC），并可纳入机器学习势，以Mg-MOF-74中CO2吸附为例，其结果与实验的吻合程度远优于传统力场模拟。<sup>[7](https://pubs.acs.org/jctcce/article/20/23/10649/163686/Efficient-Implementation-of-Monte-Carlo-Algorithms)</sup> HULU是一个Python包，能够在多种机器学习势上进行蒙特卡洛模拟，填补了RASPA2、Cassandra和Music等广泛使用的代码缺乏原生MLP支持的空白。<sup>[8](https://www.sciopen.com/local/article_pdf/10.26599/NR.2026.94908548.pdf)</sup>

## 局限性与替代方法

主要的失效模式是高密度插入瓶颈：在凝聚相中，无偏GCMC插入接受率可低至约0.01%。<sup>[5](https://eprints.soton.ac.uk/444466/1/manuscript.pdf)</sup> 水吸附是一个严重案例，氢键簇的形成将系统困在局部自由能极小值中，模拟在单个CPU核心上可能需要长达数十月的实际时间。<sup>[17](https://pubs.rsc.org/en/content/articlehtml/2025/lf/d4lf00354c)</sup> 极稠密、几乎不可压缩的相，如流体-固体转变，也有问题，这促使了带空间更新的巨巨正则系综的发展。<sup>[20](https://pubs.aip.org/aip/jcp/article/131/16/161106/71425/Spatial-updating-in-the-great-grand-canonical)</sup> GCMC是一种平衡方法，当动力学效应控制吸附时可能误判吸附行为，如ZIFs中CO2的报道所示。<sup>[18](https://pubs.rsc.org/en/content/articlehtml/2014/ra/c4ra03768e)</sup>

对于相平衡，吉布斯系综方法模拟两个通过体积变化和粒子转移移动耦合的区域，使共存条件在统计上得到满足，避免了直接使用GCMC确定共存。<sup>[21](https://iopscience.iop.org/article/10.1088/0953-8984/12/3/201/pdf)</sup> 直方图重加权方法从少量GCMC计算中提取广泛条件下的自由能，在临界点附近尤其精确。<sup>[21](https://iopscience.iop.org/article/10.1088/0953-8984/12/3/201/pdf)</sup> 其他替代方法包括界面模拟、NPT+测试粒子法和吉布斯-杜亥姆积分。<sup>[21](https://iopscience.iop.org/article/10.1088/0953-8984/12/3/201/pdf)</sup>

## References

1. [Automated analysis and benchmarking of GCMC simulation programs in application to gas adsorption](https://doi.org/10.1080/08927022.2017.1375492)
2. [Simulations in the Grand-Canonical Ensemble (ESPResSo tutorial)](https://espressomd.github.io/tutorials/grand_canonical_monte_carlo/grand_canonical_monte_carlo.html)
3. [D.J. Adams (1974). Chemical potential of hard-sphere fluids by Monte Carlo methods. Molecular Physics.](https://doi.org/10.1080/00268977400102551)
4. [D.J. Adams (1975). Grand canonical ensemble Monte Carlo for a Lennard-Jones fluid. Molecular Physics.](https://doi.org/10.1080/00268977500100221)
5. [grand: A Python Module for Grand Canonical Monte Carlo](https://eprints.soton.ac.uk/444466/1/manuscript.pdf)
6. [fix gcmc command, LAMMPS documentation](https://wwwafs.portici.enea.it/software/lammps/doc17/html/fix_gcmc.html)
7. [Efficient Implementation of Monte Carlo Algorithms on Graphical Processing Units for Simulation of Adsorption in Porous Materials](https://pubs.acs.org/jctcce/article/20/23/10649/163686/Efficient-Implementation-of-Monte-Carlo-Algorithms)
8. [HULU: A unified Monte Carlo framework for adsorption simulations with machine learning potentials](https://www.sciopen.com/local/article_pdf/10.26599/NR.2026.94908548.pdf)
9. [A new simulation method for the grand canonical ensemble](https://www2.stat.duke.edu/~scs/Courses/Stat376/Papers/TemperAnneal/GrandCanonicalParTemp.pdf)
10. [Study using RASPA-2 GCMC simulations of argon, methane, ethane, propane adsorption](https://www.osti.gov/servlets/purl/3010678)
11. [Avoiding pitfalls in molecular simulation of vapor sorption: propane and isobutane in MOFs for adsorption cooling](https://www.osti.gov/servlets/purl/2350901)
12. [TUTORIAL 4: GCMC Lennard-Jones, DLMONTE 2.0 documentation](https://dl_monte.gitlab.io/dl_monte-tutorials-pages/tutorial4.html)
13. [Monte Carlo grand canonical ensemble calculation in a gas-liquid transition region for 12-6 Argon](https://www.sciencedirect.com/science/article/abs/pii/002199917590042X)
14. [The grand canonical ensemble Monte Carlo method applied to electrolyte solutions](https://www.tandfonline.com/doi/abs/10.1080/00268978000100891)
15. [Grand canonical Monte Carlo simulations of chain molecules: adsorption isotherms of alkanes in zeolites](https://doi.org/10.1080/00268979500101011)
16. [Improving the efficiency of Monte Carlo simulations of ions using expanded grand canonical ensembles](https://pmc.ncbi.nlm.nih.gov/articles/PMC7254863/)
17. [High-efficiency prediction of water adsorption performance of porous adsorbents by lattice grand canonical Monte Carlo molecular simulation](https://pubs.rsc.org/en/content/articlehtml/2025/lf/d4lf00354c)
18. [Kinetic effects in predicting adsorption using the GCMC method – using CO2 adsorption on ZIFs as an example](https://pubs.rsc.org/en/content/articlehtml/2014/ra/c4ra03768e)
19. [GPU-Specific Algorithms for Improved Solute Sampling in Grand Canonical Monte Carlo Simulations](https://pmc.ncbi.nlm.nih.gov/articles/PMC10330275/)
20. [Spatial updating in the great grand canonical ensemble](https://pubs.aip.org/aip/jcp/article/131/16/161106/71425/Spatial-updating-in-the-great-grand-canonical)
21. [Monte Carlo methods for phase equilibria of fluids](https://iopscience.iop.org/article/10.1088/0953-8984/12/3/201/pdf)

---
*Initially written Sep 29, 2026 · Edited: Oct 15, 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/grand-canonical-monte-carlo-simulation

English original: https://www.edgepedia.org/grand-canonical-monte-carlo-simulation
