AI 中文总结
研究针对电子结构程序中xc响应核缩并层需手动编码的问题,提出开源库libxckernel,通过符号微分自动生成该层,扩展了Psi4和GPAW的多种xc响应功能。
AI 中文摘要
计算密度泛函响应性质需要将交换-关联(xc)能量的导数与网格上的扰动密度进行缩并。长期以来,Libxc等库已提供xc泛函的高阶导数,但将这些导数与基于网格的基函数、密度数据结合,形成总xc贡献的链式法则对应的缩并层,却需要每个程序针对每个泛函族、自旋情况和性质手动推导并手动编码。我们提出libxckernel,这一通过符号微分自动生成该缩并层的库。xc泛函的要素被表示为密度矩阵的半双线性形式,因此可对xc能量进行任意阶微分,而泛函导数仍保持透明。基函数和轨道系数均可为复数。链式法则可生成任意xc矩阵元:Fock矩阵、轨道Hessian以及任意阶的响应项。具有相同模式的项会被折叠以提高效率。可扩展插件可将表达式输出为NumPy爱因斯坦求和、带C++/Fortran接口的编译C内核,或宿主程序特定的源代码。libxckernel是遵循BSD-3-Clause许可的自由开源软件,可快速实现许多电子结构程序中缺失的功能。我们通过将其应用于Psi4,扩展了该程序的meta广义梯度近似(mGGA)响应核以用于轨道稳定性分析和含时密度泛函理论(TD-DFT)、GGA和mGGA解析核Hessian,以及精确正交网格响应;还将其应用于GPAW,扩展了该程序的mGGA和三重态TD-DFT核,以及用于周期性介电响应的梯度校正核,以此对其进行演示。
英文摘要
Computing density-functional response properties requires contracting derivatives of the exchange--correlation (xc) energy with perturbed densities on a grid. While the xc functional's derivatives have long been available to high orders from libraries such as Libxc, the surrounding contraction layer - the chain rule that combines them with the grid-based basis-function and density data into the total xc contribution - has instead been hand-derived and hand-coded in every program, for every functional family, spin case, and property. We present libxckernel, a library that automatically generates this layer by symbolic differentiation. The xc functional's ingredients are expressed as sesquilinear forms in the density matrix, so the xc energy can be differentiated to any order while the functional derivatives remain opaque. The basis functions and the orbital coefficients may both be complex. The chain rule then produces any xc matrix element: Fock matrices, orbital Hessians, and response terms of any order. Terms sharing a pattern are collapsed for efficiency. Extensible plugins emit the expressions as NumPy Einstein sums, compiled C kernels with C++/Fortran interfaces, or host-program specific source code. libxckernel is free and open-source software under the BSD-3-Clause license, enabling rapid implementation of functionality missing from many electronic structure programs. We demonstrate it by extending Psi4 with meta-generalized gradient approximation (mGGA) response kernels for orbital stability analysis and time-dependent density-functional theory (TD-DFT), GGA and mGGA analytic nuclear Hessians, and exact quadrature grid response, and by extending GPAW with mGGA and triplet TD-DFT kernels and gradient-corrected kernels for periodic dielectric response.
Comments33 pages, 1 figure