Skip to content

Fmax does not reach the set value #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
lauthirteen opened this issue Apr 2, 2025 · 4 comments
Open

Fmax does not reach the set value #20

lauthirteen opened this issue Apr 2, 2025 · 4 comments

Comments

@lauthirteen
Copy link

I use abacus' lcao method to calculate the diffusion path of H in SiO2 with Dynamic NEB method of ATST.

The parameters of neb_run.py are set as follows:

# JamesMisaka in 2023-11-27
# Run NEB calculation on NEB images by ASE-ABACUS
# part of ATST-Tools scripts

from ase.optimize import FIRE, BFGS
from ase.io import read, write
from abacus_neb import AbacusNEB

# setting
mpi = 32
omp = 1
fmax = 0.05  # eV / Ang
neb_optimizer = FIRE # suited for CI-NEB
neb_directory = "NEBrun"
algorism = "improvedtangent" # IT-NEB is recommended
climb = True
dyneb = True  
parallel = True
k = 0.10 # eV/Ang^2, spring constant
init_chain = "init_neb_chain.traj"
abacus = "abacus"
#lib_dir = "/lustre/home/2201110432/example/abacus"
lib_dir = "./"
pseudo_dir = f"{lib_dir}/"
basis_dir = f"{lib_dir}/"
# default pp and basis is supported by ase-abacus interface, need to check usage
pp = {
      'Si':'Si_ONCV_PBE-1.0.upf',
      'O':'O_ONCV_PBE-1.0.upf',
      'H':'H_ONCV_PBE-1.0.upf',
     }
basis = {
         'Si':'Si_gga_9au_100Ry_3s3p2d.orb',
         'O': 'O_gga_9au_100Ry_3s3p2d.orb',
         'H': 'H_gga_9au_100Ry_3s2p.orb',
          }
kpts = [4, 4, 4]
parameters = {
        'relax_nmax': 200,
        'calculation': 'scf',
        'symmetry': 0,
        'basis_type': 'lcao',
        'ecutwfc': 250.0,
        'scf_thr': 1.0e-08,
        'scf_nmax': 500,
        'smearing_method': 'gauss',
        'smearing_sigma': 0.002,
        'mixing_type': 'pulay',
        'mixing_beta': 0.7,
        'cal_force': 1,
        'cal_stress': 1,
        'kspacing': 0.10,
        'kpts': kpts,
        'pp': pp,
        'basis': basis,
        'pseudo_dir': pseudo_dir,
        'basis_dir': basis_dir,
}


if __name__ == "__main__":
# running process
# read initial guessed neb chain
    init_chain = read(init_chain, index=':')
    neb = AbacusNEB(init_chain, parameters=parameters, parallel=parallel,
                    directory=neb_directory, mpi=mpi, omp=omp, abacus=abacus, 
                    algorism=algorism, k=k, dyneb=dyneb)
    neb.run(optimizer=neb_optimizer, climb=climb, fmax=fmax)

According to the output results, the fmax value cannot reach 0.05 and around 0.075. If I change the fmax to 0.075, it still can't converge to 0.075 and fluctuate at a value larger than 0.075. as follows:

Notice: Dynamic NEB method is set
Parallel calculation is auto set to False
----- Running Dynamic NEB -----
----- improvedtangent method is being used -----
----- Default scale_fmax = 1.0 -----
      Step     Time          Energy          fmax
