Bohrium
robot
新建

空间站广场

论文
Notebooks
比赛
课程
Apps
我的主页
我的Notebooks
我的论文库
我的足迹

我的工作空间

任务
节点
文件
数据集
镜像
项目
数据库
公开
OPES (即时概率增强采样)
Enhanced Sampling
Molecular Dynamics
English
Enhanced SamplingMolecular DynamicsEnglish
pc-zhang20@foxmail.com
zhangpengchao@dp.tech
发布于 2023-11-15
推荐镜像 :Basic Image:bohrium-notebook:2023-04-07
推荐机型 :c2_m4_cpu
赞 4
6
OPES (on-the-fly probability enhanced sampling)
💭Catalogs
Fundamental knowledge
Reconstruct the unbiased probability
Update bias based on probability
On-the-fly probability?
OPES-explore
Differences between OPES and OPES-explore
Summary

OPES (on-the-fly probability enhanced sampling)

代码
文本

©️ Copyright 2023 @ Authors
Author:Pengchao Zhang 📨
Date:2023-12
License: This work is licensed under a Creative Commons Attribution-NonCommercial Use-ShareAlike 4.0 International License.

代码
文本

🎉 We will explain the OPES (on-the-fly probability enhanced sampling) method based on the references

  1. Rethinking Metadynamics: From Bias Potentials to Probability Distributions
  2. Exploration vs Convergence Speed in Adaptive-Bias Enhanced Sampling

If you are not familiar with enhanced sampling, here are some references:

  1. Metadynamics
  2. Enhancing Important Fluctuations: Rare Events and Metadynamics from a Conceptual Viewpoint
  3. Using metadynamics to explore complex free-energy landscapes
  4. Enhanced Sampling Methods
  5. PLUMED Tutorials
  6. RiD

If you can already largely manage the above, let's get started! This Notebook is cataloged below:

代码
文本

Fundamental knowledge

Considering a system with an interaction potential , where denotes the atomic coordinates. Sampling is accelerated by adding a bias potential that depends on via a set of collective variables (CVs), . The CVs are chosen so as to describe the modes of the system that are more difficult to sample. The choice of a proper set of CVs is critical, as it determines the efficiency of the method. The properties of the unbiased system are then calculated by using a reweighting procedure.

In fact the unbiased probability density can be written as an average over the biased ensemble: where is the inverse temperature.

In this way it is also possible to reconstruct the free energy surface (FES), defined as

代码
文本

Bias can be builded by adding at fixed intervals repulsive Gaussians centered at the instantaneous point sampled. At the -th iteration the bias is given by: where the parameter is called the bias factor, and the Gaussian function is defined as with height and variance set by the user. Typically only diagonal variances are employed. At convergence there is a simple relation between the bias and the free energy and the sampled ensemble is a smoothed version of the unbiased one, with FES barriers lowered by a factor .

代码
文本

Reconstruct the unbiased probability

Enhanced sampling based on the probability reconstruction is not a new idea. It was first proposed by the adaptive umbrella sampling method. Typically, in such methods the bias at -th iteration is defined as: where is an estimate of the probability obtained via a weighted histogram or some more elaborate method.

In building our method we will introduce few key differences that come from the long experience with MetaD.

First we would like to introduce explicitly a target distribution , that will be sampled once the method reaches convergence. This can be obtained with the following bias: In adaptive umbrella sampling the target distribution is uniform while in MetaD it is the well-tempered distribution

Here we express the target distribution as a function of the unbiased one, , we only need to estimate via reweighting in order to calculate the bias.

We build our probability distribution estimate on the fly by periodically depositing Gaussians, known as kernel density estimation (KDE). Each new Gaussian is weighted according to the previously deposited bias potential: where the weights are given by

代码
文本

is not properly normalized, and we will take care of the normalization separately.

The are Gaussians as those defined previously for MetaD, with diagonal variance and fixed height In KDE the most relevant parameter is the bandwidth, i.e., the width of the Gaussians.

A good choice of the bandwidth should depend on the amount of available data: the larger the sampling the smaller the bandwidth. Thus we choose to shrink the bandwidth as the simulation proceeds according to the popular Silverman's rule of thumb.

At -th iteration: where is the initial standard deviation estimated from a short unbiased simulation, is the dimensionality of the CV space, and is the effective sample size.

代码
文本

Update bias based on probability

