Skip to content

Commit

Permalink
RTP: Fix segfault and adjust tolerances
Browse files Browse the repository at this point in the history
  • Loading branch information
glb96 committed Feb 8, 2023
1 parent 9bd9310 commit 3a22c34
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 31 deletions.
13 changes: 8 additions & 5 deletions src/motion/rt_propagation.F
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,13 @@ SUBROUTINE init_propagation_run(qs_env)
nelectron_spin=nelectron_spin)
IF (ASSOCIATED(mos)) THEN
!The wavefunction was minimized by an mo based algorith. P is therefore calculated from the mos
IF (ASSOCIATED(rtp%mos) .AND. ASSOCIATED(rtp%mos%old)) THEN
! Delta kick was applied and the results is in rtp%mos%old
CALL rt_initialize_rho_from_mos(rtp, mos, mos_old=rtp%mos%old)
IF (ASSOCIATED(rtp%mos)) THEN
IF (ASSOCIATED(rtp%mos%old)) THEN
! Delta kick was applied and the results is in rtp%mos%old
CALL rt_initialize_rho_from_mos(rtp, mos, mos_old=rtp%mos%old)
ELSE
CALL rt_initialize_rho_from_mos(rtp, mos)
END IF
ELSE
CALL rt_initialize_rho_from_mos(rtp, mos)
END IF
Expand All @@ -263,10 +267,9 @@ SUBROUTINE init_propagation_run(qs_env)
CALL dbcsr_copy(rho_new(re)%matrix, qs_env%ls_scf_env%matrix_p(ispin))
END DO
END IF
CALL calc_update_rho_sparse(qs_env)
END IF
CALL calc_update_rho_sparse(qs_env)
END IF
! Modify KS matrix to include the additional terms in the velocity gauge
IF (rtp_control%velocity_gauge) THEN
! As matrix_h and matrix_h_im are not updated by qs_ks_update_qs_env()
Expand Down
52 changes: 26 additions & 26 deletions tests/QS/regtest-rtp-5/TEST_FILES
Original file line number Diff line number Diff line change
Expand Up @@ -9,37 +9,37 @@
# Note: For all of these tests setting DENSITY_PROPAGATION to .TRUE. should return the same results (if not decrease the treshold for RTP propagation or start to worry).
#
# 'simple molecule': Testing the different possibility to apply delta pulses
H2O-dens-pulse-1.inp 1 1e-13 -17.16754063268224
H2O-dens-pulse-2.inp 1 1e-13 -17.17094395584866
H2O-dens-pulse-3.inp 1 1e-13 -17.17097876693722
H2O-dens-pulse-4.inp 1 1e-13 -17.17778821654724
H2O-dens-pulse-5.inp 1 1e-13 -17.16699564870017
H2O-dens-pulse-1.inp 1 1e-9 -17.16754063268224
H2O-dens-pulse-2.inp 1 1e-9 -17.17094395584866
H2O-dens-pulse-3.inp 1 1e-9 -17.17097876693722
H2O-dens-pulse-4.inp 1 1e-9 -17.17778821654724
H2O-dens-pulse-5.inp 1 1e-9 -17.16699564870017
# 'simple molecule': same test as previously, testing with UKS on
H2O-uks-dens-pulse-1.inp 1 1e-13 -17.16754063266203
H2O-uks-dens-pulse-2.inp 1 1e-13 -17.17094396832539
H2O-uks-dens-pulse-3.inp 1 1e-13 -17.17097877203030
H2O-uks-dens-pulse-4.inp 1 1e-13 -17.17778822190720
H2O-uks-dens-pulse-5.inp 1 1e-13 -17.16699568143762
H2O-uks-dens-pulse-1.inp 1 1e-9 -17.16754063266203
H2O-uks-dens-pulse-2.inp 1 1e-9 -17.17094396832539
H2O-uks-dens-pulse-3.inp 1 1e-9 -17.17097877203030
H2O-uks-dens-pulse-4.inp 1 1e-9 -17.17778822190720
H2O-uks-dens-pulse-5.inp 1 1e-9 -17.16699568143762
# 'simple molecule': same test as previously, charge +1
H2O-charged-dens-pulse-1.inp 1 1e-13 -16.80277136764719
H2O-charged-dens-pulse-2.inp 1 1e-13 -16.80344505896810
H2O-charged-dens-pulse-3.inp 1 1e-13 -16.80402085317819
H2O-charged-dens-pulse-4.inp 1 1e-13 -16.81031776489433
H2O-charged-dens-pulse-5.inp 1 1e-13 -16.80215384578111
H2O-charged-dens-pulse-1.inp 1 1e-9 -16.80277136764719
H2O-charged-dens-pulse-2.inp 1 1e-9 -16.80344505896810
H2O-charged-dens-pulse-3.inp 1 1e-9 -16.80402085317819
H2O-charged-dens-pulse-4.inp 1 1e-9 -16.81031776489433
H2O-charged-dens-pulse-5.inp 1 1e-9 -16.80215384578111
# 'simple molecule': use wfn-mixing and MOM method to prepare a new initial state. Provide the same results as MO-based for strict treshold.
H2O-wfn-mix-dens-pulse-1.inp 1 6e-11 -16.80397942635466
H2O-mom-dens-pulse-1.inp 1 1e-13 -16.77310344331094
H2O-wfn-mix-dens-pulse-1.inp 1 5e-9 -16.80397942635466
H2O-mom-dens-pulse-1.inp 1 1e-9 -16.77310344331094
# Periodic system: try with molecule in PBC and smearing
H2O-periodic-dens-pulse-1.inp 1 1e-13 -17.17071488628162
H2O-periodic-dens-pulse-2.inp 1 1e-13 -17.16724674275025
si8-smearing-rtp-dens.inp 1 1e-11 -32.38438017820661
si8-smearing-rtp-dens-pulse-1.inp 1 1e-11 -30.86382482362951
H2O-periodic-dens-pulse-1.inp 1 1e-9 -17.17071488628162
H2O-periodic-dens-pulse-2.inp 1 1e-9 -17.16724674275025
si8-smearing-rtp-dens.inp 1 1e-9 -32.38438017820661
si8-smearing-rtp-dens-pulse-1.inp 1 1e-9 -30.86382482362951
# Restart using densitry propagation method from GS calculation.
# Note: A delta kick is required in the input but should not impact the calculation (delta kick + restart from wfn not implemented yet).
H2O-dens-restart.inp 1 1e-13 -17.17842704651846
H2O-uks-dens-restart.inp 1 1e-13 -17.17842704651734
H2O-charged-dens-restart.inp 1 1e-13 -16.81087707009416
H2O-periodic-dens-restart.inp 1 1e-13 -17.17819965973394
H2O-dens-restart.inp 1 1e-9 -17.17842704651846
H2O-uks-dens-restart.inp 1 1e-9 -17.17842704651734
H2O-charged-dens-restart.inp 1 1e-9 -16.81087707009416
H2O-periodic-dens-restart.inp 1 1e-9 -17.17819965973394
# Note: the total energy of si8-smearing-rtp-dens-restart.inp is different from si8-smearing-rtp-dens.inp because of the electronic entropy energy. Using restart, currently, the electronic entropy term is missing.
si8-smearing-rtp-dens-restart.inp 1 1e-11 -32.37909123001641
si8-smearing-rtp-dens-restart.inp 1 1e-9 -32.37909123001641
#EOF

0 comments on commit 3a22c34

Please sign in to comment.