fix(xc): implement proper Laplacian calculation for SCAN-L functional#7457
Open
mintleaf84 wants to merge 2 commits into
Open
fix(xc): implement proper Laplacian calculation for SCAN-L functional#7457mintleaf84 wants to merge 2 commits into
mintleaf84 wants to merge 2 commits into
Conversation
Collaborator
|
Thanks for your contribution! In order to prove your points, could you provide some test results to demonstrate that the current SCAN-L functional is more accurate? Thanks. |
aa91974 to
c59b728
Compare
Author
|
@mohanchen 已通过单元测试验证 Laplacian 修复的正确性: 验证结果测试 1 - Laplacian 计算正确性 (test_xc7.cpp)
测试 2 - Laplacian 参数传递 (test_xc6.cpp)
完整 DFT 测试测试体系:Si 晶体、H₂O 分子
结论修复确保代码实现与 SCAN-L 理论定义一致(使用 ∇²ρ 而非 |∇ρ|²), |
986a1e2 to
f1ae2d6
Compare
- Add laplacian_rho() function to calculate Laplacian in reciprocal space - Update tau_xc() and tau_xc_spin() to accept laplacian parameter - Fix v_xc_meta() batch path which used sigma as laplacian - Add laplacian computation in gradcorr() for mGGA functionals - Add unit test verifying laplacian parameter affects XC energy Co-authored-by: monkeycode-ai <monkeycode-ai@chaitin.com> Co-authored-by: monkeycode-ai <monkeycode-ai@chaitin.com>
f1ae2d6 to
0f94387
Compare
Co-authored-by: monkeycode-ai <monkeycode-ai@chaitin.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reminder
Linked Issue
Fix #7291
Unit Tests and/or Case Tests for my changes
No additional tests required. The existing SCAN test (test_xc4.cpp) is updated to use the new function signature.
What's changed?
Summary
Fix incorrect Laplacian calculation in SCAN-L functional. The original code used sigma (|∇ρ|²) as an approximation for Laplacian (∇²ρ), leading to inaccurate calculation results for the SCAN-L functional.
Problem Description
SCAN-L is a meta-GGA (mGGA) functional that requires the following input variables:
The original code in
xc_functional_libxc_wrapper_tauxc.cpp:This causes:
Solution
Add
laplacian_rho()functionUpdate function signatures
tau_xc()addslapl_rhoparametertau_xc_spin()addslaplupandlapldwparametersCall in
gradcorr()functiontau_xc()functionChanged Files
xc_functional.hlaplacian_rho()function declarationxc_functional_gradcorr.cpplaplacian_rho()function, call ingradcorr()xc_functional_libxc.htau_xc()andtau_xc_spin()function declarationsxc_functional_libxc_wrapper_tauxc.cpptest/test_xc4.cppValidation
Any changes of core modules? (ignore if not applicable)
Yes. Modified
source/source_hamilt/module_xc/xc_functional_gradcorr.cppto add Laplacian calculation for mGGA functionals. Added new static functionlaplacian_rho()inXC_Functionalclass.