Skip to content

Feature: Add orthonormalization for PW RT-TDDFT - #8085

Merged
mohanchen merged 16 commits into
deepmodeling:developfrom
AsTonyshment:fix/dipole_single
Oct 9, 2026
Merged

mohanchen merged 16 commits into
deepmodeling:developfrom
AsTonyshment:fix/dipole_single

Conversation

@AsTonyshment

Copy link
Copy Markdown
Collaborator

Summary

Single-precision PW RT-TDDFT propagation can accumulate electron-count errors, causing dipole drift and spurious low-frequency dielectric response. This PR adds explicit wavefunction orthonormalization before density construction to control this drift.

  • Add td_orthonormal with Cholesky (cholesky, default), Löwdin (lowdin), Newton-Schulz (newton_schulz), and none options.
  • Use the current electronic density for shared dipole output.

Validation

Benzene propagation over 10 fs, comparing single-precision calculations against a double-precision reference.

Dipole and dielectric response. Without orthonormalization, the default lin_thr produces electron-count drift that contaminates the dipole and low-frequency dielectric response. All three orthonormalization methods restore agreement with the double-precision reference. Tightening lin_thr also improves the response.

c6h6_orth_response

Timing. Orthonormalization preserves efficiency in this benchmark: the three methods take 40.34-40.90 min, slightly less than 41.14 min without correction. Tightening lin_thr to 1e-6 or 1e-7 without orthonormalization increases the runtime to 42.52 and 47.33 min, respectively.

c6h6_orth_timing

Electron conservation. The error is measured against benzene's 30 valence electrons, $\Delta N_{\psi}=N_{\psi}-30$. Explicit orthonormalization keeps the error near zero during propagation; tightening the linear-solver tolerance alone does not systematically enforce electron conservation.

c6h6_conservation

Orthogonality. The maximum elementwise deviation of $\boldsymbol{\Psi}^{\dagger}\boldsymbol{\Psi}$ from the identity remains below 1e-6 after correction for all tested orthonormalization methods.

c6h6_orthogonality

@AsTonyshment
AsTonyshment requested review from mohanchen and a balanced review from Copilot and removed request for Copilot October 6, 2026 16:56
Comment thread docs/advanced/input_files/input-main.md
Comment thread tests/15_rtTDDFT_GPU/26_PW_single_TDDFT_GPU/current_tot.txt.ref
@mohanchen mohanchen added Features Needed The features are indeed needed, and developers should have sophisticated knowledge Refactor Refactor ABACUS codes labels Oct 6, 2026
Comment thread source/source_io/module_ctrl/ctrl_output_fp.cpp
Comment thread source/source_hsolver/hsolver_pw_tddft.cpp
Comment thread source/source_hsolver/orthonormal.h
Comment thread source/source_hsolver/orthonormal.h Outdated
Comment thread source/source_hsolver/linear_algebra.cpp
Comment thread source/source_hsolver/hsolver_pw_tddft.cpp Outdated
Comment thread source/source_hsolver/hsolver_pw_tddft.cpp Outdated
Comment thread source/source_hsolver/hsolver_pw_tddft.h
Copilot AI balanced review requested due to automatic review settings October 8, 2026 10:10

This comment was marked as spam.

@AsTonyshment
AsTonyshment marked this pull request as draft October 9, 2026 09:03
@AsTonyshment
AsTonyshment marked this pull request as ready for review October 9, 2026 09:44
@AsTonyshment

Copy link
Copy Markdown
Collaborator Author

We found that the densities (e.g., rho and rho_save) are rather chaotic in the code. This should be addressed and refactored in a separate PR in the near future. This PR focused on RT-TDDFT, and is ready to merge.

@mohanchen
mohanchen merged commit 1d4ac5f into deepmodeling:develop Oct 9, 2026
18 checks passed
@AsTonyshment
AsTonyshment deleted the fix/dipole_single branch October 9, 2026 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Features Needed The features are indeed needed, and developers should have sophisticated knowledge Refactor Refactor ABACUS codes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants