[CP2K-user] [CP2K:19030] Re: TiO2 slab not converging

Léon Luntadila Lufungula Leon.luntadilalufungula at uantwerpen.be
Thu Jun 29 09:41:45 UTC 2023


So I dug a bit deeper into why the CIF from ASE could not be properly read 
by CP2K even though it looks correct and apparently something goes wrong 
when CP2K reads in the CIF file. I noticed this because the same problem 
happened when I took a molecule in a 25x25x25 Å box from a CIF (created by 
Critic2, see attachment 3mppa.cif) which could be read by CP2K and used ASE 
to alter the vacuum size and center the molecule and suddenly the resulting 
CIF could no longer be properly read by CP2K (i.e., I got errors stating 
atoms are too close). I noticed that even when just reading in and writing 
out the CIF with ASE (see attachment 3mppa-ase.cif) already showed atoms 
too close to one another when read into CP2K:

   Atom Kind Element         X             Y             Z       Z(eff)     
Mass
      1    1 H     1      7.070300      9.682957      5.879925   1.0000   
1.0079
      2    2 O     8      7.070300      9.423014      6.500614   6.0000 
 15.9994
      3    1 H     1      7.070300      5.945227      5.744394   1.0000   
1.0079
      4    2 O     8      7.070300      6.657800      6.398468   6.0000 
 15.9994
      5    3 P    15      7.070300      8.447808      5.896924   5.0000 
 30.9738
      6    2 O     8      7.070300      8.566346      4.554013   6.0000 
 15.9994
      7    1 H     1      7.070300      9.631506      8.443233   1.0000   
1.0079
      8    1 H     1      7.070300      7.722120      8.375391   1.0000   
1.0079
      9    4 C     6      7.070300      8.978791      8.136181   4.0000 
 12.0107
     10    4 C     6      7.070300      9.143231      6.759885   4.0000 
 12.0107
     11    1 H     1      7.070300     10.392672      6.492497   1.0000   
1.0079
     12    5 S    16      7.070300      9.397121     10.419543   6.0000 
 32.0650
     13    1 H     1      7.070300      8.473533      6.425727   1.0000   
1.0079
     14    4 C     6      7.070300      9.608639      8.784895   4.0000 
 12.0107
     15    1 H     1      7.070300     10.868673      8.560234   1.0000   
1.0079
     16    1 H     1      7.070300      8.934066      8.505103   1.0000   
1.0079
     17    1 H     1      7.070300      9.995695     10.760287   1.0000   
1.0079


 *** WARNING in particle_methods.F:677 :: The distance between the atoms 2 
***
 *** and 10 is only 0.381 angstrom and thus smaller than the threshold of 
 ***
 *** 0.500 angstrom                                                       
 ***


 *** WARNING in particle_methods.F:677 :: The distance between the atoms 7 
***
 *** and 14 is only 0.342 angstrom and thus smaller than the threshold of 
 ***
 *** 0.500 angstrom                                                       
 ***


 *** WARNING in particle_methods.F:677 :: The distance between the atoms 9 
***
 *** and 16 is only 0.372 angstrom and thus smaller than the threshold of 
 ***
 *** 0.500 angstrom                                                       
 ***

Notice that all the x-coordinates are the same, even though the fractional 
x-coordinates in the CIF are different for all atoms... I noticed that by 
switching the order of the lines "_atom_site_type_symbol" and 
"_atom_site_label" in the CIF (see 3mppa-ase-edited.cif) CP2K could 
correctly read in the CIF file without a hitch.

   Atom Kind Element         X             Y             Z       Z(eff)     
Mass
      1    1 H     1      8.143430      6.455697      4.999966   1.0000   
1.0079
      2    2 O     8      7.924816      7.137164      5.661084   6.0000 
 15.9994
      3    3 H     1      4.999975      6.306894      6.438132   1.0000   