We can now discuss the normalization problem.

should be normalized not with respect to the full CV space, but only over the CV space actually explored up to step , that we call . Thus we introduce the normalization factor that will change over time, as the system explores new regions of the CV space, and it will have an impact in the biasing scheme. This impact becomes particularly relevant in CV spaces of dimension , since the volume explored grows with a power of .

To estimate we take advantage of our compressed kernels representation, and consider the centers of the kernels as points for a Monte Carlo integration where are the compressed Gaussians, is their total number, and is the global normalization of the KDE.

Finally we can explicitly write the bias at the -th step as: where can be seen as a regularization term that ensures the argument of the logarithm is always greater than zero. We notice that the addition of this term is not merely a technicality to solve a numerical issue, but rather it allows one to set a limit to the bias, thus providing a better control over the desired exploration. It can be chosen to be where is the height of the free energy barriers one wishes to overcome.

代码
文本

On-the-fly probability?

If you are having difficulties following the above instructions, allow me to summarize six steps to aid in understanding the essential aspects of the OPES method.

  1. The only input parameter considered is for the rare event.

  2. The initial bias , i.e., minimum bias, is obtained as .

  3. The Gaussian kernel is constructed using this above bias.

  4. The unbiased probability is then constructed based on a weighted KDE approach (Reweighting!).

  5. Update the bias based on the above and guidelines (Biasing!).

Repeat steps 2 to 5 until the regime is quasi-static, meaning that the the unbiased probability in a on-the-fly way.

  1. Finally, the free energy profile can be calculated through unbiased probability .
代码
文本

opes_loop.png

代码
文本

biasing_reweighting.png

代码
文本

OPES-explore

OPES method focuses on fast convergence (e.g. using DPMD to calculate the free energy profiles), but there are cases where fast exploration is preferred instead (e.g. using DP-GEN iterations to build training datesets).

For this reason, we introduce a new variant of the OPES method that focuses on quickly escaping metastable states at the expense of convergence speed.

In formulating OPES-explore, we restrict ourselves to the case of using as target the well-tempered distribution

In OPES-explore, one builds the bias starting from the on-the-fly estimate of the distribution that is being sampled in the biased simulation: where is the CVs value sampled at step .

As the simulation converges, approaches the target well-tempered distribution . Thus, we use the approximation and write the bias:

Both OPES variants are applications of the general bias potential but OPES estimates on-the-fly and uses it to calculate the bias, while OPES-explore does the same but with .

The free energy surface as a function of the CVs can be estimated in two distinct ways, either directly from the probability estimate or via importance sampling reweighting, e.g., using a weighted KDE,

代码
文本

Differences between OPES and OPES-explore

The idea of defining the bias potential is similar, i.e., using as target the well-tempered distribution .

The way of estimating the probability distribution are different. Specifically, unbiased probability is estimated on-the-fly using weighted KDE in OPES (NOTE: the bias is well-tempered in OPES), while the well-tempered (biased) probability ) is estimated based on averaged KDE in OPES-explore.

Therefore, OPES method focuses on fast convergence, while OPES-explore focuses on fast exploration.

代码
文本

opes_vs_explore.png

代码
文本

alt opes_vs_explore2.png

代码
文本

Summary

代码
文本

📖 This Notebook summarizes the OPES methodology based on the author's reading of the original literature and practical experience.

代码
文本
[ ]

代码
文本
Enhanced Sampling
Molecular Dynamics
English
Enhanced SamplingMolecular DynamicsEnglish
已赞4
本文被以下合集收录
good notebooks collected by Taiping Hu
TaipingHu
更新于 2024-09-10
33 篇14 人关注
DPA2相关-自用
张星辰
更新于 2024-07-16
7 篇0 人关注
推荐阅读
公开
ASE 从入门到精通 第一章
ASE催化建模吸附计算结构驰豫
ASE催化建模吸附计算结构驰豫
量子御坂
发布于 2023-08-08
5 赞5 转存文件3 评论
公开
Voronoi collective variables (基于泰森多边形的集合变量)
Deep LearningnotebookTutorialABACUSDeePMDMolecular DynamicsDFT增强采样Enhanced SamplingH2O
Deep LearningnotebookTutorialABACUSDeePMDMolecular DynamicsDFT增强采样Enhanced SamplingH2O
pc-zhang20@foxmail.com
发布于 2024-04-15
3 赞1 转存文件