Fmax, DM, calculations time

Dear All,

I have a few questions about the ASE NEB method.

  1. Could you please explain how the fmax parameter is precisely obtained from the calculator? I am using Siesta DFT, which outputs forces in eV/Å for each atom. However, I am unable to find a value comparable to fmax in the optimization. Specifically, I use the MDMin optimizer and BFGS. Is there an equation available to calculate this?

  2. Is it possible to implement the density matrix into the ASE NEB algorithm? Siesta can output the density matrix after each job, and I believe it could potentially expedite calculations.

  3. In my system, I have approximately 230 atoms (GaN bulk with different surfaces). Could you provide an estimate of the calculation time and suggest an appropriate fmax parameter to start with? Any insights based on your experience would be greatly appreciated.

Currently, I have set fmax to about 0.1. However, in some cases, even after 10-14 days, it does not fall below 0.4-0.5.

Best regards,
K.

Could you please explain how the fmax parameter is precisely obtained from the calculator? I am using Siesta DFT, which outputs forces in eV/Å for each atom. However, I am unable to find a value comparable to fmax in the optimization. Specifically, I use the MDMin optimizer and BFGS. Is there an equation available to calculate this?

When largest force is below fmax, the optimization stops. The force in NEB comes from the DFT code as well as the NEB “springs”.

Is it possible to implement the density matrix into the ASE NEB algorithm? Siesta can output the density matrix after each job, and I believe it could potentially expedite calculations.

You mean to get Siesta to reuse the density matrix from one step in the subsequent step. I don’t know how to tell the ordinary Siesta calculator to do that, but you can consider equipping each image with a SocketIOCalculator.

In my system, I have approximately 230 atoms (GaN bulk with different surfaces). Could you provide an estimate of the calculation time and suggest an appropriate fmax parameter to start with? Any insights based on your experience would be greatly appreciated.

That’s not possible as NEB simulations are non-trivial. You must start with small test systems until you learn how it behaves. Build smaller working examples of the optimization which you can converge quickly and well before you scale to hundreds of atoms.

@askhl I’m investigating fmax calculations.

   Step     Time          Energy         fmax

MDMin: 0 16:08:23 -298099.483062 0.1508
MDMin: 1 20:08:07 -298099.485174 0.1334
MDMin: 2 00:11:24 -298099.488300 0.1020
MDMin: 3 04:12:35 -298099.491210 0.0945
MDMin: 4 08:16:00 -298099.492426 0.0917
MDMin: 5 12:16:57 -298099.494412 0.0891
MDMin: 6 16:17:51 -298099.495456 0.0845
MDMin: 7 20:14:27 -298099.496807 0.0800
MDMin: 8 00:01:50 -298099.496998 0.0742
MDMin: 9 03:57:25 -298099.498811 0.0726
MDMin: 10 07:54:00 -298099.499468 0.0706
MDMin: 11 12:02:19 -298099.500299 0.0677
MDMin: 12 16:07:17 -298099.500692 0.0657
MDMin: 13 20:05:18 -298099.501686 0.0653
MDMin: 14 00:06:53 -298099.502237 0.0635
MDMin: 15 04:01:32 -298099.503000 0.0635
MDMin: 16 08:01:55 -298099.503454 0.0629
MDMin: 17 12:01:13 -298099.504104 0.0632
MDMin: 18 16:09:52 -298099.504622 0.0634
MDMin: 19 20:13:51 -298099.505359 0.0629
MDMin: 20 00:29:44 -298099.505861 0.0624
MDMin: 21 04:35:12 -298099.506360 0.0631
MDMin: 22 08:43:01 -298099.506848 0.0627
MDMin: 23 12:38:15 -298099.507577 0.0628
MDMin: 24 16:41:32 -298099.508125 0.0622
MDMin: 25 20:43:41 -298099.508558 0.0626
MDMin: 26 00:51:46 -298099.509052 0.0626
MDMin: 27 04:56:25 -298099.509781 0.0606
MDMin: 28 09:04:30 -298099.510379 0.0589
MDMin: 29 13:16:18 -298099.510793 0.0581
MDMin: 30 17:28:07 -298099.511266 0.0569
MDMin: 31 21:41:27 -298099.511986 0.0546
MDMin: 32 01:57:59 -298099.512610 0.0529
MDMin: 33 06:07:33 -298099.513031 0.0520
MDMin: 34 10:20:50 -298099.513482 0.0508
MDMin: 35 14:30:38 -298099.514167 0.0504
MDMin: 36 18:37:00 -298099.514781 0.0494

