如何区分自由能码中的集合变量:计算机代数码生成和自动微分
How to Differentiate Collective Variables in Free Energy Codes: Computer-Algebra Code Generation and Automatic Differentiation
摘要:
集体变量的正确选择是分子动力学模拟中偏置采样自由能重构方法的核心。例如,PLUMED 2库提供了几个复杂的CV选择,在C++框架中实现;但是,由于需要为所有函数的解析导数提供代码,因此开发新的CV仍然很耗时。我们提出了两种解决方案,即(a)符号微分和代码生成,(b)自动代码微分,在这两种情况下利用开源库(SymPy和Stan Math分别)。这两种方法进行了详细的演示和讨论,实施一个现实的例子CV,局部曲率半径的聚合物。用户可以使用代码作为模板,使用高级构造和自动梯度计算来简化自己的CV的实现。
英文摘要:
The proper choice of collective variables (CVs) is central to biased-sampling free energy reconstruction methods in molecular dynamics simulations. The PLUMED 2 library, for instance, provides several sophisticated CV choices, implemented in a C++ framework; however, developing new CVs is still time consuming due to the need to provide code for the analytical derivatives of all functions with respect to atomic coordinates. We present two solutions to this problem, namely (a) symbolic differentiation and code generation, and (b) automatic code differentiation, in both cases leveraging open-source libraries (SymPy and Stan Math respectively). The two approaches are demonstrated and discussed in detail implementing a realistic example CV, the local radius of curvature of a polymer. Users may use the code as a template to streamline the implementation of their own CVs using high-level constructs and automatic gradient computation.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。