1.0079
      4    4 O     8      5.599253      7.025016      6.709042   6.0000 
 15.9994
      5    5 P    15      7.104662      6.474360      6.880102   5.0000 
 30.9738
      6    6 O     8      7.204353      4.999949      6.935846   6.0000 
 15.9994
      7    7 H     1      8.100160      9.270007      7.237998   1.0000   
1.0079
      8    8 H     1      6.494353      9.195522      7.971859   1.0000   
1.0079
      9    9 C     6      7.551222      8.932889      8.129596   4.0000 
 12.0107
     10   10 C     6      7.689517      7.421824      8.281361   4.0000 
 12.0107
     11   11 H     1      8.740305      7.128253      8.426234   1.0000   
1.0079
     12   12 S    16      7.903040     11.439841      9.116297   6.0000 
 32.0650
     13   13 H     1      7.126297      7.054944      9.153051   1.0000   
1.0079
     14   14 C     6      8.080929      9.645126      9.361478   4.0000 
 12.0107
     15   15 H     1      9.140625      9.398466      9.518603   1.0000   
1.0079
     16   16 H     1      7.513608      9.337936     10.250780   1.0000   
1.0079
     17   17 H     1      8.406445     11.813951     10.314334   1.0000   
1.0079

Perhaps someone with more knowledge about the process of reading in a CIF 
file in CP2K can take a look at the code and where/why it does not work if 
the two labels are in the original order and maybe fix this in an upcoming 
version?

Best,
Léon
On Wednesday, 28 June 2023 at 16:52:05 UTC+2 Léon Luntadila Lufungula wrote:

> Hi Matthias,
>
> Thanks a lot, now it does not throw the error anymore. I'll keep you 
> updated if this fixes the convergence issues but I suspect it will. Again, 
> thanks for the help!
>
> All the best,
>
> Léon
>
> On Wednesday, 28 June 2023 at 16:37:28 UTC+2 Krack Matthias wrote:
>
>> Hi Léon
>>
>>  
>>
>> Try
>>
>>  
>>
>> &CELL
>>
>>  A   10.2988004684         0.0000000000         0.0000000000
>>  B    0.0000000000        11.3549995422 <(354)%20999-5422>         
>> 0.0000000000
>>  C    0.0000000000         0.0000000000        49.3899002075
>> &END CELL
>>
>>  
>>
>> &COORD
>>
>> O    9.300228691         0.000000000        19.999946640
>>  O    9.300228691         3.784962059        19.999946640
>>  O    9.300228691         7.570037822        19.999946640
>>
>> . . . further 69 O atoms
>>
>> 36 Ti atoms
>>
>> &END COORD
>>
>>  
>>
>> HTH
>>
>>  
>>
>> Matthias
>>
>>  
>>
>> *From: *cp... at googlegroups.com <cp... at googlegroups.com> on behalf of 
>> Léon Luntadila Lufungula <Leon.luntad... at uantwerpen.be>
>> *Date: *Wednesday, 28 June 2023 at 16:29
>> *To: *cp2k <cp... at googlegroups.com>
>> *Subject: *Re: [CP2K:19022] Re: TiO2 slab not converging
>>
>> Hi Matthias,
>>
>>  
>>
>> So I opened the CIF file in VESTA and did Export Data > VASP file > Save 
>> > Cartesian coordinates > Output current unit cell and this resulted in the 
>> file shown below, but I don't see how this will "easily" cut&paste into a 
>> CP2K input file as the atom labels are missing...
>>
>>  
>>
>> "O72 Ti36"
>> 1.0
>>        10.2988004684         0.0000000000         0.0000000000
>>         0.0000000000        11.3549995422 <(354)%20999-5422>         
>> 0.0000000000
>>         0.0000000000         0.0000000000        49.3899002075
>>     O   Ti
>>    72   36
>> Cartesian
>>      9.300228691         0.000000000        19.999946640
>>      9.300228691         3.784962059        19.999946640
>>      9.300228691         7.570037822        19.999946640
>>      4.151034406         1.892992021        20.000439738
>>      4.151034406         5.677953911        20.000439738
>>      4.151034406         9.463029336        20.000439738
>>      7.074658142         1.892992021        20.879580124
>>      7.074658142         5.677953911        20.879580124
>>      7.074658142         9.463029336        20.879580124
>>      1.923610010         0.000000000        20.880567792
>>      1.923610010         3.784962059        20.880567792
>>      1.923610010         7.570037822        20.880567792
>>      5.583803656         0.000000000        21.468802556
>>      5.583803656         3.784962059        21.468802556
>>      5.583803656         7.570037822        21.468802556
>>      0.433682486         1.892992021        21.469295653
>>      0.433682486         5.677953911        21.469295653
>>      0.433682486         9.463029336        21.469295653
>>      3.357409004         1.892992021        22.348436040
>>      3.357409004         5.677953911        22.348436040
>>      3.357409004         9.463029336        22.348436040
>>      8.505058213         0.000000000        22.349423707
>>      8.505058213         3.784962059        22.349423707
>>      8.505058213         7.570037822        22.349423707
>>      0.392487277         0.000000000        23.519964286
>>      0.392487277         3.784962059        23.519964286
>>      0.392487277         7.570037822        23.519964286
>>      5.542093345         1.892992021        23.520458855
>>      5.542093345         5.677953911        23.520458855
>>      5.542093345         9.463029336        23.520458855
>>      8.465716774         1.892992021        24.399597769
>>      8.465716774         5.677953911        24.399597769
>>      8.465716774         9.463029336        24.399597769
>>      3.314668949         0.000000000        24.400586909
>>      3.314668949         3.784962059        24.400586909
>>      3.314668949         7.570037822        24.400586909
>>      6.974965416         0.000000000        24.988818729
>>      6.974965416         3.784962059        24.988818729
>>      6.974965416         7.570037822        24.988818729
>>      1.824741540         1.892992021        24.989807868
>>      1.824741540         5.677953911        24.989807868
>>      1.824741540         9.463029336        24.989807868
>>      4.748467944         1.892992021        25.868455157
>>      4.748467944         5.677953911        25.868455157
>>      4.748467944         9.463029336        25.868455157
>>      9.896220587         0.000000000        25.869935922
>>      9.896220587         3.784962059        25.869935922
>>      9.896220587         7.570037822        25.869935922
>>      1.783546255         0.000000000        27.040476500
>>      1.783546255         3.784962059        27.040476500
>>      1.783546255         7.570037822        27.040476500
>>      6.933152591         1.892992021        27.040476500
>>      6.933152591         5.677953911        27.040476500
>>      6.933152591         9.463029336        27.040476500
>>      9.856776020         1.892992021        27.919615415
>>      9.856776020         5.677953911        27.919615415
>>      9.856776020         9.463029336        27.919615415
>>      4.705727889         0.000000000        27.921099124
>>      4.705727889         3.784962059        27.921099124
>>      4.705727889         7.570037822        27.921099124
>>      8.366024662         0.000000000        28.508839318
>>      8.366024662         3.784962059        28.508839318
>>      8.366024662         7.570037822        28.508839318
>>      3.215800326         1.892992021        28.509825513
>>      3.215800326         5.677953911        28.509825513
>>      3.215800326         9.463029336        28.509825513
>>      6.139527190         1.892992021        29.388472802
>>      6.139527190         5.677953911        29.388472802
>>      6.139527190         9.463029336        29.388472802
>>      0.988478905         0.000000000        29.389953567
>>      0.988478905         3.784962059        29.389953567
>>      0.988478905         7.570037822        29.389953567
>>      7.442016174         0.000000000        20.734373862
>>      7.442016174         3.784962059        20.734373862
>>      7.442016174         7.570037822        20.734373862
>>      2.292821888         1.892992021        20.734868432
>>      2.292821888         5.677953911        20.734868432
>>      2.292821888         9.463029336        20.734868432
>>      5.215518701         1.892992021        21.614008818
>>      5.215518701         5.677953911        21.614008818
>>      5.215518701         9.463029336        21.614008818
>>      0.065397382         0.000000000        21.614996485
>>      0.065397382         3.784962059        21.614996485
>>      0.065397382         7.570037822        21.614996485
>>      8.833075420         0.000000000        24.254391507
>>      8.833075420         3.784962059        24.254391507
>>      8.833075420         7.570037822        24.254391507
>>      3.683880827         1.892992021        24.254886077
>>      3.683880827         5.677953911        24.254886077
>>      3.683880827         9.463029336        24.254886077
>>      6.606680461         1.892992021        25.134024991
>>      6.606680461         5.677953911        25.134024991
>>      6.606680461         9.463029336        25.134024991
>>      1.456456432         0.000000000        25.135014131
>>      1.456456432         3.784962059        25.135014131
>>      1.456456432         7.570037822        25.135014131
>>     10.224134052         0.000000000        27.774409152
>>     10.224134052         3.784962059        27.774409152
>>     10.224134052         7.570037822        27.774409152
>>      5.074939767         1.892992021        27.774903722
>>      5.074939767         5.677953911        27.774903722
>>      5.074939767         9.463029336        27.774903722
>>      7.997739707         1.892992021        28.654537206
>>      7.997739707         5.677953911        28.654537206
>>      7.997739707         9.463029336        28.654537206
>>      2.847515371         0.000000000        28.655031776
>>      2.847515371         3.784962059        28.655031776
>>      2.847515371         7.570037822        28.655031776
>>
>>  
>>
>> On Wednesday, 28 June 2023 at 16:15:00 UTC+2 Krack Matthias wrote:
>>
>> Hi Léon
>>
>>  
>>
>> You can export cell and coordinates as a POSCAR file in VESTA and from 
>> that file you can easily cut&paste CP2K’s &CELL and &COORD section.
>>
>>  
>>
>> HTH
>>
>>  
>>
>> Matthias
>>
>>  
>>
>> *From: *cp... at googlegroups.com <cp... at googlegroups.com> on behalf of 
>> Léon Luntadila Lufungula <Leon.luntad... at uantwerpen.be>
>> *Date: *Wednesday, 28 June 2023 at 16:10
>> *To: *cp2k <cp... at googlegroups.com>
>> *Subject: *Re: [CP2K:19020] Re: TiO2 slab not converging
>>
>> Hi Matthias,
>>
>>  
>>
>> Thanks a lot for the tip! The output when using the pre-compiled binary 
>> shows that some atoms are indeed too close together, which is probably the 
>> cause of the bad convergence. Is there an easy way to fix this? 
>>
>>  
>>
>> I made the slabs with ASE so I'm quite surprised that it did not make the 
>> slabs correctly. Here is the script I used to make them with ASE, perhaps 
>> you can see where I made a mistake, resulting in the faulty CIF files...
>>
>>
>> from ase.io import read, write
>> from ase.visualize import view
>> from ase.build.surfaces_with_termination import surfaces_with_termination
>> from ase.build.tools import sort
>>
>> ana = read('anatase_opt_tzvp.pdb')
>>
>> for N in range(2,13):
>>     s = surfaces_with_termination(ana, (1,0,1), N, vacuum=20, 
>> termination='O')
>>     s = s[1]
>>     s = s.repeat((1,3,1))
>>     s = sort(s, tags=s.positions[:, 2])
>>     name = f'a101-{N}-layer'
>>     write(f'{name}.cif', s)
>>
>>
>> Léon
>>
>> On Wednesday, 28 June 2023 at 15:58:25 UTC+2 Krack Matthias wrote:
>>
>> Hi Léon 
>>
>>  
>>
>> You are using CP2K version 8.2. Newer CP2K versions perform a distance 
>> check for CP2K/Quickstep by default (see also this input keyword 
>> <https://manual.cp2k.org/cp2k-2023_1-branch/CP2K_INPUT/FORCE_EVAL/SUBSYS/PRINT/INTERATOMIC_DISTANCES.html#CHECK_INTERATOMIC_DISTANCES>) 
>> when the system is smaller than 2000 atoms and prints a warning if a small 
>> distance is found. 
>>
>> You can download a pre-compiled binary of CP2K 2023.1 here 
>> <https://github.com/cp2k/cp2k/releases/download/v2023.1/cp2k-2023.1-Linux-gnu-x86_64.ssmp>, 
>> which is sufficient for that initial check.
>>
>>  
>>
>> HTH
>>
>>  
>>
>> Matthias
>>
>>  
>>
>> *From: *cp... at googlegroups.com <cp... at googlegroups.com> on behalf of 
>> Léon Luntadila Lufungula <Leon.luntad... at uantwerpen.be>
>> *Date: *Wednesday, 28 June 2023 at 15:46
>> *To: *cp2k <cp... at googlegroups.com>
>> *Subject: *Re: [CP2K:19017] Re: TiO2 slab not converging
>>
>> Hi Matthias,
>>
>>  
>>
>> Thanks for you reply!
>>
>>  
>>
>> I looked at my CIF file in various visualization software and it looked 
>> okay there. Is there a way to check this via CP2K to be sure?
>>
>> I also have some preliminary results of some ongoing calculations with 
>> DIIS/FULL_ALL and DIIS/FULL_SINGLE_INVERSE and these seem to be a bit 
>> faster than CG but reaching convergence is still a big issue (see 
>> attachments).
>>
>> Best,
>> Léon
>>
>>  
>>
>> On Wednesday, 28 June 2023 at 15:35:32 UTC+2 Krack Matthias wrote:
>>
>> Hi Léon
>>
>>  
>>
>> Did you check the set of atomic coordinates read from the cif file for 
>> close contacts possibly caused by the periodic boundary conditions?
>>
>>  
>>
>> Best
>>
>>  
>>
>> Matthias
>>
>>  
>>
>> *From: *cp... at googlegroups.com <cp... at googlegroups.com> on behalf of 
>> Léon Luntadila Lufungula <Leon.luntad... at uantwerpen.be>
>> *Date: *Wednesday, 28 June 2023 at 14:16
>> *To: *cp2k <cp... at googlegroups.com>
>> *Subject: *[CP2K:19014] Re: TiO2 slab not converging
>>
>> I forgot to add the cif file which is read with the input, so here it is 
>> if someone needs it.
>>
>> On Wednesday, 28 June 2023 at 13:54:37 UTC+2 Léon Luntadila Lufungula 
>> wrote:
>>
>> Update:
>>
>> I tried to optimize a 3-layer slab with altered SCF cycle settings (inner 
>> loop: 15 steps, outer loop: 45 steps) and still it does not converge. The 
>> convergence goes towards 2E-7 after 22 outer SCF cycles, but then doesn't 
>> seem to get lower (see attachment a101-3-layer-jobID_188.out). I tried to 
>> restart the calculation with altered EPS_SCF (= 1E-6) and then the 
>> restarted SCF cycle converges as the convergence was already below 1E-6. 
>> Unfortunately, after that the SCF again seems to only very slowly converge, 
>> after 27 outer SCF steps it's still only at 8E-5 convergence (see 
>> attachment a101-3-layer-jobID_189.out). Can anybody please help me out? I 
>> feel like the calculation is not converging properly, as after nearly 2 
>> hours it still hasn't converged one SCF cycle but I don't know what might 
>> be wrong orhow to fix it... Requiring 300+ steps to reach SCF convergence 
>> seems quite high to me and makes me start to think there is something 
>> fundamentally wrong with my input. If anyone could look at my inputs and 
>> tell me what's wrong with them, I would be forever thankful!
>>
>> Kind regards,
>>
>> Léon 
>>
>> P.S. Could the TZVP basis set pose a problem? I often see people use 
>> DZVP-SR for similar calculations, but my promotor and co-promotor both told 
>> me that TZVP is required for proper energetics and should be used in 
>> production runs.
>>
>> On Wednesday, 28 June 2023 at 10:04:07 UTC+2 Léon Luntadila Lufungula 
>> wrote:
>>
>> Dear all,
>>
>>  
>>
>> I am trying to determine the ideal slab thickness for an anatase (101) 
>> slab but my SCF cycles are not converging. I optimized the cutoffs for the 
>> anatase bulk and did a CELL_OPT calculation on the unit cell to get the 
>> converged structure. From this optimized unit cell, I then used ASE to 
>> build the (101) slabs  with a 20 Å vacuum width and thicknesses varying 
>> from 2 to 12 layers. During the GEO_OPT calculation I keep the bottom layer 
>> frozen to act as the bulk. I started the 2-layer calculation yesterday but 
>> when I looked at the output today, I see that the SCF cycle fails at every 
>> step of the geometry optimization (see output in attachment). Is there 
>> something wrong with my setup (too tight convergence criteria, wrong SCF 
>> setup, ...), or is it because a 2-layer structure is perhaps too small? The 
>> changes in energy go to 1E-5 - 1E-6 but never reach the convergence 
>> criteria of 1E-7 even after 300 steps (inner cycle: 10 steps, outer cycle 
>> 30 steps). I would guess that it could converge if I would increase the 
>> maximum number of steps, but 300 steps already seems quite a lot to me, 
>> although I could be wrong...
>>
>>  
>>
>> If anyone could share their thoughts on the situation so I can continue 
>> my work, I would greatly appreciate the help! Thanks in advance!
>>
>>  
>>
>> Best regards,
>>
>> Léon
>>
>> -- 
>> 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/12b3aec6-38d8-404f-b68f-aa681ccd6266n%40googlegroups.com 
>> <https://groups.google.com/d/msgid/cp2k/12b3aec6-38d8-404f-b68f-aa681ccd6266n%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/94c9ad9e-58b3-4af1-844e-34b82c2fbed6n%40googlegroups.com 
>> <https://groups.google.com/d/msgid/cp2k/94c9ad9e-58b3-4af1-844e-34b82c2fbed6n%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/2fb6de53-e6de-44ce-84d4-34ebbe1fb14bn%40googlegroups.com 
>> <https://groups.google.com/d/msgid/cp2k/2fb6de53-e6de-44ce-84d4-34ebbe1fb14bn%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/85703e25-7ad2-4fc4-9a82-43261d13ab81n%40googlegroups.com 
>> <https://groups.google.com/d/msgid/cp2k/85703e25-7ad2-4fc4-9a82-43261d13ab81n%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/f8c23295-cf28-4f92-a65a-aff594ea3c03n%40googlegroups.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.cp2k.org/archives/cp2k-user/attachments/20230629/9498ab4b/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 3mppa-ase-edited.cif
Type: chemical/x-cif
Size: 1503 bytes
Desc: not available
URL: <https://lists.cp2k.org/archives/cp2k-user/attachments/20230629/9498ab4b/attachment-0003.cif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 3mppa-ase.cif
Type: chemical/x-cif
Size: 1503 bytes
Desc: not available
URL: <https://lists.cp2k.org/archives/cp2k-user/attachments/20230629/9498ab4b/attachment-0004.cif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 3mppa.cif
Type: chemical/x-cif
Size: 1931 bytes
Desc: not available
URL: <https://lists.cp2k.org/archives/cp2k-user/attachments/20230629/9498ab4b/attachment-0005.cif>


More information about the CP2K-user mailing list