crest-lab / crest

CREST - A program for the automated exploration of low-energy molecular chemical space.
https://crest-lab.github.io/crest-docs/
GNU Lesser General Public License v3.0
200 stars 42 forks source link

[QUESTION] - Optimization Coords/Gradient Matching #354

Closed coltonbh closed 3 weeks ago

coltonbh commented 3 weeks ago

Describe the issue I'm trying to know which xyz structure matches the gradient values produced by an optimization run in the crest.engrad file. The final structure in crestopt.log is different from the structure in crestopt.xyz. Should they be the same? Or does the log omit the final structure? Which structure corresponds to the values in crest.engrad?

Thanks so much!

To Reproduce input.toml file:

threads = 16
input = "structure.xyz"
runtype = "optimize"

[calculation]
level = [
    { alpb = "ch2cl2", method = "gfn2", charge = 0, uhf = 0 },
]

structure.xyz file:

57
qcio_charge=0 qcio_multiplicity=1 qcio__identifiers_smiles=[Na+].[S-]/C(=N\c1cc(C(F)(F)F)cc(C(F)(F)F)c1)NC(C)C.CO.C[C@@H]1OC(=O)[C@H](C)OC1=O qcio__identifiers_canonical_smiles=C[C@@H]1OC(=O)[C@@H](OC1=O)C.CC(N/C(=N/c1cc(cc(c1)C(F)(F)F)C(F)(F)F)/[S-])C.CO.[Na+] qcio__identifiers_canonical_smiles_program=openbabel
Na     1.51736   -0.16911    2.65810
S      3.52532    0.92320    1.78029
C      4.07773    0.14584    0.33944
N      3.91815   -1.14422    0.21587
C      3.24544   -2.05996    1.06409
C      3.62308   -2.41609    2.37298
C      2.92629   -3.41746    3.10053
C      3.41955   -3.92439    4.44309
F      4.72702   -4.29030    4.42197
F      3.28317   -3.00620    5.43653
F      2.73666   -5.02789    4.87131
C      1.79207   -4.01406    2.52780
C      1.41823   -3.70956    1.21683
C      0.22723   -4.39297    0.59032
F      0.45586   -5.67914    0.23386
F     -0.84396   -4.40881    1.43493
F     -0.22038   -3.74272   -0.51999
C      2.16916   -2.75870    0.49929
N      4.67774    0.91581   -0.64964
C      3.98995    1.82517   -1.57192
C      4.43717    3.29283   -1.54276
C      3.95847    1.39803   -3.04027
C      9.35681   -0.06421   -0.15563
O     10.19279   -1.05047    0.42166
C      7.43570   -5.22583   -7.89088
C      6.77752   -3.91669   -8.36706
O      7.72786   -2.86142   -8.40719
C      7.93435   -2.25242   -7.21042
O      9.01543   -2.04942   -6.72126
C      6.68452   -1.70860   -6.61192
C      7.08475   -1.13259   -5.24694
O      5.65878   -2.69177   -6.53143
C      5.50511   -3.52543   -7.60577
O      4.41540   -4.02771   -7.85468
H      4.49147   -1.93138    2.82144
H      1.22067   -4.75851    3.08935
H      1.92461   -2.55111   -0.54210
H      5.66587    0.77873   -0.79112
H      2.96855    1.76412   -1.26320
H      5.40860    3.45324   -2.01181
H      3.71197    3.90324   -2.11041
H      4.49493    3.71479   -0.53708
H      3.62021    0.36872   -3.17243
H      3.24621    2.03815   -3.58813
H      4.92911    1.52596   -3.52727
H      8.42166    0.06015    0.38711
H      9.14289   -0.33396   -1.19483
H      9.92851    0.85689   -0.10007
H     11.42038   -0.81136    0.23438
H      6.79242   -6.10022   -8.02186
H      7.72632   -5.17523   -6.83850
H      8.34950   -5.45223   -8.44963
H      6.47751   -4.08937   -9.40601
H      6.34426   -0.88796   -7.25137
H      7.89090   -0.39105   -5.36734
H      6.25399   -0.63963   -4.74331
H      7.47456   -1.91234   -4.57971

Command: crest input.toml

The last xyz in the crestopt.log:

  57
 Etot=        -110.6193523590
 Na        -1.6906168737        1.7838644896        2.8806137825
 S         -1.6973548207        3.2135343137        0.6079962614
 C         -0.2293290633        2.5333946475        0.0080788785
 N          0.3596640074        1.4935265235        0.5496486300
 C         -0.2180386278        0.4583398062        1.1551976241
 C          0.4232845079       -0.1564953028        2.2532934807
 C         -0.1109391205       -1.2841730523        2.8431515213
 C          0.5616020944       -1.8281333762        4.0678792737
 F          1.8996867865       -1.7586415441        4.0239764852
 F          0.1967414968       -1.1117688871        5.1640768191
 F          0.2524861470       -3.1006884964        4.3438000565
 C         -1.2974169894       -1.8605045004        2.4010545418
 C         -1.9330057455       -1.2586321962        1.3197527555
 C         -3.2565204694       -1.7809184080        0.8484976967
 F         -3.5053462684       -3.0467602845        1.2100034207
 F         -4.2722914022       -1.0427112691        1.3622939346
 F         -3.4065058832       -1.7289546809       -0.4847896373
 C         -1.4288559005       -0.1285261351        0.7104056239
 N          0.4011063708        3.1398253765       -0.9983752561
 C          0.1157888960        4.4456192928       -1.5536531648
 C          1.3287112547        5.3528815821       -1.3548097347
 C         -0.2349668736        4.3103846998       -3.0355470720
 C          3.8100077275        0.8186036994        0.4162536252
 O          3.8275296528       -0.4026221092       -0.2995448824
 C          3.5608110865       -1.7706178952       -4.9531454639
 C          2.6841701024       -0.5752907585       -5.3372405948
 O          2.9435027056        0.5455643365       -4.4892024846
 C          2.1755279300        0.8221903130       -3.4486438932
 O          2.4467244740        1.7527922882       -2.7320294724
 C          0.9369796007       -0.0333036465       -3.2220087594
 C          1.1910099832       -1.1431105942       -2.1971161586
 O          0.4062723332       -0.5748840569       -4.4357501730
 C          1.2085481904       -0.9538564563       -5.4223569665
 O          0.7692204451       -1.5473340533       -6.3730941570
 H          1.3664093825        0.2478045310        2.5918239897
 H         -1.7046738584       -2.7409156303        2.8715277050
 H         -1.9305061670        0.2931057849       -0.1505824028
 H          1.2444812436        2.6901571171       -1.3423950801
 H         -0.7456552556        4.8474161219       -1.0091362544
 H          2.1910599925        4.9375342260       -1.8724899738
 H          1.1232160492        6.3433386442       -1.7515259575
 H          1.5643765480        5.4427467018       -0.2963907830
 H         -1.0986994999        3.6608976657       -3.1646610197
 H         -0.4709252792        5.2853250491       -3.4531574369
 H          0.6080117167        3.8902992075       -3.5806008065
 H          2.7660082116        1.1233912080        0.4878549446
 H          4.3714843839        1.5938002039       -0.1138818711
 H          4.2245784358        0.6909881735        1.4211362064
 H          4.7429741801       -0.6988655749       -0.3725261744
 H          3.3244365191       -2.6064328839       -5.6061705666
 H          3.4012545244       -2.0624045845       -3.9185716901
 H          4.6064823393       -1.5019171005       -5.0778223400
 H          2.9776211009       -0.2374659742       -6.3400545459
 H          0.1488818376        0.6290714148       -2.8446093399
 H          1.7692338844       -0.7556738736       -1.3625589520
 H          0.2412084701       -1.5253157040       -1.8334202622
 H          1.7361545102       -1.9669160359       -2.6501128266

The structure in crestopt.xyz:

    57
 Etot= -110.6193539425 g norm=  0.00063076
 Na        -1.6937347781        1.7865173288        2.8739304684
 S         -1.7022203001        3.2137334025        0.5996038920
 C         -0.2300166225        2.5367139425        0.0070323384
 N          0.3593409586        1.4981326060        0.5508095360
 C         -0.2169211194        0.4599939309        1.1521752158
 C          0.4248729527       -0.1555360554        2.2495881745
 C         -0.1074411660       -1.2853654276        2.8368203592
 C          0.5633832851       -1.8290056256        4.0624736499
 F          1.9012918115       -1.7575066923        4.0221434299
 F          0.1941968002       -1.1140962935        5.1582672279
 F          0.2555301721       -3.1024377376        4.3370978656
 C         -1.2923040078       -1.8633730102        2.3925120217
 C         -1.9280520346       -1.2611396596        1.3116411347
 C         -3.2513842398       -1.7835958313        0.8403575619
 F         -3.4987587285       -3.0507528735        1.1985859431
 F         -4.2669209195       -1.0480706076        1.3584092208
 F         -3.4037594821       -1.7276407791       -0.4920212466
 C         -1.4258026844       -0.1288744436        0.7047105189
 N          0.4055831419        3.1452975292       -0.9946497675
 C          0.1179775872        4.4472143767       -1.5572138173
 C          1.3316130739        5.3545301581       -1.3661162061
 C         -0.2366099130        4.3022452598       -3.0368908709
 C          3.8186120647        0.8281546717        0.4249902560
 O          3.8234445969       -0.3983614695       -0.2820315560
 C          3.5516934240       -1.7617680432       -4.9669876465
 C          2.6691425781       -0.5663519154       -5.3365262695
 O          2.9322395863        0.5499703618       -4.4836478078
 C          2.1731555276        0.8176838298       -3.4343900426
 O          2.4484564977        1.7441739808       -2.7141232981
 C          0.9373146086       -0.0412155155       -3.2035382820
 C          1.1973962072       -1.1561849513       -2.1860233960
 O          0.3990084831       -0.5768430033       -4.4163346263
 C          1.1940642427       -0.9488830252       -5.4114047018
 O          0.7483039144       -1.5390830840       -6.3611069299
 H          1.3666661757        0.2507186342        2.5893314890
 H         -1.6981057320       -2.7452482362        2.8615222756
 H         -1.9274759868        0.2935149469       -0.1558658890
 H          1.2497956517        2.6950682400       -1.3358320802
 H         -0.7421413702        4.8523861887       -1.0133489472
 H          2.1925512481        4.9352449095       -1.8824341596
 H          1.1268665916        6.3431545933       -1.7676269319
 H          1.5688768888        5.4494226755       -0.3087118163
 H         -1.1010001994        3.6527146472       -3.1586673659
 H         -0.4728670420        5.2740916915       -3.4610924692
 H          0.6043697071        3.8769928368       -3.5808903809
 H          2.7781257321        1.1446529823        0.4922713923
 H          4.3896116545        1.5929917891       -0.1095898999
 H          4.2299667163        0.7031386085        1.4314174681
 H          4.7348648561       -0.7074019296       -0.3487443513
 H          3.3144558315       -2.5926919679       -5.6258399727
 H          3.3982007230       -2.0629060421       -3.9341212188
 H          4.5958501715       -1.4887265926       -5.0948739047
 H          2.9538920904       -0.2212761947       -6.3394411918
 H          0.1514198337        0.6186752380       -2.8172250258
 H          1.7716418762       -0.7702930037       -1.3480654434
 H          0.2491901182       -1.5462873057       -1.8265435530
 H          1.7481499704       -1.9736496899       -2.6434292698

Which of these structures corresponds to the gradient in crest.engrad? Does crest.log omit the final structure? My calculation converges in 206 cycles and there are 206 structures in crestopt.log, so I do not understand how the crestopt.xyz is not one of them.

Thanks for your help!

pprcht commented 3 weeks ago

The convergence was determined for the last structure that is written in crestopt.log and technically there is one more displacement and transformation from internal to Cartesian coordinates before writing to crestopt.xyz. Either should be fine and converged, but the printouts correspond to the last in the log file.

coltonbh commented 3 weeks ago

Got it. So to confirm, the crest.engrad corresponds to the last structure in the crestopt.log file and the crestopt.xyz structure results from taking that final gradient and applying a step to the last structure in crestopt.log, correct? There are no energy/gradient calculations on the final structure in crestopt.xyz, correct?

pprcht commented 3 weeks ago

yes