Feature: Add supersine electric fields and refactor RT-TDDFT field handling - #7767
Open
AsTonyshment wants to merge 8 commits into
Open
Feature: Add supersine electric fields and refactor RT-TDDFT field handling#7767AsTonyshment wants to merge 8 commits into
AsTonyshment wants to merge 8 commits into
Conversation
AsTonyshment
requested review from
ESROAMER,
Copilot and
mohanchen
and removed request for
Copilot
August 3, 2026 09:36
mohanchen
reviewed
Aug 4, 2026
AsTonyshment
force-pushed
the
feat/supersine
branch
from
August 4, 2026 08:15
a710a4a to
51d1b1e
Compare
AsTonyshment
force-pushed
the
feat/supersine
branch
from
August 4, 2026 09:26
51d1b1e to
090d7da
Compare
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.
Summary
Fix #7281.
This PR adds a finite-support supersine electric field to LCAO RT-TDDFT as
td_ttype 4and refactors the complete time-dependent electric-field data flow.The main changes are:
Field-state refactor
Each configured field is now represented by an independent
TDFieldand waveform-specificTDFieldProfile. A sharedTDFieldManagerowns:The RT-TDDFT ESolver creates the manager and injects the same shared instance into
Potentialbefore the time-dependent potential component is registered. Length-gauge sampling is advanced byH_TDDFT_pw, while velocity- and hybrid-gauge integration is advanced by the ESolver. This gives all gauges a single field definition and step state.Field parsing and unit conversion no longer depend on the legacy
Input_Conv::read_td_efield()path.H_TDDFT_pwno longer owns waveform parameter arrays, type counters, temporal waveform dispatch, or vector-potential integration. Its remaining static values are compatibility mirrors for existing propagation, current, force, and restart interfaces.Input and documentation changes
td_ttypeand all waveform parameter lists are parsed directly into typed vectors. The shared repetition-expression parser still supportsN*value, but now rejects malformed values, negative repetition counts, trailing characters, and multiple*operators.Supersine start and end parameters accept per-occurrence
defaulttokens, which inherit the final values oftd_tstartandtd_tend.The generated parameter YAML and user documentation have been updated with the field formulas, units, availability conditions, occurrence rules, and supersine parameters.
I/O changes
Electric-field and vector-potential I/O have been moved to dedicated components under
source_io/module_efield; vector-potential I/O is no longer handled byTD_info.efield_[index].txtnow uses one-based field indices and preserves one file per input occurrence.At.dattovector_pot.txt.out_current=2files now follow thecurrent_s[spin]k[kpoint]_comm.txtnaming convention.td_print_eijoutput now reports global band indices.The integration-test property collector now validates every configured electric-field output file and
vector_pot.txt.Validation
The above image compares ABACUS output with the analytical supersine electric field and vector potential for three directions with different frequencies, phases, supports, and shape parameters.
The electric-field samples closely follow the analytical curves in all three directions. The maximum observed electric-field difference is below approximately
4.9e-7 V/Angstrom, consistent with the output precision.The ABACUS
vector_pot.txtvalues also overlap the independently reproduced full-precision Simpson results. Their remaining differences are primarily limited by the four-digit scientific-notation output precision.The analytical supersine vector potential is exactly zero after the pulse. The numerically integrated vector potential, however, is not explicitly constrained to return to zero and may retain a post-pulse residual from finite-resolution Simpson integration. This is most visible for the less smooth
sigma=1.50pulse using two Simpson subdivisions per electronic step:9.3459e-4 a.u.9.34594e-4 a.u.The agreement shows that this residual comes from the numerical quadrature rather than the supersine implementation or text-output rounding. Increasing the forced Simpson resolution in the independent reproduction reduces the residual from approximately
9.35e-4atN=2to4.50e-4,2.17e-4, and1.05e-4atN=4,8, and16, respectively.CPU and GPU regression cases additionally cover supersine velocity-gauge propagation and mixed fields containing all five waveform types, repeated directions, per-occurrence field output, and hybrid-gauge vector-potential integration.