XC_HYB_MGGA_XC_WB97M_V functional in libxc

785 views
Skip to first unread message

huy pham

unread,
Aug 13, 2017, 1:46:44 PM8/13/17
to cp2k
Hi everyone,

I am trying to run single point energy calculation using wB97M-V functional (through libxc trunk version) in cp2k-4_1.
However, I got an error:
XC_HYB_MGGA_XC_WB97M_V: this XC_FAMILY is currently not supported.

Is that really so? I check the source code of libxc, and found the file src/hyb_mgga_xc_wb97mv.c
I thought this functional should be ready to use.

Is there anyway I can use XC_HYB_MGGA_XC_WB97M_V in cp2k?
For this hybrid functional, it is really costly for periodic system that I'm going to run.
But I guess in cp2k, I can use Auxiliary Density Matrix Methods to make it possible.

Thanks,
Huy

Matt W

unread,
Aug 17, 2017, 10:20:58 AM8/17/17
to cp2k
Hi,

the functional may be in libxc, but there need to be interface routines to tell cp2k how to use the data from the library (crudely speaking). I guess this hasn't been implemented.

It is quite a complex functional, so whether all the tricks like ADMM will work out of the box would need a bit of attention.

Matt

hut...@chem.uzh.ch

unread,
Aug 17, 2017, 11:03:41 AM8/17/17
to cp...@googlegroups.com
Hi

the problem is that the CP2K libxc interface has not been
updated to include HYB_MGGA type functionals.
There is a good chance that it would work out of the box,
but still it needs changing the xc/xc_libxc.F file.

regards

Juerg
--------------------------------------------------------------
Juerg Hutter Phone : ++41 44 635 4491
Institut für Chemie C FAX : ++41 44 635 6838
Universität Zürich E-mail: hut...@chem.uzh.ch
Winterthurerstrasse 190
CH-8057 Zürich, Switzerland
---------------------------------------------------------------

-----cp...@googlegroups.com wrote: -----To: cp2k <cp...@googlegroups.com>
From: huy pham
Sent by: cp...@googlegroups.com
Date: 08/13/2017 07:46PM
Subject: [CP2K:9301] XC_HYB_MGGA_XC_WB97M_V functional in libxc
--

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 post to this group, send email to cp...@googlegroups.com.

Visit this group at https://groups.google.com/group/cp2k.

For more options, visit https://groups.google.com/d/optout.


Stanislav Šimko

unread,
Sep 24, 2018, 10:59:24 AM9/24/18
to cp2k
Hi all,

following this advice, I just tried dummy plug&play update of the interface to incorporate Hybrid Meta GGA methods in LibXC. 
Technically, it is working, but I don't know whether the results are OK. 
Could you please navigate me on testing the results please? We have some experience on running cp2k in our group, unfortunately we lack experience with running (meta) hybrid functionals with cp2k. According to our knowledge, it is quite tricky to set-up the HF part of the calculation to obtain proper results and we would need some help with this (my colleague tried setting up MP2 calculation some time ago, but she was not successful).

