Fix: Fixed a bug in RT-TDDFT where the electric field was not applied starting from the restart step #5877
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.
Linked Issue
Fix #4833, fix #4736.
What's changed?
Now, for RT-TDDFT with an external electric field, the restart process no longer requires modifying the electric field parameters. The program automatically reads the step at which the calculation was interrupted and applies the electric field starting from the restart MD step.
Below is a benchmark: a Heaviside step electric field is applied, which turns off at the 12th MD step. The blue line represents the complete 20-step simulation, the orange line represents the simulation interrupted at the 10th step, and the green line represents the simulation restarted from the 10th step. Their energy curves perfectly overlap, and no changes were made to the electric field parameters in the INPUT file.
