[CP2K-user] [CP2K:17710] Re: Large discrepancy in xTB results from CP2K vs DFTB+
Xavier Bidault
jazzquark at gmail.com
Sun Sep 18 19:47:46 UTC 2022
Hi again,
I found the documentation online for COULOMB_SR_EPS and COULOMB_SR_CUT.
You'll find below more complete results of simulations using the last CP2K
update (git:d529ce5) and variable-cell optimization of beta-HMX (unit cell
and 3x2x3 k-points).
*1) EPS_DEFAULT (1e-n below) dependency (with SCF 1e-8 and
default COULOMB_SR_EPS 1e-3):*
*EPS_DEFAULT(1e-n) Energy(Ha) Volume(A3) beta(°)*6 -151.006625427635726
451.587706 101.776164
7 -151.006672807135971 451.590652 101.780407
8 -151.006676191174904 451.591670 101.780813
9 -151.006676832199673 451.591242 101.780877
10 -151.006676871358280 451.591222 101.780881
11 -151.006676887368030 451.591220 101.780880
*-> Good convergence! No more weird variations. EPS_DEFAULT = 1e-8 is
perfectly usable.*
*2) COULOMB_SR_EPS (1e-n below) dependency (with SCF 1e-8 and
EPS_DEFAULT 1e-8):*
*COULOMB_SR_EPS(1e-n) Energy(Ha) Volume(A3) beta(°)*2 -151.026393509116332
466.813094 102.291412
3 -151.006676191174904 451.591670 101.780813
4 -151.001068739435084 467.465511 103.232087
5 -150.999031773201608 466.553038 103.882789
6 -150.999031773201438 466.553038 103.882789
7 -150.999031773201438 466.553038 103.882789
8 -150.999031773201438 466.553038 103.882789
9 -150.999031773201438 466.553038 103.882789
10 -150.999031773201438 466.553038 103.882789
*Actually, the default value or 1e-3 is the worst you could choose. I would
recommend a default value for COULOMB_SR_EPS of 1e-5.*
The behavior of xTB at CP2K is much more stable, and I would consider this *issue
solved*. I just have to re-run a huge batch of simulations in the next 2
weeks with this update before submitting my paper ;-)
Thanks a lot!
Xavier
On Sun, Sep 18, 2022 at 9:50 AM Xavier Bidault <jazzquark at gmail.com> wrote:
> Hi Jürg,
>
> A quick test with EPS_DEFAULT of 1e-10 or 1e-11 yields practically the
> same variable-cell optimization now for bHMX. So that's better, even though
> I'll have to check it up with a larger panel of values and watch
> convergence.
>
> What are the default values you chose for these parameters?
> COULOMB_SR_EPS : atom dependent range
> COULOMB_SR_CUT : maximum range for all atoms
> Are they dependent on the (automatic) Ewald parameters?
> If I want to modify them, what would be the section in the input file?
> Are they "per atom" or global parameters?
>
> Thank you,
> Xavier
>
> On Fri, Sep 16, 2022 at 2:53 AM Jürg Hutter <hutter at chem.uzh.ch> wrote:
>
>> I have updated the Trunk version with a new patch for xTB. This should
>> now have the
>> electrostatic energy calculated as originally expected. The long-range
>> 1/r term is
>> handled by an Ewald sum (using SPME) and the remaining terms with an
>> 1/r^3 contribution
>> are cut at an atom dependent distance. The strong dependence of this term
>> on the
>> requested general accuracy (EPS_DEFAULT) should now be gone.
>> The range (*2) of this interaction is controlled by two keywords
>> COULOMB_SR_EPS : atom dependent range
>> COULOMB_SR_CUT : maximum range for all atoms
>> This neglects the long range character of the 1/r^3 terms that might
>> affect especially the
>> stress tensor.
>>
>> I hope this helps to stabilize simulations.
>>
>> best regards
>> JH
>>
>> ________________________________________
>> From: cp2k at googlegroups.com <cp2k at googlegroups.com> on behalf of Magnus
>> Rahm <magnus at compulartech.com>
>> Sent: Wednesday, September 7, 2022 2:20 PM
>> To: cp2k
>> Subject: Re: [CP2K:17622] Re: Large discrepancy in xTB results from CP2K
>> vs DFTB+
>>
>> Btw, I can confirm that the energy now converges with EPS_DEFAULT also
>> for the LiO2 system, although the convergence is perhaps a bit slower
>> (=very small EPS_DEFAULT values needed) than what one might have expected
>> (see LiO2-EPS_DEFAULT.pdf). The figure I attached in my previous post was
>> made with EPS_DEFAULT at the default value, if I use 1e-24 I get a bit
>> closer to DFTB+ but still there is a weird slope in the E-V curve
>> (EV-LiO2.pdf).
>>
>> Furthermore, I had a look at the energy broken down into its different
>> contributions as a function of volume (LiO2-energies-split.pdf), and FWIW
>> it indicates that the electronic energy is responsible for the unexpected
>> slope in the E-V curve (perhaps that was already obvious?).
>>
>> > Could you remind me how to update CP2K 2022.1 to include this bug fix?
>>
>> I think the easiest approach is to use Docker (following these
>> instructions: https://github.com/cp2k/cp2k/tree/master/tools/docker),
>> unless you want to clone the CP2K repo from github and compile from scratch.
>>
>> Kind regards,
>> Magnus Rahm
>>
>>
>> On Wednesday, September 7, 2022 at 2:16:23 AM UTC+2 jazz... at gmail.com
>> wrote:
>> Thank you. Could you remind me how to update CP2K 2022.1 to include this
>> bug fix?
>>
>> On Tue, Sep 6, 2022 at 10:36 AM Jürg Hutter <hut... at chem.uzh.ch> wrote:
>> Hi
>>
>> the updates are now on Github (Trunk version).
>> This should at least fix the strange behavior for changes of EPS_DEFAULT.
>>
>> regards
>>
>> JH
>>
>> ________________________________________
>> From: cp... at googlegroups.com <cp... at googlegroups.com> on behalf of Jürg
>> Hutter <hut... at chem.uzh.ch>
>> Sent: Tuesday, September 6, 2022 11:37 AM
>> To: cp... at googlegroups.com
>> Subject: Re: [CP2K:17614] Re: Large discrepancy in xTB results from CP2K
>> vs DFTB+
>>
>> Hi
>>
>> I think I found the problem. This is in fact a bug in CP2K and is related
>> to the damping of
>> the "short range" part of the Coulomb term. As mentioned before this
>> short range part
>> is not short range at all, even diverging in periodic systems. We use a
>> damping function
>> for this term and the radius is taken from the range of the basis
>> function on each atom.
>> The bug is now, that this range is not a constant but depends on
>> EPS_DEFAULT.
>> I will work on a solution, but at least the default settings will cause
>> considerable changes
>> in the energies of periodic systems.
>>
>> regards
>>
>> JH
>>
>> ________________________________________
>> From: cp... at googlegroups.com <cp... at googlegroups.com> on behalf of
>> Magnus Rahm <mag... at compulartech.com>
>> Sent: Monday, September 5, 2022 3:19 PM
>> To: cp2k
>> Subject: Re: [CP2K:17609] Re: Large discrepancy in xTB results from CP2K
>> vs DFTB+
>>
>> Hi,
>>
>> Thank you for valuable input! Here's a breakdown of energies for a
>> periodic LiO2 system (where CP2K and DFTB+ disagree).
>> CP2K:
>>
>> Core Hamiltonian energy:
>> -609.45757320827579
>> Repulsive potential energy:
>> 2.86335541921533
>> Electronic energy:
>> -65.73940900376786
>> DFTB3 3rd order energy:
>> 9.00274299587460
>> Dispersion energy:
>> -2.00065978643714
>> Correction for halogen bonding:
>> 0.00000000000000
>>
>> Total energy:
>> -665.33154358339084
>>
>> outer SCF iter = 1 RMS gradient = 0.49E-06 energy =
>> -665.3315435834<tel:(331)%20543-5834>
>> outer SCF loop converged in 1 iterations or 10 steps
>>
>> And the same system with DFTB+ (I don't know this is the best breakdown I
>> can get from DFTB+? This info is from detailed.out.):
>>
>> Fermi level: -0.1574062769 H -4.2832 eV
>> Band energy: -254.9890864567 H -6938.6061 eV
>> TS: 0.0000000000 H 0.0000 eV
>> Band free energy (E-TS): -254.9890864567 H -6938.6061 eV
>> Extrapolated E(0K): -254.9890864567 H -6938.6061 eV
>> Input / Output electrons (q): 864.0000000000 864.0000000000
>>
>> Energy H0: -610.3586854777 H -16608.7049 eV
>> Energy SCC: 13.1915555608 H 358.9605 eV
>> Total Electronic energy: -597.1671299169 H -16249.7444 eV
>> Repulsive energy: 0.0000000000 H 0.0000 eV
>> Total energy: -597.1671299169 H -16249.7444 eV
>> Extrapolated to 0: -597.1671299169 H -16249.7444 eV
>> Total Mermin free energy: -597.1671299169 H -16249.7444 eV
>> Force related energy: -597.1671299169 H -16249.7444 eV
>>
>>
>> ----------------------------------------------------------------------------------------------------------------
>> For reference, here are the equivalent breakdowns for the LiF molecule,
>> where the total energies do match quite well.
>> CP2K:
>>
>> Core Hamiltonian energy:
>> -5.57594122418510
>> Repulsive potential energy:
>> 0.00036401843654
>> Electronic energy:
>> 0.08477836575096
>> DFTB3 3rd order energy:
>> -0.00385103760005
>> Dispersion energy:
>> -0.00008325087778
>> Correction for halogen bonding:
>> 0.00000000000000
>>
>> Total energy:
>> -5.49473312847544
>>
>> outer SCF iter = 1 RMS gradient = 0.12E-06 energy =
>> -5.4947331285
>> outer SCF loop converged in 1 iterations or 25 steps
>>
>> DFTB+
>> Fermi level: -0.3434874008<tel:(343)%20487-4008>
>> H -9.3468 eV
>> Band energy: -3.7493389034 H -102.0247 eV
>> TS: 0.0000000000 H 0.0000 eV
>> Band free energy (E-TS): -3.7493389034 H -102.0247 eV
>> Extrapolated E(0K): -3.7493389034 H -102.0247 eV
>> Input / Output electrons (q): 8.0000000444 8.0000000000
>>
>> Energy H0: -5.5743451431<tel:(574)%20345-1431>
>> H -151.6856 eV
>> Energy SCC: 0.0807122067 H 2.1963 eV
>> Total Electronic energy: -5.4936329365 H -149.4894 eV
>> Repulsive energy: 0.0000000000 H 0.0000 eV
>> Total energy: -5.4936329365 H -149.4894 eV
>> Extrapolated to 0: -5.4936329365 H -149.4894 eV
>> Total Mermin free energy: -5.4936329365 H -149.4894 eV
>> Force related energy: -5.4936329365 H -149.4894 eV
>>
>>
>> ----------------------------------------------------------------------------------------------------------------
>>
>> > I recently run variable-cell optimization of various molecular crystals
>> and I found xTB at CP2K ultra sensitive to EPS_DEFAULT. Tested from 1e-5 to
>> 1e-24 (with EPS_SCF 1e-8), and no convergence happened.
>>
>> Thank you for sharing this info! I tried a series of calculations with
>> LiO2 using varying values of EPS_DEFAULT (using default EPS_SCF) and found
>> the same effect; no convergence with EPS_DEFAULT (or perhaps unreasonably
>> slow convergence). I attach a figure showing these results, including the
>> energy broken down into the different parts as specified in the CP2K
>> output. Note the energy scale, the changes with EPS_DEFAULT are really
>> quite substantial. In the LiF (non-PBC) case, the corresponding curves look
>> completely flat on the same scale. I don't know what to make of this
>> result, but perhaps someone else does?
>>
>> Magnus
>>
>> [X]
>> On Monday, September 5, 2022 at 12:18:26 PM UTC+2 jazz... at gmail.com
>> wrote:
>> I recently run variable-cell optimization of various molecular crystals
>> and I found xTB at CP2K ultra sensitive to EPS_DEFAULT. Tested from 1e-5 to
>> 1e-24 (with EPS_SCF 1e-8), and no convergence happened. I just ended up
>> with EPS_DEFAULT 1e-10 as a "gut" choice. Also, the behavior of xTB at CP2K
>> is doutfull with MD even at ambiant conditions, where the converged volume
>> is barely larget than at 0K. Depending on EPS_DEFAULT, it can even be
>> smaller at ambient T. Weird. The behavior of DFTB2 at CP2K is far better.
>>
>> I found that DFTB+ has other issues. xTB at DFTB+ has no convergence issue,
>> but the recommended variable-cell optimization algorithm has flaws. The
>> unit cell and a supercell does NOT always end up with related lattice
>> parameters. The main issue is that some 90° angles are not preserved with
>> DFTB+ whereas CP2K does (with no symmetry enforced, obviously). Some
>> inconsistencies appears in DFTB+ with a lattice dimensions < 10 angstroms
>> in the unit cell versus > 10 angstroms in the supercell. A proper tight
>> mesh of k-points does not improve. So I'm afraid that xTB at DFTB+ (or
>> DFTB+, actually) cannot be a relevant choice for crystal structure
>> predictions, for instance.
>>
>> xTB may be unreliable with CP2K and DFTB+, but for the different reasons
>> above. You can check these weird behaviors with your own crystals of
>> interest.
>>
>> Xavier
>>
>>
>>
>> Le lun. 5 sept. 2022, 3:59 AM, Jürg Hutter <hut... at chem.uzh.ch> a écrit :
>> Hi
>>
>> thank you for testing. Could you send a break down of the energies for
>> the LiF molecule for
>> the two codes? That might help to recognize the source of the difference.
>>
>> regards
>>
>> JH
>>
>> ________________________________________
>> From: cp... at googlegroups.com <cp... at googlegroups.com> on behalf of
>> Magnus Rahm <mag... at compulartech.com>
>> Sent: Monday, September 5, 2022 8:40 AM
>> To: cp2k
>> Subject: [CP2K:17599] Re: Large discrepancy in xTB results from CP2K vs
>> DFTB+
>>
>> For the record, the problem is the same in CP2K version 2022.1.
>>
>> On Thursday, September 1, 2022 at 12:48:35 PM UTC+2 Magnus Rahm wrote:
>> Dear all,
>>
>> I want to use CP2K (version 8.2, trying to get a more recent version
>> compiled) together with xTB for a crystal containing Li and O. I get
>> strange results already for a simple LiO2 crystal:
>>
>> * There is a very large discrepancy compared to DFTB+ (version 22.1).
>> * Mulliken charges tend to be large, meaning that CHECK_ATOMIC_CHARGES
>> stops the SCF. If I turn it off, the system tends to converge
>> systematically to values just outside the "chemical range". Mulliken
>> charges obtained by DFTB+ are significantly smaller (and within "chemical
>> range").
>> * The energy-volume curve looks strange and very different from DFTB+.
>>
>> I have tried converging with respect to system size and the EWALD / ALPHA
>> and GMAX parameters, but they have only a marginal impact. I have tried
>> similar calculations for a number of periodic systems. Sometimes I get
>> agreement, sometimes not. I also tried calculations for CO and NO molecules
>> which agree perfectly between CP2K and DFTB+, whereas an artificial LiF
>> molecule does not.
>>
>> A perhaps related issue was reported in
>> https://groups.google.com/g/cp2k/c/oFwgGcQuySs but the solutions
>> suggested there did not solve my problem.
>>
>> I attach input scripts for CP2K and DFTB+, as well as a figure showing
>> the E-V curve for LiO2 obtained with CP2K and DFTB+. I'm new to CP2K, DFTB+
>> and xTB so I suspect I have made some simple mistake, and any advice is
>> appreciated.
>>
>> Kind regards,
>> Magnus Rahm
>>
>>
>>
>>
>>
>>
>> --
>> 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... at googlegroups.com<mailto:cp2k+uns... at googlegroups.com
>> >.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/cp2k/c51e70a2-7f7a-4887-8ada-971d840a1b13n%40googlegroups.com
>> <
>> https://groups.google.com/d/msgid/cp2k/c51e70a2-7f7a-4887-8ada-971d840a1b13n%40googlegroups.com?utm_medium=email&utm_source=footer
>> >.
>>
>> --
>> 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... at googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/cp2k/ZR0P278MB075983A13AA78F53FFB422559F7F9%40ZR0P278MB0759.CHEP278.PROD.OUTLOOK.COM
>> .
>>
>> --
>> 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... at googlegroups.com<mailto:cp2k+uns... at googlegroups.com
>> >.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/cp2k/7d455fce-a22e-44f1-ac48-18495f9553a5n%40googlegroups.com
>> <
>> https://groups.google.com/d/msgid/cp2k/7d455fce-a22e-44f1-ac48-18495f9553a5n%40googlegroups.com?utm_medium=email&utm_source=footer
>> >.
>>
>> --
>> 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... at googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/cp2k/ZR0P278MB0759EEC38142F9D207742F549F7E9%40ZR0P278MB0759.CHEP278.PROD.OUTLOOK.COM
>> .
>>
>> --
>> 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... at googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/cp2k/ZR0P278MB0759A3BAE12A4F8C0298072A9F7E9%40ZR0P278MB0759.CHEP278.PROD.OUTLOOK.COM
>> .
>>
>> --
>> 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+unsubscribe at googlegroups.com<mailto:
>> cp2k+unsubscribe at googlegroups.com>.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/cp2k/1234148a-7a9a-4c6b-a0c9-13caabfe8811n%40googlegroups.com
>> <
>> https://groups.google.com/d/msgid/cp2k/1234148a-7a9a-4c6b-a0c9-13caabfe8811n%40googlegroups.com?utm_medium=email&utm_source=footer
>> >.
>>
>> --
>> 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+unsubscribe at googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/cp2k/ZR0P278MB075914FC480ED2BF2B9B7FEB9F489%40ZR0P278MB0759.CHEP278.PROD.OUTLOOK.COM
>> .
>>
>
--
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+unsubscribe at googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cp2k/CAD0N%2BNU-0x-3VheOAWmo2woUsZ_kF1395vcq2zdAT6qnCjauow%40mail.gmail.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.cp2k.org/archives/cp2k-user/attachments/20220918/787f817c/attachment-0001.htm>
More information about the CP2K-user
mailing list