I take the forces from last optimization, fmax = 0.0494.

x_force y_force z_force F
0,00004389 -0,00002093 -0,00073048 0,000732096597041675
0,00002813 -0,00001558 -0,00065843 0,000659214758785026
0,00003245 -0,00000992 -0,00067347 0,000674324291272382
0,00004008 -0,00001275 -0,00070271 0,000703967551098771
0,0000325 -0,00001363 -0,00062678 0,000627770017840929
0,00004111 -0,00002 -0,00066982 0,000671378331866616
0,00003558 -0,00001843 -0,00068777 0,000688936262799397
0,00003337 -0,0000064 -0,0006872 0,000688039502427005
0,00003065 -0,00001124 -0,00066553 0,000666330204178079
0,00005268 0,00000051 -0,00072724 0,000729145705672056
0,00004368 -0,00002707 -0,00069296 0,000694862784224339
0,00002705 -0,00001566 -0,0006472 0,000647954302478192
0,00012858 -0,00003664 0,00174588 0,00175099179906703
0,00011053 -0,00000278 0,00160285 0,00160665887225634
0,00013637 -0,00000761 0,00163131 0,00163701771679478
0,00009364 -0,00002831 0,00168569 0,00168852618629383
0,00019427 0,00001586 0,00157341 0,00158543729002443
0,00012493 0,00000093 0,00162954 0,00163432217796859
0,00013318 0,0000127 0,00162591 0,00163140477212125
0,00011953 -0,00000386 0,00166787 0,001672152103548
0,00012262 -0,00000417 0,00162543 0,00163005390653193
0,00011691 -0,00003039 0,00174485 0,00174902630703486
0,00013506 -0,00001247 0,00167189 0,00167738274600641
0,00011966 -0,00000627 0,00158545 0,00158997155037441
0,00003998 0,00016632 0,00074616 0,000765516484734326
0,00006196 0,00017466 0,000744 0,000766734085064698
0,00005433 0,0001599 0,00079352 0,000811291408373095
0,00006315 0,00018769 0,00073791 0,000764020043388915
0,00005232 0,00018281 0,00073228 0,000756565183510317
0,00006955 0,00016321 0,00080445 0,00082378061952197
0,00005078 0,00016555 0,00075657 0,000776133735769809
0,00002517 0,00018694 0,00073318 0,000757055483369614
0,00006495 0,00018743 0,00071723 0,000744155481267188
0,00005188 0,00016776 0,00074181 0,000762310322703294
0,00004368 0,00016604 0,00080692 0,000824983097038964
0,00006209 0,00017167 0,00076837 0,000789758326261901
0,00014763 0,00030933 -0,00268349 0,00270529078767884
0,00008611 0,00057775 -0,00272912 0,00279093281341561
0,00015663 0,00053754 -0,00265418 0,00271259169078208
0,00015627 0,00058809 -0,00262409 0,00269371833885802
0,00021227 0,00054983 -0,00259885 0,00266484387991117
0,00013701 0,00035862 -0,00267896 0,00270632716538485
0,00013141 0,0003653 -0,00276108 0,00278823877107037
0,00016962 0,00054441 -0,00270102 0,00276055469659632
0,00012436 0,00033471 -0,00272051 0,00274384235221341
0,00009233 0,00054798 -0,00267171 0,002728890110173
0,00013161 0,00062689 -0,00269135 0,00276652798408041
0,00023001 0,00033823 -0,00269493 0,00272579379959306
0,00008585 -0,00051656 -0,00038682 0,000651025474539975
0,00013244 -0,00055618 -0,00015411 0,000592137178447697
0,00008374 -0,0005812 0,00020031 0,00062042721063796
0,00009217 -0,00048946 -0,00020718 0,000539434845834045
0,00012334 -0,00054515 -0,00048033 0,000736965526330778
0,00012627 -0,0005037 -0,00013074 0,000535491130178643
0,0001156 -0,00049946 -0,00002939 0,00051350503765786
0,00005322 -0,00053669 -0,00006345 0,000543041828039056
0,00010449 -0,00056798 0,00009544 0,000585344543068439
0,00006317 -0,00054955 -0,00011537 0,000565071578032376
0,00009513 -0,00057994 -0,00009377 0,000595124300797741
0,00010796 -0,00053718 -0,00046439 0,000718244934614926
0,00051849 -0,00011693 0,00343546 0,00347633282592447
0,00011441 0,00041397 0,00311445 0,00314392423755726
0,00072978 0,00050183 0,003438 0,00355024734311569
0,00059398 0,00011243 0,00403144 0,00407651336547545
0,00042863 0,00003759 0,00378955 0,00381389904002453
0,00053538 0,00029149 0,00345988 0,0035131706162525
0,00057312 0,00027549 0,00283135 0,00290187940772872
0,00036921 0,00033414 0,00345384 0,00348955245114613
0,00039166 0,00025487 0,00412837 0,00415473165552241
0,00024742 -0,00000414 0,00324818 0,00325759222561695
0,00073971 0,00004021 0,00331798 0,00339967336792816
0,00063622 0,00062488 0,00339041 0,00350572829393551
0,00023184 0,00008413 0,00080756 0,00084438190180747
0,00055824 -0,00068016 0,0000868 0,000884185366990429
-0,00009791 -0,00057783 0,00133214 0,00145535935651646
-0,00028174 -0,00013187 0,00008153 0,000321580884693105
0,00031586 0,00011477 -0,00012868 0,000359858631826444
0,00047846 -0,00018098 0,00202636 0,00208993123848609
0,00005818 -0,00031949 0,0010686 0,00111685483949348
0,00014483 -0,00066977 -0,00042822 0,000808046997519327
-0,00020492 -0,00044079 -0,00044858 0,000661446934303879
0,00047043 0,00005196 0,00036895 0,000600106931304747
0,00000787 0,00020931 0,00144673 0,00146181404627949
0,00014103 -0,00053726 0,00105307 0,00119058565143378
0,00019096 0,00063612 0,00569206 0,00573067722172519
-0,00002628 0,00053608 0,00143563 0,0015326793212215
0,000809 0,00058292 0,00306807 0,00322603940634643
0,0004132 -0,00007988 0,00639536 0,00640919219434088
-0,0003408 0,00048913 0,00653323 0,00656037247645284
0,00007412 0,00034327 0,00473541 0,00474841404422571
0,00006507 0,00032926 0,00261792 0,00263934677124852
-0,00027501 0,00145992 0,00319169 0,00352049456221708
-0,00042038 -0,00086569 0,00363197 0,00375730549748087
0,0001412 0,00027981 0,00541569 0,00542475153829187
0,00034759 0,00092346 0,00297176 0,0031312864253051
-0,00041958 0,00018872 0,00535049 0,00537023331475458
0,00171307 0,00463565 0,01556412 0,0163299017486879
-0,00361633 0,00121703 0,01395312 0,0144654264515154
-0,00170791 0,00182124 0,01204102 0,0122971555388269
0,00202626 -0,00148265 0,01402151 0,0142445331018675
0,00070363 0,00135893 0,01092549 0,0110321402122118
-0,00065805 0,00553785 0,00964292 0,0111394218230301
0,00322985 0,00432575 0,00785212 0,00952889461477038
-0,00251094 0,00463403 0,00997799 0,0112844733224285
0,00416722 0,00012586 0,01064792 0,0114350235502337
-0,00324872 -0,00233778 0,01088464 0,0115971886634822
-0,00263484 -0,00288812 0,01177223 0,0124043951135434
-0,0005867 0,00283868 0,01047205 0,0108658249679856
-0,0000108 0,00033694 -0,00244764 0,00247074619764961
0,00006453 0,00021145 -0,00222789 0,00223883207845073
0,00007824 0,00022389 -0,00237909 0,00239088215054611
0,000149 0,00037605 -0,00252385 0,00255605818106709
-0,00001167 0,00029781 -0,00212545 0,00214624432148346
0,00004944 0,00027403 -0,00225558 0,00227270277222958
0,00000116 0,00027824 -0,00208401 0,00210250244311392
0,00007762 0,00026948 -0,00209545 0,00211413221850006
0,00002615 0,00018065 -0,0023115 0,00231869586082349
0,00006914 0,00034862 -0,00213103 0,00216046409479537
0,00005548 0,00026619 -0,00231746 0,00233335723756565
0,00006937 0,00030347 -0,00235793 0,00237839023768178
0,00002782 0,00029005 0,00393194 0,00394272179065427
0,00006045 0,0003046 0,00377441 0,00378716334617349
0,00005476 0,00033833 0,00405445 0,00406891025324963
-0,00001496 0,00024927 0,0040155 0,00402325733510796
0,00000604 0,00019736 0,00386139 0,00386643507423828
0,00004937 0,00030002 0,00389165 0,00390350984625375
0,00006078 0,00041135 0,00403038 0,00405177318902478
0,00001062 0,00004101 0,00391967 0,0039198989162222
0,00006045 0,00025122 0,00385303 0,00386168433093644
0,00002821 0,00032249 0,00378171 0,00379554029464844
-0,00005458 0,00033064 0,00404638 0,00406023310788925
0,00014033 0,00021955 0,00385426 0,00386305770847395
-0,0000613 0,00003283 -0,00528485 0,00528530746706377
-0,00015532 0,00022217 -0,00558395 0,00559052604088381
0,0002793 0,00045606 -0,00565728 0,00568250087655075
0,00010009 0,00054623 -0,00537949 0,00540807709644565
-0,00000918 0,00040906 -0,00521893 0,00523494457476868
0,00016144 0,0004765 -0,00546254 0,0054856593382382
-0,00012506 0,00049291 -0,00579144 0,00581372320852137
0,00005009 0,00016548 -0,00581617 0,00581873921974512
-0,00035911 0,00035749 -0,00581041 0,00583246289832177
0,00013064 0,00020152 -0,00526073 0,00526620900201464
-0,00003502 0,00044362 -0,00565293 0,00567041821118161
0,00013686 0,0003896 -0,00564856 0,00566363389470047
0,00005674 0,00027069 0,00493989 0,00494762627082928
0,00010999 0,00040981 0,00522086 0,00523807418578622
0,00010344 0,00068235 0,00498113 0,00502871329795207
0,00006559 0,00024747 0,00451193 0,00451918751258454
-0,00000959 0,00034574 0,00459433 0,00460733070927191
0,00008384 0,00053353 0,00477636 0,00480679708913326
0,00002077 0,00055348 0,00526924 0,00529826968744514
-0,00004325 0,00049931 0,00479315 0,00481928085517954
0,00016051 0,00042451 0,00520805 0,00522778700816129
-0,00014208 0,00048931 0,004953 0,00497913847994811
0,0000768 0,0002033 0,00511518 0,00511979448439095
0,00016095 0,00034995 0,00486394 0,00487916819023489
-0,00028262 0,00064396 -0,00497796 0,00502738941276683
-0,00034838 0,00022896 -0,00485859 0,0048764421553116
-0,000159 0,00070921 -0,00490009 0,00495369981248359
0,00041058 0,00045742 -0,00536875 0,00540382138447414
-0,00013948 0,0002205 -0,00512789 0,00513452342213959
0,00021991 0,00048679 -0,00496146 0,00499013128522687
-0,00032882 0,00072063 -0,0046168 0,00468425793795559
0,00005973 -0,00004029 -0,00541983 0,00542030886443752
-0,00022903 0,00004841 -0,0052487 0,00525391758205246
-0,00034386 0,00059022 -0,00502733 0,00507352404911024
-0,00000357 0,00052926 -0,00541765 0,00544344196395994
-0,00000113 0,00050013 -0,00458178 0,00460899547213924
-0,00034365 0,00073351 0,00273956 0,00285680262464875
0,00014378 0,00047234 0,00304735 0,0030870892093524
-0,00009323 0,00037623 0,00312389 0,00314784522775501
-0,00007037 0,00019224 0,00111347 0,00113213232238992
-0,0004151 0,0004512 0,00154883 0,00166576223360358
0,00017224 0,00054549 0,00337887 0,00342695031107835
-0,00012046 0,00057806 0,00218248 0,00226094735135518
-0,00011004 0,00020276 0,00260003 0,00261024451346995
-0,00021723 0,0002632 0,00270868 0,00273009348838094
-0,00006878 0,00030025 0,00325946 0,00327398232165355
-0,00028352 0,00106356 0,00184652 0,00214969290234675
-0,00000262 0,00020394 0,00270172 0,00270940756373049
-0,00064023 0,00027416 -0,00350117 0,00356976883388827
-0,00020754 0,00045802 -0,00097761 0,00109935275689835
-0,0001545 0,00067504 -0,00268467 0,00277254436583078
-0,00005543 0,00032787 -0,00164741 0,00168063408566529
-0,00017869 0,00056667 -0,00169492 0,00179605089332123
-0,00054327 -0,00001162 -0,00097183 0,00111343202136457
-0,00010102 0,00080162 -0,00222143 0,00236380009935273
-0,00019427 0,00010472 -0,00225385 0,00226462953566361
-0,00070641 0,00041891 -0,00237724 0,00251510848549322
-0,00030056 0,00054333 -0,00131059 0,0014502378944849
-0,00014532 0,00065712 -0,0008307 0,00106910574163644
-0,00011732 -0,00029565 -0,00370578 0,00371940563978978
-0,00007585 0,00055939 -0,0003552 0,000666961344157216
-0,00052831 0,0004755 -0,00078126 0,00105620968263882
-0,00034491 0,00053368 0,00170729 0,00182170700020613
-0,00036523 0,00044498 -0,00300665 0,0030612651593418
-0,00020037 0,00083723 0,00022831 0,000890633294852601
0,00036281 0,00102631 -0,00311821 0,00330275292995101
-0,00019258 0,00076333 0,00144671 0,00164703660232552
0,00014501 -0,00019036 -0,00282287 0,00283299485820218
-0,00021024 0,00021263 0,00142105 0,00145216923152916
0,00001432 0,00081108 0,00046236 0,000933719764383297
-0,00026166 0,00049635 0,00012318 0,000574458519390217
-0,00116708 -0,00036101 -0,00019959 0,00123783686913906
-0,00862073 -0,00251649 0,00075557 0,00901224687177954
-0,00116265 -0,00051952 -0,00051877 0,00137505576825087
-0,0192615 -0,00803205 -0,00617808 0,0217643718480203
-0,00206218 -0,00048805 0,00154086 0,00262011997711937
-0,0067981 -0,00104806 -0,00523708 0,00864520678179533
0,00135505 -0,00266595 0,00175624 0,0034681160364959
0,00188377 -0,00128596 0,00038489 0,00231309810570153
-0,00053335 -0,00207105 -0,0052206 0,00564166417690738
-0,00779677 -0,01285441 0,00323782 0,0153788477212501
0,00381071 -0,00280626 0,00531696 0,00711805236938448
-0,0070774 -0,00498324 -0,00010976 0,00865646110805103
-0,00453144 -0,00351179 -0,00040179 0,00574700380039895
-0,01218654 -0,00986753 0,00544735 0,0165998050438853
-0,00674933 -0,01606438 0,01885406 0,0256728132217118
0,01249124 -0,00482977 -0,02017681 0,0242169654739523
-0,00927623 -0,01107426 -0,00362659 0,0148942885895433
-0,00042405 0,00398755 -0,00496606 0,0063829558457348
0,01731587 0,01063941 0,00637024 0,0212982712130022
-0,00600808 -0,00872185 0,04319137 0,0444709133612724
0,0141746 0,02312563 0,0314429 0,0415255344151872
0,00666152 -0,01623156 -0,03236338 0,0368134181212286
0,00641416 -0,00270686 0,0060559 0,00922726743815308
-0,00164404 0,00032044 -0,01138094 0,0115035361780107
-0,01392687 -0,02488663 -0,01272007 0,0312266271242781
0,00298029 -0,01948027 -0,03313003 0,0385481768123721

x_force, y_force, z_force are in eV/Ang.
In the last column I calculated F like this = ((x_force)^2+(y_force)^2+(z_force)^2)^(1/2), so it’s like vector force length, corresponding to : ase.neb — ASE documentation

def get_fmax(self, **kwargs):
    """Returns fmax, as used by optimizers with NEB."""
    neb = NEB(self.images, **kwargs)
    forces = neb.get_forces()
    return np.sqrt((forces ** 2).sum(axis=1).max())

And here is a problem - there isn’t F=fmax value.

I just want to understand how fmax value is calculated.