Evidently, I will be more than happy to provide changes to community afterwards, but I would like to test it at first. (either way, i'll post diffs in a few days).

Thank you very much.
Kind regards,
stanislav.
he-wb97mv.in

Frederick Stein

unread,
Oct 2, 2018, 4:55:49 AM10/2/18
to cp...@googlegroups.com
Hi,

I am familiar with the related wB97X-functionals by Head-Gordon, unfortunately not with those containing VV10 dispersion corrections like wB97(M)-V. Your XC_FUNCTIONAL section is correct.
Use the following INTERACTION_POTENTIAL section
        &INTERACTION_POTENTIAL
          # Chose it a bit less than half the shortest nearest-neighbour distance (i.e. cubic box with a=4 A, cutoff = 1.99 A; or cp2k starts complaining)
          CUTOFF_RADIUS 4.0
          # c_sr V_sr + V_lr = c_sr V_Coul+(1-c_sr) V_lr
          SCALE_LONGRANGE 0.833 
          SCALE_COULOMB 0.167  # Affects the scaling of the truncated potential for periodic systems
          # For non-periodic systems use MIX_CL instead
          POTENTIAL_TYPE MIX_CL_TRUNC
          T_C_G_DATA t_c_g.dat
        &END INTERACTION_POTENTIAL
Finally, you miss the VDW-section to include the VV10 correction (See https://groups.google.com/forum/#!searchin/cp2k/wb97x%7Csort:date/cp2k/JEvnnfAEgPY/oryDShPd_w0J). They used something like this
      &vdW_POTENTIAL
         DISPERSION_FUNCTIONAL NON_LOCAL
         &NON_LOCAL
           TYPE RVV10
           PARAMETERS 6.3 0.0093
           VERBOSE_OUTPUT
           KERNEL_FILE_NAME /path/to/your/VV10/table/rVV10_kernel_table.dat
           CUTOFF  150
         &END NON_LOCAL
      &END vdW_POTENTIAL
To my knowledge, cp2k provides only parameters for the rVV10 model, not for the VV10 model. You should test wether the rVV10 parameters are suitable. You might have a further look at the discussions to the wB97X-V functional in this forum. (https://groups.google.com/forum/#!searchin/cp2k/wb97x%7Csort:date/cp2k/JEvnnfAEgPY/oryDShPd_w0Jhttps://groups.google.com/forum/#!searchin/cp2k/wb97x|sort:date/cp2k/VsG6j38wdwI/rsJYd0ZpBwAJhttps://groups.google.com/forum/#!searchin/cp2k/wb97x|sort:date/cp2k/le-ojRVXWa0/acojYhQ0AwAJ)
There are also some examples to test wB97X-V. According to the paper where wB97M-V was published, you might try some of the databases or the dissociation curve of this functional (benzene-argon-dimer) depending on what you can afford. When I tested some functionals, dissociation curves can be a good choice because the shape differs between different functionals as well as optimal distances and bonding energies.
I think Juerg wrote in one of the mentioned threads that you should test the different parts (DFT, HF, VV10) of the functional seperately. Because there are different flavours of that functional (B97, wB97X, wB97X-V, these functionals with different dispersion corrections), there should not be a problem to find reference data.

regards

Frederick

Stanislav Šimko

unread,
Oct 2, 2018, 8:56:13 AM10/2/18
to cp2k
Hi,
Thank you for suggestions. I'm already working on some comparisons with what I hope could be the wB97M-V functional. Results are not perfect, but they are not bad as well. I will try to report more soon.

Stanislav Šimko

unread,
Oct 8, 2018, 4:36:58 AM10/8/18
to cp2k
Hello,

hopefully, someone will be able to help me further. As suggested, I'm trying to reproduce Benzene-Ar interaction potential, as well as some water dimers and some other things. When running with Ahlrichs-def2-QZVP basis, results seem OK-ish but not convincing enough in my opinion. Therefore, I'm now trying to get working (aug-)pc-3 basis set with the Benzene-Ar. My setup does not work though. System energy is exploding during SCF. I get 2 warnings/errors:
1) POWELL| Error in trust region
2)  *** WARNING in pw/ps_wavelet_methods.F:236 :: Density non-zero on the ***
 *** edges of the unit cell: wrong results in WAVELET solver           ***

I have no clue about the first one. Is it something related to math libraries (MKL)?

The second one can be somewhat avoided when I increase cell size. However, this does not work all the time and I'm using 30A box already. Attached is my input.
Do you please have got any suggestions?
Thank you!
4.xyz
4.in

hut...@chem.uzh.ch

unread,
Oct 8, 2018, 5:27:45 AM10/8/18
to cp...@googlegroups.com
Hi

1) Which version of CP2K are you using? This is an error
for an internal optimization. Should not appear in newer versions of the code.
2) This is a warning. Not serious if your molecule is in the center
of the box. If you enlarge the box the warning should disappear.

regards

Juerg Hutter
--------------------------------------------------------------
Juerg Hutter Phone : ++41 44 635 4491
Institut für Chemie C FAX : ++41 44 635 6838
Universität Zürich E-mail: hut...@chem.uzh.ch
Winterthurerstrasse 190
CH-8057 Zürich, Switzerland
---------------------------------------------------------------

