Skip to content

Conversation

@A-006
Copy link
Collaborator

@A-006 A-006 commented Jan 30, 2026

Summary
This commit optimizes the vloc_of_g function in vl_pw.cpp by introducing a numerical cutoff for the analytic Fourier transform correction and refining dependencies.

Key Changes

  1. Performance Optimization:
    • Introduced a threshold check: if (gx2 > 921) { continue; }.
    • Since exp(-gx2 * 0.25) is less than 1e-100 when gx2 > 921, skipping this term avoids unnecessary exponential calculations and potential floating-point underflow issues for high-frequency G-vectors.

Verification

  • The optimization reduces computational overhead for large basis sets without impacting the precision of the local potential, as the truncated values are well below the double-precision machine epsilon.

@A-006 A-006 marked this pull request as draft January 30, 2026 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant