GW: Minor changes for input handling

This commit is contained in:
Max Graml 2025-06-03 16:26:57 +02:00 committed by GitHub
parent 231bfe326b
commit 4a4cc2cc53
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 27 additions and 2 deletions

View file

@ -91,6 +91,15 @@ CONTAINS
CALL get_qs_kind(qs_kind, basis_set=orb_basis_set, basis_type=basis_type)
END IF
IF (ASSOCIATED(orb_basis_set)) THEN
! BASIS_SET ORB NONE associates the pointer orb_basis_set, but does not contain
! any actual basis functions. Therefore, we catch it here to avoid spurious autogenerated
! RI_AUX basis sets.
IF (SUM(orb_basis_set%nsgf_set) == 0) THEN
CALL cp_abort(__LOCATION__, &
"Cannot autocreate RI_AUX basis set for at least one of the given "// &
"primary basis sets due to missing exponents. If you have invoked BASIS_SET NONE, "// &
"you should state BASIS_SET RI_AUX NONE explicitly in the input.")
END IF
CALL get_basis_keyfigures(orb_basis_set, lmax, zmin, zmax, zeff)
!Note: RI basis coud require lmax up to 2*orb_lmax. This ensures that all orbital pointers
! are properly initialized before building the basis

View file

@ -1285,6 +1285,20 @@ CONTAINS
bs_env%Sigma_x_exists = bs_env%Sigma_x_exists .AND. Sigma_x_spin_exists
END DO
! If any restart files are read, check if the SCF converged in 1 step.
! This is important because a re-iterated SCF can lead to spurious GW results
IF (ANY(bs_env%read_chi(:)) &
.OR. ANY(bs_env%Sigma_c_exists) &
.OR. bs_env%all_W_exist &
.OR. bs_env%Sigma_x_exists &
) THEN
IF (qs_env%scf_env%iter_count /= 1) THEN
CALL cp_warn(__LOCATION__, "SCF needed more than 1 step, "// &
"which might lead to spurious GW results when using GW restart files. ")
END IF
END IF
CALL timestop(handle)
END SUBROUTINE check_for_restart_files

View file

@ -741,9 +741,11 @@ CONTAINS
END IF
basis_set_a => basis_set_list_a(ikind)%gto_basis_set
IF (.NOT. ASSOCIATED(basis_set_a)) CYCLE
! When RI_AUX NONE is invoked, the pointers to basis_set_a and basis_set_b are created,
! but not filled. Therefore, we check for the association and the number of entries.
IF (.NOT. ASSOCIATED(basis_set_a) .OR. SUM(basis_set_a%nsgf_set) <= 0) CYCLE
basis_set_b => basis_set_list_b(jkind)%gto_basis_set
IF (.NOT. ASSOCIATED(basis_set_b)) CYCLE
IF (.NOT. ASSOCIATED(basis_set_b) .OR. SUM(basis_set_b%nsgf_set) <= 0) CYCLE
atom_a = atom_of_kind(iatom)
atom_b = atom_of_kind(jatom)