FIRE:    0 22:59:59   -23543.521838        1.560897
FIRE:    1 00:42:08   -23543.625667        0.863522
FIRE:    2 02:24:13   -23543.694990        0.900411
FIRE:    3 04:05:07   -23543.744333        1.020795
FIRE:    4 05:43:09   -23543.808494        0.548438
FIRE:    5 07:11:27   -23543.844672        0.510978
FIRE:    6 08:41:38   -23543.855357        0.728637
FIRE:    7 10:10:51   -23543.861559        0.621778
FIRE:    8 11:44:01   -23543.870943        0.428066
FIRE:    9 13:04:06   -23543.879388        0.215936
FIRE:   10 14:13:45   -23543.884337        0.198894
FIRE:   11 15:24:14   -23543.886707        0.268543
FIRE:   12 16:34:48   -23543.889423        0.329079
FIRE:   13 17:45:17   -23543.893988        0.310069
FIRE:   14 18:56:07   -23543.900323        0.197662
FIRE:   15 19:46:28   -23543.905994        0.158732
FIRE:   16 20:26:11   -23543.909161        0.227155
FIRE:   17 21:06:14   -23543.909578        0.214376
FIRE:   18 21:46:05   -23543.910324        0.189741
FIRE:   19 22:26:13   -23543.911264        0.155589
FIRE:   20 23:06:07   -23543.912239        0.114930
FIRE:   21 23:25:56   -23543.913155        0.086062
FIRE:   22 23:35:41   -23543.914005        0.086708
FIRE:   23 23:45:20   -23543.914834        0.097372
FIRE:   24 23:55:01   -23543.915828        0.104393
FIRE:   25 00:04:44   -23543.917102        0.099037
FIRE:   26 00:14:22   -23543.918664        0.089413
FIRE:   27 00:33:57   -23543.920362        0.060374
FIRE:   28 00:43:47   -23543.922184        0.066018
FIRE:   29 00:53:27   -23543.924220        0.082759
FIRE:   30 01:03:12   -23543.924268        0.098229
FIRE:   31 01:23:01   -23543.925239        0.056123
FIRE:   32 01:32:42   -23543.926536        0.057002
FIRE:   33 01:52:00   -23543.928106        0.059025
FIRE:   34 02:11:28   -23543.929824        0.061346
FIRE:   35 02:31:03   -23543.931827        0.064499
FIRE:   36 02:50:22   -23543.933640        0.107712
FIRE:   37 03:00:02   -23543.934005        0.067645
FIRE:   38 03:09:43   -23543.935926        0.072705
FIRE:   39 03:29:04   -23543.936497        0.128907
FIRE:   40 03:38:52   -23543.937584        0.074894
FIRE:   41 03:48:31   -23543.937611        0.074947
FIRE:   42 03:58:17   -23543.937658        0.075045
FIRE:   43 04:08:00   -23543.937687        0.079497
FIRE:   44 04:17:56   -23543.937716        0.075194
FIRE:   45 04:27:59   -23543.937717        0.075201
FIRE:   46 04:38:05   -23543.937718        0.075200
FIRE:   47 04:48:22   -23543.937719        0.075208
FIRE:   48 04:58:38   -23543.937723        0.077527
FIRE:   49 05:08:51   -23543.937724        0.075210
FIRE:   50 05:19:07   -23543.937724        0.075211
FIRE:   51 05:29:18   -23543.937724        0.075211
FIRE:   52 05:39:16   -23543.937724        0.077530
FIRE:   53 05:49:06   -23543.937724        0.077530
FIRE:   54 05:58:49   -23543.937725        0.075213
FIRE:   55 06:08:48   -23543.937725        0.075213
FIRE:   56 06:18:28   -23543.937725        0.075213
FIRE:   57 06:28:29   -23543.937725        0.075213
FIRE:   58 06:38:09   -23543.937725        0.075214
FIRE:   59 06:47:53   -23543.937725        0.075214
FIRE:   60 06:57:34   -23543.937725        0.075215
FIRE:   61 07:07:11   -23543.937725        0.075215
FIRE:   62 07:16:56   -23543.937724        0.075212
FIRE:   63 07:26:58   -23543.937724        0.075213
FIRE:   64 07:36:38   -23543.937724        0.075213
FIRE:   65 07:46:20   -23543.937724        0.075213
FIRE:   66 07:56:20   -23543.937724        0.075213
FIRE:   67 08:05:59   -23543.937725        0.077485
FIRE:   68 08:15:47   -23543.937725        0.077485
FIRE:   69 08:25:29   -23543.937725        0.077499
FIRE:   70 08:35:19   -23543.937725        0.077503
FIRE:   71 08:45:15   -23543.937725        0.077503
FIRE:   72 08:54:56   -23543.937725        0.077507
FIRE:   73 09:04:47   -23543.937725        0.077507
FIRE:   74 09:14:28   -23543.937725        0.077507
FIRE:   75 09:24:10   -23543.937725        0.077507
FIRE:   76 09:34:13   -23543.937725        0.075213
FIRE:   77 09:43:52   -23543.937725        0.075213
FIRE:   78 09:53:30   -23543.937725        0.075213
FIRE:   79 10:03:10   -23543.937725        0.075213
FIRE:   80 10:13:09   -23543.937725        0.075213
FIRE:   81 10:22:55   -23543.937725        0.075213
FIRE:   82 10:32:49   -23543.937725        0.075213
FIRE:   83 10:42:38   -23543.937725        0.075213
FIRE:   84 10:52:26   -23543.937725        0.075213
FIRE:   85 11:02:19   -23543.937725        0.075213
FIRE:   86 11:12:07   -23543.937725        0.075214
FIRE:   87 11:22:00   -23543.937725        0.075214
FIRE:   88 11:31:51   -23543.937725        0.075214
FIRE:   89 11:41:42   -23543.937725        0.075214
FIRE:   90 11:51:20   -23543.937725        0.075214
FIRE:   91 12:01:04   -23543.937725        0.075214
FIRE:   92 12:10:57   -23543.937724        0.075213
FIRE:   93 12:20:52   -23543.937724        0.075211
FIRE:   94 12:30:52   -23543.937724        0.075211
FIRE:   95 12:40:54   -23543.937724        0.075211
FIRE:   96 12:50:58   -23543.937724        0.075212
FIRE:   97 13:01:00   -23543.937724        0.075214
FIRE:   98 13:11:03   -23543.937724        0.075217
FIRE:   99 13:21:21   -23543.937725        0.075218
FIRE:  100 13:31:30   -23543.937726        0.077502
FIRE:  101 13:41:30   -23543.937726        0.077502
FIRE:  102 13:51:39   -23543.937726        0.077502
FIRE:  103 14:01:26   -23543.937726        0.077502
FIRE:  104 14:11:15   -23543.937726        0.077498
FIRE:  105 14:21:15   -23543.937726        0.077498
FIRE:  106 14:31:02   -23543.937726        0.075224
FIRE:  107 14:40:46   -23543.937726        0.075224
FIRE:  108 14:50:30   -23543.937726        0.075224
FIRE:  109 15:00:09   -23543.937726        0.075224
FIRE:  110 15:09:51   -23543.937726        0.075224
FIRE:  111 15:19:50   -23543.937726        0.075224
FIRE:  112 15:29:43   -23543.937726        0.075226
FIRE:  113 15:39:32   -23543.937726        0.075226
FIRE:  114 15:49:14   -23543.937726        0.075226
FIRE:  115 15:58:58   -23543.937726        0.075226
FIRE:  116 16:08:45   -23543.937726        0.075226
FIRE:  117 16:18:32   -23543.937726        0.075226
FIRE:  118 16:28:24   -23543.937725        0.075224
FIRE:  119 16:38:06   -23543.937725        0.075224
FIRE:  120 16:47:46   -23543.937725        0.075226
FIRE:  121 16:57:51   -23543.937725        0.075225
FIRE:  122 17:07:51   -23543.937725        0.075226
FIRE:  123 17:17:31   -23543.937725        0.075226
FIRE:  124 17:27:24   -23543.937726        0.075223
FIRE:  125 17:37:16   -23543.937726        0.075224
FIRE:  126 17:47:01   -23543.937726        0.075223
FIRE:  127 17:56:43   -23543.937727        0.077491
FIRE:  128 18:06:31   -23543.937727        0.077491
FIRE:  129 18:16:22   -23543.937727        0.077491
FIRE:  130 18:26:10   -23543.937727        0.077496
FIRE:  131 18:35:48   -23543.937727        0.077493
FIRE:  132 18:45:41   -23543.937727        0.077497
FIRE:  133 18:55:20   -23543.937727        0.075225
FIRE:  134 19:05:10   -23543.937727        0.075225
FIRE:  135 19:14:56   -23543.937727        0.075225
FIRE:  136 19:24:51   -23543.937727        0.075225
FIRE:  137 19:34:33   -23543.937727        0.075225
FIRE:  138 19:44:17   -23543.937727        0.075225
FIRE:  139 19:53:58   -23543.937727        0.075225
FIRE:  140 20:03:53   -23543.937727        0.075225
FIRE:  141 20:13:35   -23543.937727        0.075226
FIRE:  142 20:23:40   -23543.937727        0.075228
FIRE:  143 20:33:26   -23543.937727        0.075228
FIRE:  144 20:43:31   -23543.937727        0.075228
FIRE:  145 20:53:11   -23543.937727        0.075228
FIRE:  146 21:03:10   -23543.937727        0.075228
FIRE:  147 21:13:17   -23543.937726        0.075225
FIRE:  148 21:22:58   -23543.937726        0.075226
FIRE:  149 21:32:45   -23543.937726        0.075227
FIRE:  150 21:42:31   -23543.937727        0.075226
FIRE:  151 21:52:49   -23543.937727        0.075228
FIRE:  152 22:02:51   -23543.937727        0.075229
FIRE:  153 22:12:37   -23543.937728        0.077135
FIRE:  154 22:22:17   -23543.937728        0.077135
FIRE:  155 22:31:56   -23543.937728        0.075228
FIRE:  156 22:41:39   -23543.937728        0.075228
FIRE:  157 22:51:19   -23543.937728        0.075228
FIRE:  158 23:01:03   -23543.937728        0.075228
FIRE:  159 23:10:54   -23543.937728        0.075228
FIRE:  160 23:20:46   -23543.937728        0.075228
FIRE:  161 23:30:44   -23543.937728        0.075228
FIRE:  162 23:40:30   -23543.937728        0.075228
FIRE:  163 23:50:10   -23543.937728        0.075227
FIRE:  164 23:59:51   -23543.937728        0.075227
FIRE:  165 00:09:31   -23543.937728        0.075227
FIRE:  166 00:19:24   -23543.937728        0.075227
FIRE:  167 00:29:09   -23543.937728        0.075227
FIRE:  168 00:38:53   -23543.937728        0.075227
FIRE:  169 00:48:38   -23543.937728        0.075227
FIRE:  170 00:58:20   -23543.937728        0.075228
FIRE:  171 01:08:03   -23543.937728        0.075227
FIRE:  172 01:18:01   -23543.937729        0.077134
FIRE:  173 01:27:35   -23543.937729        0.077134
FIRE:  174 01:37:15   -23543.937729        0.077134
FIRE:  175 01:46:52   -23543.937729        0.077134
FIRE:  176 01:56:32   -23543.937729        0.077140
FIRE:  177 02:06:08   -23543.937729        0.077100
FIRE:  178 02:15:56   -23543.937729        0.077100
FIRE:  179 02:25:31   -23543.937729        0.077100
FIRE:  180 02:35:07   -23543.937729        0.077100
FIRE:  181 02:44:58   -23543.937729        0.077100
FIRE:  182 02:55:03   -23543.937729        0.075222
FIRE:  183 03:05:07   -23543.937729        0.075222
FIRE:  184 03:14:51   -23543.937729        0.075222
FIRE:  185 03:24:38   -23543.937729        0.075222
FIRE:  186 03:34:18   -23543.937729        0.075222
FIRE:  187 03:44:08   -23543.937729        0.075222
FIRE:  188 03:53:52   -23543.937729        0.075222
FIRE:  189 04:03:34   -23543.937729        0.075222
FIRE:  190 04:13:28   -23543.937729        0.075222
FIRE:  191 04:23:16   -23543.937729        0.075222
FIRE:  192 04:33:10   -23543.937729        0.075223
FIRE:  193 04:42:54   -23543.937729        0.075223
FIRE:  194 04:52:45   -23543.937729        0.075222
FIRE:  195 05:02:24   -23543.937729        0.075222
FIRE:  196 05:12:11   -23543.937729        0.075225
FIRE:  197 05:21:47   -23543.937729        0.075226
FIRE:  198 05:31:43   -23543.937729        0.075226
FIRE:  199 05:41:26   -23543.937729        0.075226
FIRE:  200 05:51:06   -23543.937728        0.075219
FIRE:  201 06:00:54   -23543.937729        0.075217
FIRE:  202 06:10:36   -23543.937729        0.075218
FIRE:  203 06:20:15   -23543.937729        0.075218
FIRE:  204 06:29:57   -23543.937729        0.075219
FIRE:  205 06:39:39   -23543.937729        0.075223
FIRE:  206 06:49:27   -23543.937730        0.077098
FIRE:  207 06:59:01   -23543.937730        0.075221
FIRE:  208 07:08:56   -23543.937730        0.075221
FIRE:  209 07:18:32   -23543.937730        0.075221
FIRE:  210 07:28:12   -23543.937730        0.075221
FIRE:  211 07:37:49   -23543.937730        0.075221
FIRE:  212 07:47:36   -23543.937730        0.075221
FIRE:  213 07:57:41   -23543.937730        0.075221
FIRE:  214 08:07:49   -23543.937730        0.075221
FIRE:  215 08:17:34   -23543.937730        0.075221
FIRE:  216 08:27:14   -23543.937730        0.075221
FIRE:  217 08:36:54   -23543.937730        0.075221
FIRE:  218 08:46:33   -23543.937730        0.075220
FIRE:  219 08:56:07   -23543.937731        0.075220

Of course, if I set the fmax very large (fmx>0.5), it will converge. But isn't 0.5 too big? How can I solve this problem.

@QuantumMisaka
Copy link
Owner

@lauthirteen Thanks for your issue !
The default setting is optimized for chemical reaction on surfaces, for diffusion process, you can try algorism = "aseneb" or algorism = "eb" , and neb_optimizer = BFGS with 5-7 images. they may help.

Also, I'm curious why you're using the ABACUS INPUT setting above, which is not the best for the newest ABACUS

@lauthirteen
Copy link
Author

@lauthirteen Thanks for your issue ! The default setting is optimized for chemical reaction on surfaces, for diffusion process, you can try algorism = "aseneb" or algorism = "eb" , and neb_optimizer = BFGS with 5-7 images. they may help.

Also, I'm curious why you're using the ABACUS INPUT setting above, which is not the best for the newest ABACUS

Thank you very much for your reply. According to this setting, I have successfully obtained the diffusion path of H in SiO2. Why is the image set to 5-7?

In addition, I used this setting to do the diffusion of H in W, but I also encountered the problem of not converging.

Notice: Dynamic NEB method is set
Parallel calculation is auto set to False
----- Running Dynamic NEB -----
----- aseneb method is being used -----
----- Default scale_fmax = 1.0 -----
      Step     Time          Energy          fmax
BFGS:    0 11:19:44   -29872.911034        1.393424
BFGS:    1 12:17:09   -29873.015514        0.866170
BFGS:    2 13:12:42   -29873.100415        0.342458
BFGS:    3 14:08:34   -29873.104774        0.274135
BFGS:    4 15:04:20   -29873.105666        0.258537
BFGS:    5 16:00:01   -29873.104857        0.246755
BFGS:    6 16:55:41   -29873.102619        0.214581
BFGS:    7 17:52:05   -29873.101870        0.207752
BFGS:    8 18:47:43   -29873.103415        0.240505
BFGS:    9 19:43:42   -29873.127851        0.460569
BFGS:   10 20:40:06   -29873.183668        0.649512
BFGS:   11 21:36:45   -29873.239964        1.050126
BFGS:   12 22:33:07   -29873.253463        0.950529
BFGS:   13 23:29:40   -29873.205905        0.666800
BFGS:   14 00:26:15   -29873.247731        0.531898
BFGS:   15 01:21:58   -29873.246287        0.545584
BFGS:   16 02:18:39   -29873.233223        0.685804
BFGS:   17 03:14:35   -29873.247854        0.701341
BFGS:   18 04:11:38   -29873.275432        0.970238
BFGS:   19 05:08:25   -29873.284480        0.932465
BFGS:   20 06:05:10   -29873.300234        0.694410
BFGS:   21 07:01:52   -29873.288352        0.511293
BFGS:   22 07:58:18   -29873.277034        0.610165
BFGS:   23 08:55:12   -29873.266693        0.530987
BFGS:   24 09:52:27   -29873.268510        0.570654
BFGS:   25 10:49:10   -29873.274232        0.714812
BFGS:   26 11:39:36   -29873.287908        0.700797
BFGS:   27 12:36:29   -29873.307518        0.505655
BFGS:   28 13:25:49   -29873.321577        0.325417
BFGS:   29 14:15:06   -29873.326569        0.314007
BFGS:   30 15:04:20   -29873.327697        0.299957
BFGS:   31 15:53:39   -29873.327580        0.292718
BFGS:   32 16:43:12   -29873.325295        0.279032
BFGS:   33 17:33:02   -29873.321700        0.262772
BFGS:   34 18:22:56   -29873.319399        0.314814
BFGS:   35 19:13:02   -29873.320247        0.308973
BFGS:   36 20:02:53   -29873.322890        0.275253
BFGS:   37 20:52:02   -29873.324856        0.276791
BFGS:   38 21:41:11   -29873.326352        0.264786
BFGS:   39 22:30:05   -29873.327583        0.214499
BFGS:   40 23:18:45   -29873.328118        0.159961
BFGS:   41 00:08:01   -29873.327620        0.159489
BFGS:   42 00:50:01   -29873.327004        0.122226
BFGS:   43 01:39:00   -29873.325451        0.155395
BFGS:   44 02:21:00   -29873.325336        0.159956
BFGS:   45 03:03:04   -29873.325725        0.136192
BFGS:   46 03:45:02   -29873.325331        0.142713
BFGS:   47 04:26:54   -29873.324971        0.164526
BFGS:   48 05:08:50   -29873.325414        0.165113
BFGS:   49 05:57:49   -29873.338167        0.646409
BFGS:   50 06:46:49   -29873.325771        0.230612
BFGS:   51 07:21:48   -29873.326400        0.100243
BFGS:   52 07:49:44   -29873.326610        0.086798
BFGS:   53 08:24:49   -29873.326898        0.082635
BFGS:   54 09:00:31   -29873.327067        0.485581
BFGS:   55 09:49:16   -29873.307981        0.686673
BFGS:   56 10:38:46   -29873.320426        0.495276
BFGS:   57 11:29:29   -29873.326856        0.655276
BFGS:   58 12:19:29   -29873.326125        0.508171
BFGS:   59 13:09:08   -29873.325082        0.418605
BFGS:   60 13:58:30   -29873.353787        0.471494
BFGS:   61 14:48:45   -29873.380504        1.371547

(I have modified the ABACUS INPUT setting, thanks for your advice)

@QuantumMisaka
Copy link
Owner

QuantumMisaka commented Apr 7, 2025

@lauthirteen
It is common to encounter NEB convergence problem, especially when you're using dyneb. You can try to change this parameters:

  • number of images. normally 5 - 8 images in the whole CI-NEB chain is enough.
  • optimizer: BFGS or FIRE
  • algorism: improvedtangent (work well for reaction and some diffusion process), aseneb, eb
  • scale_fmax: the dynamic scale for dyneb, 1.0 is normal for using dyneb accelerator, but will lead to hard convergence if the number of images is not enough. You can try to improve the image numbers, or use scale_fmax 0.5 or scale_fmax 0

Hope these will help

@QuantumMisaka
Copy link
Owner

@lauthirteen Another suggestion is AutoNEB, you can try it under ATST-Tools framework

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants