Fock matrix construction in the source code and Coulomb potential

29 views
Skip to first unread message

Oleksii

unread,
May 7, 2025, 1:41:34 AMMay 7
to NWChem Forum
Hi everyone,

I have a question about the Fock matrix construction in the DFT calculation. Particularly, how the Coulomb potential matrix is computed and inserted into the Fock matrix in NWChem.

First, I have explored "src/nwdft/scf_dft/dft_fockbld.F". My first question is: Is "dft_fockbld.F" the correct routine which is used for the Fock matrix construction in a DFT calculation?

In the aforementioned function, the Coulomb contribution is computed with the "dft_getvc" subroutine. I explored "nwdft/coulomb/dft_getvc.F", and in the comments, it is mentioned:

"This driver routine solves for the Coulomb potential (Vcoul) by one of the
c     following methods:
c    
c     1) evaluating the set of 4-ctr ERIs formed from the AO basis set,
c     2) fitting the charge density via Dunlap method and, then, evaluating
c     the set of 3-ctr ERIs formed from the AO and CD basis sets,
c     3) solving Poisson's equation via (Delley,Becke,Feibelman,?)'s method."

However, in the code, the following block is present:
     if( iVcoul_opt.eq.0 )then
        call ga_zero(g_vc(1))
        if (ipol.gt.1) call ga_zero(g_vc(2))
Which, in contrast to the "comments" section above, means that when iVcoul_opt.eq = 0, the Coulomb potential is not evaluated at all, i.e., it is set to zero

This block is followed by the implementation of the RI approximation when iVcoul_opt.eq = 1, and, finally, an empty block for future implementation of the Poisson-Boltzmann equation (iVcoul_opt.eq = 1).

Thus, the only working solution for the evaluation of the Coulomb matrices in "dft_getvc.F" is the RI approximation.

I looked in the manual, and it is said that: "If this (i.e., auxiliary) basis set is not defined by input, the O(N4) exact Coulomb contribution is computed."

Can you please let me know where I can find in "dft_fockbld.F" the reference to the evaluation of the exact Coulomb contribution (with the O(N4) precision)?

This would be very helpful in implementing my own expressions containing the Fock matrices within the NWChem code.

Thanks in advance.

Best regards,
Oleksii

Edoardo Aprà

unread,
May 9, 2025, 7:27:08 PMMay 9
to NWChem Forum
The N4 Coulomb call can be found in xc_getv.F
The lines you want to look are from 224 to 231

Oleksii

unread,
May 13, 2025, 2:41:34 PMMay 13
to NWChem Forum
Dear Edoardo,

Many thanks, that is exactly what we were looking for.

Best regards,
Oleksii

пʼятниця, 9 травня 2025 р. о 18:27:08 UTC-5 Edoardo Aprà пише:
Reply all
Reply to author
Forward
0 new messages