-----cp...@googlegroups.com wrote: -----
To: "cp2k" <cp...@googlegroups.com>
From: "Stanislav Šimko"
Sent by: cp...@googlegroups.com
Date: 10/08/2018 10:37AM
Subject: Re: [CP2K:10810] XC_HYB_MGGA_XC_WB97M_V functional in libxc
--
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 post to this group, send email to cp...@googlegroups.com.
Visit this group at https://groups.google.com/group/cp2k.
For more options, visit https://groups.google.com/d/optout.


[attachment "4.xyz" removed by Jürg Hutter/at/UZH]
[attachment "4.in" removed by Jürg Hutter/at/UZH]

Stanislav Šimko

unread,
Oct 8, 2018, 7:10:18 AM10/8/18
to cp2k
Hello,

I'm using cp2k 6.1 r.18604, git version. I compiled it myself (after
quite some struggle, probably because of problems with Intel
compilers), with MKL  18.0.3 and gcc 5.2.0 (both installed by
HPC admins).

Also, to clarify on the (2) - SCF energy usually goes to huge values after this warning (always for the benzene-Ar system). My box size is now 31A for the benzene-Ar system (I tried up to 36A with no obvious success). I'm troubled by the huge/wrong energy in SCF that does not want to get reasonable not by the warning itself (see my partial logfile).

Thank you!
Regards,
stanislav.
4.out

Stanislav Šimko

unread,
Oct 9, 2018, 4:10:15 AM10/9/18
to cp2k
If anybody would like to try, here are the patch files for xc_libxc.F and xc_libxc_wrap.F files that are in the cp2k/src/xc folder. You can apply them from the xc folder like:
patch -p0 -i xc_libxc.F.patch
xc_libxc_wrap.F.patch
xc_libxc.F.patch

Stanislav Šimko

unread,
Oct 10, 2018, 7:22:02 AM10/10/18
to cp2k
I switched to a different basis set, def2-QZVPP, and this one is working. However, SCF can not converge when I try to tighten the convergence criteria - it almost converges when suddenly energy increases by hundreds of au and the SCF can not converge/decrease to previous values anymore. I attach input and output files in case somebody had a suggestion what could be going on.

I will redo the calculation for looser convergence criteria, but I think it is still quite off from reference literature (wB97M-V paper).


Thank you very much.
Kind regards,
stanislav.
4.out
4.in
4.xyz

Frederick Stein

unread,
Apr 28, 2019, 3:21:29 PM4/28/19
to cp2k
Dear Stanislav,

Sorry for the delay. Thank you for your contribution. I included your patch, now.
If you have contributions, it is easier to add them yourself. (see https://www.cp2k.org/dev:starting)

Best regards.
Frederick

Stanislav Šimko

unread,
Apr 28, 2019, 3:28:00 PM4/28/19
to cp2k
No problem. Actually, I'm slowly working on it a bit more because there are some modifications for the wB97M-V settings, but there's not enough days in a week and hours in a day.... That's also why I haven't submitted via repo.

Stanislav Šimko

unread,
Jun 21, 2019, 10:22:50 AM6/21/19
to cp2k
and the saga continues. 
While trying to run some "benchmarks" to see whether I am setting up the M-(r)V and X-(r)V functionals correctly, I came across SCF convergence problems for some systems. E.g., single oxygen, in the ground (triplet) state - at first, SCF gets close to converging but eventually fails to converge and, most worrying, diverges. The "problem" seems to come from the functional itself - replacing it by PBE (while keeping HF and VdW) leads to no convergence problems, while switching off the HF and VdW has no effect.

I observed similar convergence problems with different system (benzene-Ne dimer) with large (aug-pc-2, aug-pc-3) basis sets, while a smaller pc-3 converged well. I didn't test PBE here though.

I use 4.2.3 libxc version.

I would be glad for any suggestions.
Attached are the input and output files for the failed wB97M-v oxygen calculation.
Kind regards,
Stanislav.
o.in
o.out
TMD02_O.xyz
TMD02_O-RESTART.wfn

Frederick Stein

unread,
Jun 21, 2019, 10:50:41 AM6/21/19
to cp2k
Hi Stanislav,

Oh, "good" old atoms. Your calculation seems to converge but breaks after ~200 iterations. Try different preconditioners and/or minimizers. For comparison you might try TPSS, too.

Regards
Frederick
Reply all
Reply to author
Forward
0 new messages