How to speed HF up

233 views
Skip to first unread message

DMT

unread,
Dec 20, 2022, 1:31:44 PM12/20/22
to cp2k
Hello,

I have heard that there must be a way to speed HF (for hybrid DFT methods) up. Can you help me with that ?

Best Regards,
Dobromir

DMT

unread,
Dec 22, 2022, 6:02:02 AM12/22/22
to cp2k
I tried 

                !&PBE_HOLE_T_C_LR
                !    CUTOFF_RADIUS 6.0
                !    SCALE_X 0.25
                !&END PBE_HOLE_T_C_LR

in &XF_FUNCTIONAL and

            &HF
                FRACTION 0.25
                &SCREENING
                    EPS_SCHWARZ 1.0E-6            !DEFAULT 1.0E-10, TYPICAL -6 - -9, FOR STABLE HFX
                    !SCREEN_ON_INITIAL_P T         !FOR A GOOD INITIAL GUESS FROM A .WFN
                &END SCREENING
                &INTERACTION_POTENTIAL
                    POTENTIAL_TYPE TRUNCATED    !TRUNCATED 1/r (Coulomb) POTENTIAL FOR SPEED UP
                    CUTOFF_RADIUS 6.0            !SHOULD BE < HALF THE CELL
                    T_C_G_DATA /home/lsd/cp2k_data/t_c_g.dat     !DATA FOR THE EVAL OF TRUNCATED GAMMA FUNC
                &END INTERACTION_POTENTIAL

in &XC and there is no significant (if any) speed up.

I even played with the CUTOFF_RADIUS (values from 2.0 to 6.0) and nothing changes.

Am I missing something ?

Best Regards,
Dobromir

organic_pbe0

Augustin Bussy

unread,
Dec 22, 2022, 6:30:57 AM12/22/22
to cp...@googlegroups.com
Hi Dobromir,

you should keep in mind that HFX is inherently an expensive method (compared to GGA). From your input file, I would say you are already using all the tricks I know of:
  1. Using the ADMM  method
  2. Using a truncated Coulomb operator, although I have to warn you about using extreme values such as 2.0 Angstrom (~6 is usually good)
  3. Using the largest possible value for MAX_MEMORY
  4. Using a loose EPS_SCHWARZ threshold. Here too, 1.0E-6, may be on the limit
Also, I think that your EPS_DEFAULT value might be dangerously loose, if you want accurate results. You could optionally try to use the RI-HFX method by adding the &RI subsection in &HF. Default parameters should be good enough. There is however no guarantee that it speeds up you particular calculation.

Best,
Augustin



From: cp...@googlegroups.com <cp...@googlegroups.com> on behalf of DMT <dobro...@gmail.com>
Sent: Thursday, December 22, 2022 12:02 PM
To: cp2k <cp...@googlegroups.com>
Subject: [CP2K:18243] Re: How to speed HF up
 
--
You received this message because you are subscribed to the Google Groups "cp2k" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cp2k+uns...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cp2k/64f47d87-163a-4a6d-8061-c9b0b660b928n%40googlegroups.com.

DMT

unread,
Dec 22, 2022, 7:34:02 AM12/22/22
to cp2k
Hi Augustin,

Thank you for the conformation and advises. I will try RI

Best Regards,
Dobromir

Nicholas Winner

unread,
Dec 22, 2022, 3:28:30 PM12/22/22
to cp2k
1. EPS_DEFAULT should be increased to at least 1e-10, maybe 1e-12. It does not change the speed of the HF much when you reduce it and creates substantial errors.
2. Use a PBE restart file and then set SCREEN_ON_INITIAL_P True. This creates very effective screening and rarely causes problems. The initial wave function guess needs to be "good" for this approximation to be valid, but in my experience it is only invalid when one is very far from equilibrium geometries.
3. For your auxiliary basis set, admm-dzp should already be fairly fast, but if you want to be more aggressive you can use the older cpFIT basis sets. These are less diffuse and will result in quicker HF evaluation.

Other than that there aren't many ways you can squeeze performance other than changing your SCF section. Are you noticing that you are taking many many SCF steps to converge? Maybe your SCF settings are the problem. I see that you are using diagonalization instead of OT. If you must use traditional diagonalization, that is okay, but I would suggest trying to use some mixing scheme. The default mixing is good for some systems, but in general I find broyden mixing is better. Something like

&SCF
            MAX_SCF 100                    !DEFAULT 50
            EPS_SCF 1.0E-5                !DEFAULT 1.0e-5, OT: -6 - -7, FOR DIAG CAN BE SMALLER (DEFAULT)
            SCF_GUESS RESTART            !DEFAULT ATOMIC, RESTART FOR RESTART
            &DIAGONALIZATION T
            &END DIAGONALIZATION
            &MIXING
                    METHOD BROYDEN_MIXING
                    ALPHA .01
                    BETA .1
             &END
&END SCF


If you include your output it can also help us diagnose what is the problem and if there are improvements. 

A side note to Augustine's suggestion. RI will not benefit ADMM. RI can be used to improve the speed of HFX with large basis, but since ADMM is a small basis the improvements go away.

DMT

unread,
Dec 24, 2022, 5:38:01 AM12/24/22
to cp2k
Thank you for the suggestions.

Yes, when I try with a PBE GUESS the convergence is a lot faster. It starts with a lower Energy and improves by all factors much faster with the micro-iterations.

In my experience so far diagonalization is faster than OT. I usually try both.

From my testing Smearing does help with metal systems like graphene, but for organic molecules it only slows things down.

From my testing Mixing can help with larger systems, but isn't Mixing only for periodic conditions and not supposed to be used with gas phase organics ?

Regards,
Dobromir

Reply all
Reply to author
Forward
0 new messages