Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/ao_two_e_ints/two_e_integrals.irp.f
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,14 @@ subroutine compute_ao_two_e_integrals(j,k,l,sze,buffer_value)
!$OMP SCHEDULE(dynamic)
do i=ao_num,1,-1
do k=1,i
ao_two_e_integral_schwartz(i,k) = dsqrt(ao_two_e_integral(i,i,k,k))
! Schwartz factor sqrt((ik|ik)): (ik|ik) is the self-energy of
! the product gaussian i*k, so sqrt((ik|ik)*(jl|jl)) is the
! rigorous Cauchy-Schwarz bound on |(ik|jl)|, the integral
! screened by ao_two_e_integral_zero. Same factor as in the
! erf matrix (providers_ao_erf.irp.f); the former cross
! pairing sqrt((ii|kk)*(jj|ll)) decays as 1/R and never
! triggers at ao_integrals_threshold = 1e-15.
ao_two_e_integral_schwartz(i,k) = dsqrt(ao_two_e_integral(i,k,i,k))
ao_two_e_integral_schwartz(k,i) = ao_two_e_integral_schwartz(i,k)
enddo
enddo
Expand Down
21 changes: 21 additions & 0 deletions src/hartree_fock/10.hf.bats
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,20 @@ function run() {
eq $energy $2 $thresh
}

# run SCF with a given ao_integrals_threshold and check the energy
function run_thr() {
thresh=1.e-5
test_exe scf || skip
qp set_file $1
qp edit --check
qp reset --mos
qp set scf_utils n_it_scf_max 50
qp set ao_two_e_ints threshold_ao $2
qp run scf
energy="$(ezfio get hartree_fock energy)"
eq $energy $3 $thresh
}


function run_pt_charges() {
thresh=1.e-5
Expand Down Expand Up @@ -90,6 +104,13 @@ rm -rf $EZFIO
run b2_stretched.ezfio -48.9950585434279
}

@test "B-B_screening" { # issue #419: same-side schwartz bound sqrt((ik|ik))
# with ao_integrals_threshold = 1e-8, the screened SCF must stay within
# 1e-5 a.u. of the unscreened reference (the bound is a rigorous
# Cauchy-Schwarz bound, so screening cannot zero integrals above thr)
run_thr b2_stretched.ezfio 1.0e-8 -48.9950585434279
}

@test "LiF" { # 3 s
run lif.ezfio -106.9801081911955
}
Expand Down
Loading