| Property | Value |
|---|---|
| Difficulty | Advanced |
| Time | 30-45 minutes |
| Prerequisites | Understanding of NEB, ASE, catalysis |
| Goal | Find transition states using CatTsunami tools |
FAIR chemistry models can be used to enumerate and study reaction pathways via transition state search tools built into ASE or in packages like Sella via the ASE interface.
Since the NEB calculations here can be a bit time consuming, we’ll use a small number of steps during the documentation testing, and otherwise use a reasonable guess.
import os
# Use a small number of steps here to keep the docs fast during CI, but otherwise do quite reasonable settings.
fast_docs = os.environ.get("FAST_DOCS", "false").lower() == "true"
if fast_docs:
optimization_steps = 20
else:
optimization_steps = 300Need to install fairchem-core or get UMA access or getting permissions/401 errors?
Install the necessary packages using pip, uv etc
! pip install fairchem-core fairchem-data-oc fairchem-applications-cattsunamiGet access to any necessary huggingface gated models
Get and login to your Huggingface account
Request access to https://
huggingface .co /facebook /UMA Create a Huggingface token at https://
huggingface .co /settings /tokens/ with the permission “Permissions: Read access to contents of all public gated repos you can access” Add the token as an environment variable using
huggingface-cli loginor by setting the HF_TOKEN environment variable.
# Login using the huggingface-cli utility
! huggingface-cli login
# alternatively,
import os
os.environ['HF_TOKEN'] = 'MY_TOKEN'Do enumerations in an AdsorbML style¶
from __future__ import annotations
import matplotlib.pyplot as plt
from ase.io import read
from ase.mep import DyNEB
from ase.optimize import BFGS
from fairchem.applications.cattsunami.core import Reaction
from fairchem.applications.cattsunami.core.autoframe import AutoFrameDissociation
from fairchem.applications.cattsunami.databases import DISSOCIATION_REACTION_DB_PATH
from fairchem.core import FAIRChemCalculator, pretrained_mlip
from fairchem.data.oc.core import Adsorbate, AdsorbateSlabConfig, Bulk, Slab
from fairchem.data.oc.databases.pkls import ADSORBATE_PKL_PATH, BULK_PKL_PATH
from x3dase.x3d import X3D
# Instantiate the reaction class for the reaction of interest
reaction = Reaction(
reaction_str_from_db="*CH -> *C + *H",
reaction_db_path=DISSOCIATION_REACTION_DB_PATH,
adsorbate_db_path=ADSORBATE_PKL_PATH,
)Warp 1.18.0 initialized:
CUDA Toolkit 13.4, Driver 13.1
Devices:
"cpu" : "x86_64"
"cuda:0" : "Tesla T4" (16 GiB, sm_75, mempool enabled)
Kernel cache:
/home/runner/.cache/warp/1.18.0
/home/runner/work/_tool/Python/3.12.16/x64/lib/python3.12/site-packages/fairchem/applications/cattsunami/core/reaction.py:29: UserWarning: Loading data from a pickle file. Pickle files can execute arbitrary code and should only be loaded from trusted sources. Consider migrating to a safer format such as Parquet, CSV, or JSON.
reaction_db = safe_pickle_load(reaction_db_path)
/home/runner/work/_tool/Python/3.12.16/x64/lib/python3.12/site-packages/fairchem/applications/cattsunami/core/reaction.py:30: UserWarning: Loading data from a pickle file. Pickle files can execute arbitrary code and should only be loaded from trusted sources. Consider migrating to a safer format such as Parquet, CSV, or JSON.
adsorbate_db = safe_pickle_load(adsorbate_db_path)
# Instantiate our adsorbate class for the reactant and product
reactant = Adsorbate(
adsorbate_id_from_db=reaction.reactant1_idx, adsorbate_db_path=ADSORBATE_PKL_PATH
)
product1 = Adsorbate(
adsorbate_id_from_db=reaction.product1_idx, adsorbate_db_path=ADSORBATE_PKL_PATH
)
product2 = Adsorbate(
adsorbate_id_from_db=reaction.product2_idx, adsorbate_db_path=ADSORBATE_PKL_PATH
)/home/runner/work/_tool/Python/3.12.16/x64/lib/python3.12/site-packages/fairchem/data/oc/core/adsorbate.py:79: UserWarning: Loading data from a pickle file. Pickle files can execute arbitrary code and should only be loaded from trusted sources. Consider migrating to a safer format such as Parquet, CSV, or JSON.
adsorbate_db = safe_pickle_load(fp)
# Grab the bulk and cut the slab we are interested in
bulk = Bulk(bulk_src_id_from_db="mp-33", bulk_db_path=BULK_PKL_PATH)
slab = Slab.from_bulk_get_specific_millers(bulk=bulk, specific_millers=(0, 0, 1))/home/runner/work/_tool/Python/3.12.16/x64/lib/python3.12/site-packages/fairchem/data/oc/core/bulk.py:66: UserWarning: Loading data from a pickle file. Pickle files can execute arbitrary code and should only be loaded from trusted sources. Consider migrating to a safer format such as Parquet, CSV, or JSON.
bulk_db = safe_pickle_load(fp)
# Perform site enumeration
# For AdsorbML num_sites = 100, but we use 5 here for brevity. This should be increased for practical use.
reactant_configs = AdsorbateSlabConfig(
slab=slab[0],
adsorbate=reactant,
mode="random_site_heuristic_placement",
num_sites=10,
).atoms_list
product1_configs = AdsorbateSlabConfig(
slab=slab[0],
adsorbate=product1,
mode="random_site_heuristic_placement",
num_sites=10,
).atoms_list
product2_configs = AdsorbateSlabConfig(
slab=slab[0],
adsorbate=product2,
mode="random_site_heuristic_placement",
num_sites=10,
).atoms_list# Instantiate the calculator
predictor = pretrained_mlip.get_predict_unit("uma-s-1p2p1")
calc = FAIRChemCalculator(predictor, task_name="oc20")WARNING:root:device was not explicitly set, using device='cuda'.
WARNING:root:UMA Nitro cannot serve this request: nitro mode supports only CUDA compute capability 8.x-12.x, not 7.5.
WARNING:root:Now running with nitro=False, execution_mode='umas_fast_gpu' (TF32).
WARNING:root:Running in a reduced-precision mode: some values, such as higher-order derivatives and phonon calculations, will be less accurate. For standard FP32 precision, use inference_settings='high-precision'.
# Relax the reactant systems
reactant_energies = []
for config in reactant_configs:
config.calc = calc
config.pbc = True
opt = BFGS(config)
opt.run(fmax=0.05, steps=optimization_steps)
reactant_energies.append(config.get_potential_energy())WARNING:root:Model is being compiled. This might take a while the first time.
WARNING:root:Running (unknown commit) with inference settings: multigpu
W1027 22:03:07.124000 9621 site-packages/torch/_logging/_internal.py:1345] [0/0] Profiler record function <class 'torch.autograd.profiler.record_function'> will be ignored
Step Time Energy fmax
BFGS: 0 22:03:53 -300.783641 4.045785
BFGS: 1 22:03:54 -301.228564 3.642121
BFGS: 2 22:03:54 -302.545782 3.700875
BFGS: 3 22:03:54 -302.441071 8.001791
BFGS: 4 22:03:54 -302.897278 2.836538
BFGS: 5 22:03:54 -303.063053 1.208616
BFGS: 6 22:03:55 -303.102670 1.189647
BFGS: 7 22:03:55 -303.114304 0.537226
BFGS: 8 22:03:55 -303.124896 0.558798
BFGS: 9 22:03:55 -303.136378 0.687779
BFGS: 10 22:03:55 -303.149058 0.520371
BFGS: 11 22:03:55 -303.154293 0.253267
BFGS: 12 22:03:55 -303.156733 0.193728
BFGS: 13 22:03:56 -303.159440 0.411259
BFGS: 14 22:03:56 -303.164334 0.601739
BFGS: 15 22:03:56 -303.169629 0.558983
BFGS: 16 22:03:56 -303.173197 0.308555
BFGS: 17 22:03:56 -303.175092 0.148541
BFGS: 18 22:03:56 -303.176931 0.252296
BFGS: 19 22:03:56 -303.179400 0.377637
BFGS: 20 22:03:57 -303.182225 0.350110
Step Time Energy fmax
BFGS: 0 22:03:57 -301.233734 4.168857
BFGS: 1 22:03:57 -301.625008 3.555476
BFGS: 2 22:03:57 -302.650088 3.150366
BFGS: 3 22:03:57 -302.666797 5.153665
BFGS: 4 22:03:57 -302.969432 2.458516
BFGS: 5 22:03:58 -303.118297 1.149227
BFGS: 6 22:03:58 -303.211190 2.069137
BFGS: 7 22:03:58 -303.297879 1.851550
BFGS: 8 22:03:58 -303.562436 1.637243
BFGS: 9 22:03:58 -303.774922 2.147032
BFGS: 10 22:03:58 -303.885511 2.220726
BFGS: 11 22:03:59 -304.059686 1.826489
BFGS: 12 22:03:59 -304.428683 1.062233
BFGS: 13 22:03:59 -304.480783 1.350589
BFGS: 14 22:03:59 -304.508929 0.722927
BFGS: 15 22:04:00 -304.539376 0.478596
BFGS: 16 22:04:00 -304.563278 0.669248
BFGS: 17 22:04:00 -304.586025 0.565168
BFGS: 18 22:04:00 -304.597715 0.348764
BFGS: 19 22:04:00 -304.606817 0.294056
BFGS: 20 22:04:01 -304.615022 0.476902
Step Time Energy fmax
BFGS: 0 22:04:01 -300.733570 4.082093
BFGS: 1 22:04:01 -301.184568 3.670718
BFGS: 2 22:04:01 -302.523296 3.706718
BFGS: 3 22:04:02 -302.426806 7.998502
BFGS: 4 22:04:02 -302.882025 2.847208
BFGS: 5 22:04:02 -303.057711 1.136029
BFGS: 6 22:04:02 -303.098409 1.219796
BFGS: 7 22:04:02 -303.111916 0.583685
BFGS: 8 22:04:02 -303.124502 0.608961
BFGS: 9 22:04:03 -303.137130 0.708082
BFGS: 10 22:04:03 -303.149037 0.468135
BFGS: 11 22:04:03 -303.152888 0.206071
BFGS: 12 22:04:03 -303.154397 0.179445
BFGS: 13 22:04:03 -303.156195 0.357820
BFGS: 14 22:04:04 -303.159743 0.527865
BFGS: 15 22:04:04 -303.163509 0.489810
BFGS: 16 22:04:04 -303.165953 0.256108
BFGS: 17 22:04:04 -303.167025 0.089231
BFGS: 18 22:04:04 -303.167822 0.136762
BFGS: 19 22:04:04 -303.168937 0.230249
BFGS: 20 22:04:05 -303.170093 0.213627
Step Time Energy fmax
BFGS: 0 22:04:05 -301.260129 4.016443
BFGS: 1 22:04:05 -301.651452 3.176650
BFGS: 2 22:04:05 -302.731929 3.416110
BFGS: 3 22:04:05 -302.791258 5.192060
BFGS: 4 22:04:05 -303.093459 2.406171
BFGS: 5 22:04:06 -303.242210 1.532330
BFGS: 6 22:04:06 -303.284721 1.468833
BFGS: 7 22:04:06 -303.528260 2.133986
BFGS: 8 22:04:06 -303.776132 2.384591
BFGS: 9 22:04:06 -303.943863 2.172499
BFGS: 10 22:04:06 -304.036950 1.965086
BFGS: 11 22:04:06 -304.397842 1.083735
BFGS: 12 22:04:07 -304.485014 1.157065
BFGS: 13 22:04:07 -304.530782 0.766051
BFGS: 14 22:04:07 -304.567976 0.640015
BFGS: 15 22:04:07 -304.592403 0.544256
BFGS: 16 22:04:07 -304.608220 0.370159
BFGS: 17 22:04:07 -304.614726 0.314968
BFGS: 18 22:04:07 -304.620842 0.252141
BFGS: 19 22:04:08 -304.627657 0.231942
BFGS: 20 22:04:08 -304.632908 0.263548
Step Time Energy fmax
BFGS: 0 22:04:08 -301.578058 4.196978
BFGS: 1 22:04:08 -301.971894 3.170678
BFGS: 2 22:04:08 -302.938430 3.387573
BFGS: 3 22:04:08 -303.096994 3.228655
BFGS: 4 22:04:08 -303.393753 2.000617
BFGS: 5 22:04:08 -303.560055 3.953803
BFGS: 6 22:04:08 -303.697078 2.126297
BFGS: 7 22:04:08 -303.939612 0.901464
BFGS: 8 22:04:08 -304.027730 2.286669
BFGS: 9 22:04:09 -304.119311 1.155684
BFGS: 10 22:04:09 -304.177924 0.802639
BFGS: 11 22:04:09 -304.410588 2.090135
BFGS: 12 22:04:09 -304.492236 1.825703
BFGS: 13 22:04:09 -304.549443 0.805016
BFGS: 14 22:04:09 -304.577895 0.499727
BFGS: 15 22:04:09 -304.587729 0.529381
BFGS: 16 22:04:09 -304.603297 0.490055
BFGS: 17 22:04:09 -304.609678 0.366966
BFGS: 18 22:04:09 -304.615354 0.246195
BFGS: 19 22:04:09 -304.620244 0.347557
BFGS: 20 22:04:10 -304.629384 0.460896
Step Time Energy fmax
BFGS: 0 22:04:10 -302.127843 4.135995
BFGS: 1 22:04:10 -302.518615 2.973977
BFGS: 2 22:04:10 -303.404710 3.298899
BFGS: 3 22:04:10 -303.567118 2.935841
BFGS: 4 22:04:10 -303.855393 1.910137
BFGS: 5 22:04:10 -303.912415 0.988994
BFGS: 6 22:04:10 -303.969142 0.645943
BFGS: 7 22:04:10 -304.069687 0.857192
BFGS: 8 22:04:10 -304.099896 0.672755
BFGS: 9 22:04:10 -304.153428 0.756740
BFGS: 10 22:04:10 -304.194974 0.616884
BFGS: 11 22:04:10 -304.220107 0.550428
BFGS: 12 22:04:10 -304.234935 0.638513
BFGS: 13 22:04:10 -304.267913 0.830862
BFGS: 14 22:04:10 -304.314938 1.033810
BFGS: 15 22:04:10 -304.329602 1.091096
BFGS: 16 22:04:10 -304.390362 0.837758
BFGS: 17 22:04:10 -304.431844 0.804501
BFGS: 18 22:04:11 -304.492206 0.682845
BFGS: 19 22:04:11 -304.516140 0.629853
BFGS: 20 22:04:11 -304.552653 0.398343
Step Time Energy fmax
BFGS: 0 22:04:11 -301.805124 4.198811
BFGS: 1 22:04:11 -302.190912 3.353506
BFGS: 2 22:04:11 -303.121665 3.207168
BFGS: 3 22:04:11 -303.275732 3.062547
BFGS: 4 22:04:11 -303.552490 1.953736
BFGS: 5 22:04:11 -303.749267 3.319035
BFGS: 6 22:04:11 -303.862601 1.634117
BFGS: 7 22:04:11 -303.981309 0.586064
BFGS: 8 22:04:11 -304.015472 0.764895
BFGS: 9 22:04:11 -304.043201 0.662666
BFGS: 10 22:04:11 -304.088052 0.677083
BFGS: 11 22:04:11 -304.112204 0.450187
BFGS: 12 22:04:11 -304.124753 0.276902
BFGS: 13 22:04:11 -304.129928 0.248116
BFGS: 14 22:04:11 -304.138588 0.382553
BFGS: 15 22:04:11 -304.147468 0.443049
BFGS: 16 22:04:11 -304.154117 0.334849
BFGS: 17 22:04:11 -304.158786 0.213853
BFGS: 18 22:04:11 -304.164556 0.275067
BFGS: 19 22:04:11 -304.173377 0.419456
BFGS: 20 22:04:11 -304.185859 0.371508
Step Time Energy fmax
BFGS: 0 22:04:11 -300.605559 4.033051
BFGS: 1 22:04:12 -301.085317 4.017857
BFGS: 2 22:04:12 -302.518934 3.708405
BFGS: 3 22:04:12 -302.041119 11.724677
BFGS: 4 22:04:12 -302.805225 3.240000
BFGS: 5 22:04:12 -302.953848 2.552996
BFGS: 6 22:04:12 -303.078379 2.272896
BFGS: 7 22:04:12 -303.123445 0.533741
BFGS: 8 22:04:12 -303.128510 0.257156
BFGS: 9 22:04:12 -303.133307 0.264250
BFGS: 10 22:04:12 -303.139459 0.335504
BFGS: 11 22:04:12 -303.146530 0.331153
BFGS: 12 22:04:12 -303.149562 0.225547
BFGS: 13 22:04:12 -303.151143 0.133062
BFGS: 14 22:04:12 -303.153652 0.201948
BFGS: 15 22:04:12 -303.156972 0.288437
BFGS: 16 22:04:12 -303.160458 0.270018
BFGS: 17 22:04:12 -303.162420 0.143335
BFGS: 18 22:04:12 -303.163047 0.065492
BFGS: 19 22:04:12 -303.163339 0.065854
BFGS: 20 22:04:12 -303.163765 0.078659
Step Time Energy fmax
BFGS: 0 22:04:12 -301.399093 4.085931
BFGS: 1 22:04:13 -301.793040 3.165132
BFGS: 2 22:04:13 -302.843364 3.429413
BFGS: 3 22:04:13 -302.961977 4.520428
BFGS: 4 22:04:13 -303.260389 2.370804
BFGS: 5 22:04:13 -303.462648 3.131317
BFGS: 6 22:04:13 -303.560304 2.083547
BFGS: 7 22:04:13 -303.885282 1.372149
BFGS: 8 22:04:13 -303.921416 2.288050
BFGS: 9 22:04:13 -304.010984 1.203671
BFGS: 10 22:04:13 -304.076407 0.628268
BFGS: 11 22:04:13 -304.125267 1.279032
BFGS: 12 22:04:13 -304.166964 1.342076
BFGS: 13 22:04:13 -304.217311 1.045986
BFGS: 14 22:04:13 -304.266623 0.780819
BFGS: 15 22:04:13 -304.296749 0.905986
BFGS: 16 22:04:13 -304.339684 1.242903
BFGS: 17 22:04:13 -304.381533 1.656410
BFGS: 18 22:04:14 -304.437665 0.985534
BFGS: 19 22:04:14 -304.475343 0.654413
BFGS: 20 22:04:14 -304.521774 0.560444
Step Time Energy fmax
BFGS: 0 22:04:14 -301.176072 4.122940
BFGS: 1 22:04:14 -301.582041 3.286331
BFGS: 2 22:04:14 -302.669837 3.418277
BFGS: 3 22:04:14 -302.728098 5.077944
BFGS: 4 22:04:14 -303.026381 2.415684
BFGS: 5 22:04:14 -303.169136 1.590297
BFGS: 6 22:04:14 -303.201732 1.137589
BFGS: 7 22:04:14 -303.319102 1.678970
BFGS: 8 22:04:14 -303.417391 1.730180
BFGS: 9 22:04:14 -303.554590 1.821077
BFGS: 10 22:04:14 -303.668165 1.626477
BFGS: 11 22:04:14 -303.859893 1.966297
BFGS: 12 22:04:14 -304.044014 1.390178
BFGS: 13 22:04:14 -304.138475 0.741563
BFGS: 14 22:04:14 -304.161603 0.515745
BFGS: 15 22:04:14 -304.198396 0.703538
BFGS: 16 22:04:14 -304.220230 0.663269
BFGS: 17 22:04:14 -304.232460 0.453174
BFGS: 18 22:04:14 -304.242151 0.348552
BFGS: 19 22:04:14 -304.253639 0.441073
BFGS: 20 22:04:14 -304.268587 0.566508
# Relax the product systems
product1_energies = []
for config in product1_configs:
config.calc = calc
config.pbc = True
opt = BFGS(config)
opt.run(fmax=0.05, steps=optimization_steps)
product1_energies.append(config.get_potential_energy())WARNING:root:The UMA fast path (merge_mole + compile) is only available for fixed composition, task, charge, and spin. This is optimized for MD applications. Falling back to a less optimized version for subsequent evaluations. Reason: 'Compositions differ from merged model'.
Use inference_settings='batch' for heterogeneous batched evaluations.
WARNING:root:Now running with merge_mole=False, compile=False, execution_mode='general' (TF32).
Step Time Energy fmax
BFGS: 0 22:04:19 -296.005288 4.360971
BFGS: 1 22:04:19 -296.540449 4.661485
BFGS: 2 22:04:19 -298.200531 2.913629
BFGS: 3 22:04:19 -296.626288 18.044142
BFGS: 4 22:04:20 -298.364195 1.801396
BFGS: 5 22:04:20 -298.423723 1.014942
BFGS: 6 22:04:20 -298.459818 0.528701
BFGS: 7 22:04:20 -298.464288 0.296097
BFGS: 8 22:04:21 -298.471980 0.118644
BFGS: 9 22:04:21 -298.473327 0.119444
BFGS: 10 22:04:21 -298.473599 0.084509
BFGS: 11 22:04:21 -298.473808 0.072009
BFGS: 12 22:04:22 -298.474477 0.132579
BFGS: 13 22:04:22 -298.476191 0.244824
BFGS: 14 22:04:22 -298.487120 0.572365
BFGS: 15 22:04:22 -298.562740 0.846684
BFGS: 16 22:04:22 -298.735845 1.172038
BFGS: 17 22:04:23 -299.029474 1.733788
BFGS: 18 22:04:23 -299.408992 1.946469
BFGS: 19 22:04:23 -299.681724 1.165121
BFGS: 20 22:04:23 -299.725434 1.160731
Step Time Energy fmax
BFGS: 0 22:04:23 -296.027672 4.363437
BFGS: 1 22:04:24 -296.557596 4.655517
BFGS: 2 22:04:24 -298.198357 2.946748
BFGS: 3 22:04:24 -296.725693 17.334658
BFGS: 4 22:04:24 -298.367215 1.812816
BFGS: 5 22:04:24 -298.427503 1.017585
BFGS: 6 22:04:25 -298.463638 0.557720
BFGS: 7 22:04:25 -298.468420 0.330760
BFGS: 8 22:04:25 -298.477251 0.160199
BFGS: 9 22:04:25 -298.478701 0.160568
BFGS: 10 22:04:25 -298.479210 0.130826
BFGS: 11 22:04:26 -298.479970 0.119347
BFGS: 12 22:04:26 -298.482383 0.220446
BFGS: 13 22:04:26 -298.494367 0.521477
BFGS: 14 22:04:26 -298.521579 0.746900
BFGS: 15 22:04:26 -298.545927 1.476657
BFGS: 16 22:04:27 -298.583384 2.426488
BFGS: 17 22:04:27 -298.688092 3.316019
BFGS: 18 22:04:27 -298.783270 3.649900
BFGS: 19 22:04:27 -298.847969 4.166211
BFGS: 20 22:04:27 -298.977937 3.802852
Step Time Energy fmax
BFGS: 0 22:04:28 -296.833876 4.468493
BFGS: 1 22:04:28 -297.299135 4.616457
BFGS: 2 22:04:28 -298.635040 3.273922
BFGS: 3 22:04:28 -298.685229 6.323767
BFGS: 4 22:04:28 -299.027280 1.803196
BFGS: 5 22:04:29 -299.148796 1.740855
BFGS: 6 22:04:29 -299.511761 1.676523
BFGS: 7 22:04:29 -299.681299 1.025976
BFGS: 8 22:04:29 -299.725215 0.910925
BFGS: 9 22:04:29 -299.842211 0.903358
BFGS: 10 22:04:30 -299.862377 0.724591
BFGS: 11 22:04:30 -299.891674 0.458988
BFGS: 12 22:04:30 -299.900501 0.498075
BFGS: 13 22:04:30 -299.918931 0.459511
BFGS: 14 22:04:30 -299.929411 0.381514
BFGS: 15 22:04:31 -299.939067 0.444729
BFGS: 16 22:04:31 -299.948206 0.570080
BFGS: 17 22:04:31 -299.972470 0.774161
BFGS: 18 22:04:31 -299.997826 0.661574
BFGS: 19 22:04:32 -300.014156 0.389719
BFGS: 20 22:04:32 -300.031797 0.311238
Step Time Energy fmax
BFGS: 0 22:04:32 -297.136438 4.648320
BFGS: 1 22:04:32 -297.590677 4.769518
BFGS: 2 22:04:32 -298.832817 4.012607
BFGS: 3 22:04:33 -299.308817 3.812933
BFGS: 4 22:04:33 -299.496579 2.108424
BFGS: 5 22:04:33 -299.988620 2.281019
BFGS: 6 22:04:33 -300.228367 1.433139
BFGS: 7 22:04:33 -300.289285 1.357515
BFGS: 8 22:04:33 -300.500290 1.702916
BFGS: 9 22:04:33 -300.536414 0.619874
BFGS: 10 22:04:34 -300.550691 0.588280
BFGS: 11 22:04:34 -300.589430 0.259147
BFGS: 12 22:04:34 -300.595815 0.183316
BFGS: 13 22:04:34 -300.598338 0.141586
BFGS: 14 22:04:34 -300.599756 0.114694
BFGS: 15 22:04:34 -300.601108 0.108124
BFGS: 16 22:04:34 -300.602146 0.103066
BFGS: 17 22:04:35 -300.602895 0.082755
BFGS: 18 22:04:35 -300.603314 0.052529
BFGS: 19 22:04:35 -300.603537 0.035322
Step Time Energy fmax
BFGS: 0 22:04:35 -297.116953 4.606898
BFGS: 1 22:04:35 -297.588489 4.716777
BFGS: 2 22:04:35 -298.860528 3.800174
BFGS: 3 22:04:36 -299.243098 4.178768
BFGS: 4 22:04:36 -299.422271 1.704895
BFGS: 5 22:04:36 -299.587849 1.611601
BFGS: 6 22:04:36 -299.785868 1.785980
BFGS: 7 22:04:37 -299.836443 0.994395
BFGS: 8 22:04:37 -299.890786 1.131096
BFGS: 9 22:04:37 -300.137690 1.607836
BFGS: 10 22:04:37 -300.229922 2.364312
BFGS: 11 22:04:38 -300.321695 1.749896
BFGS: 12 22:04:38 -300.429796 1.370770
BFGS: 13 22:04:38 -300.472727 1.195083
BFGS: 14 22:04:38 -300.500050 0.879983
BFGS: 15 22:04:38 -300.532342 0.480333
BFGS: 16 22:04:39 -300.558149 0.453701
BFGS: 17 22:04:39 -300.574253 0.279549
BFGS: 18 22:04:39 -300.580012 0.236841
BFGS: 19 22:04:39 -300.588604 0.162100
BFGS: 20 22:04:39 -300.594467 0.156289
Step Time Energy fmax
BFGS: 0 22:04:39 -296.747062 4.505166
BFGS: 1 22:04:40 -297.214020 4.662987
BFGS: 2 22:04:40 -298.517566 3.709344
BFGS: 3 22:04:40 -298.725529 5.614422
BFGS: 4 22:04:40 -298.982905 1.990579
BFGS: 5 22:04:40 -299.106071 1.895745
BFGS: 6 22:04:40 -299.556521 1.707328
BFGS: 7 22:04:40 -299.713847 1.608107
BFGS: 8 22:04:40 -299.778881 1.024405
BFGS: 9 22:04:41 -299.846408 0.839566
BFGS: 10 22:04:41 -299.963238 1.146136
BFGS: 11 22:04:41 -300.019954 1.198992
BFGS: 12 22:04:41 -300.147057 1.461546
BFGS: 13 22:04:42 -300.237463 1.488947
BFGS: 14 22:04:42 -300.330244 1.517088
BFGS: 15 22:04:42 -300.420402 1.231122
BFGS: 16 22:04:42 -300.500805 0.582465
BFGS: 17 22:04:43 -300.523784 0.638144
BFGS: 18 22:04:43 -300.538158 0.568331
BFGS: 19 22:04:43 -300.555730 0.493436
BFGS: 20 22:04:43 -300.572427 0.334921
Step Time Energy fmax
BFGS: 0 22:04:43 -296.842680 4.536849
BFGS: 1 22:04:43 -297.309175 4.682156
BFGS: 2 22:04:44 -298.523592 3.880661
BFGS: 3 22:04:44 -298.928521 3.773602
BFGS: 4 22:04:44 -299.110246 1.925473
BFGS: 5 22:04:44 -299.288437 2.010717
BFGS: 6 22:04:44 -299.674380 1.109833
BFGS: 7 22:04:45 -299.786960 1.286632
BFGS: 8 22:04:45 -299.870095 0.997675
BFGS: 9 22:04:45 -299.912561 0.851839
BFGS: 10 22:04:45 -300.111124 1.399513
BFGS: 11 22:04:45 -300.205217 1.925637
BFGS: 12 22:04:45 -300.275854 1.684564
BFGS: 13 22:04:45 -300.382428 1.241263
BFGS: 14 22:04:45 -300.460570 0.680950
BFGS: 15 22:04:46 -300.492626 0.675145
BFGS: 16 22:04:46 -300.534364 0.497260
BFGS: 17 22:04:46 -300.555849 0.342221
BFGS: 18 22:04:46 -300.568674 0.375655
BFGS: 19 22:04:46 -300.578492 0.298951
BFGS: 20 22:04:46 -300.588513 0.262055
Step Time Energy fmax
BFGS: 0 22:04:46 -296.188100 4.371253
BFGS: 1 22:04:46 -296.686352 4.620859
BFGS: 2 22:04:46 -298.208960 3.161797
BFGS: 3 22:04:46 -297.321191 13.119565
BFGS: 4 22:04:47 -298.418439 1.882042
BFGS: 5 22:04:47 -298.484288 1.075135
BFGS: 6 22:04:47 -298.527645 0.895688
BFGS: 7 22:04:47 -298.540177 0.776743
BFGS: 8 22:04:47 -298.601784 0.878085
BFGS: 9 22:04:47 -298.619114 0.934652
BFGS: 10 22:04:47 -298.923128 1.526391
BFGS: 11 22:04:47 -299.330492 2.092447
BFGS: 12 22:04:47 -299.744621 1.377632
BFGS: 13 22:04:48 -299.726264 2.937788
BFGS: 14 22:04:48 -299.840253 0.941896
BFGS: 15 22:04:48 -299.867408 0.655259
BFGS: 16 22:04:48 -299.910525 0.977679
BFGS: 17 22:04:48 -300.002628 1.226422
BFGS: 18 22:04:49 -300.107212 1.563965
BFGS: 19 22:04:49 -300.160041 1.445628
BFGS: 20 22:04:49 -300.258964 1.437837
Step Time Energy fmax
BFGS: 0 22:04:49 -297.191167 4.662600
BFGS: 1 22:04:49 -297.652826 4.771948
BFGS: 2 22:04:49 -298.895232 3.967169
BFGS: 3 22:04:50 -299.374180 3.676131
BFGS: 4 22:04:50 -299.548669 1.969010
BFGS: 5 22:04:50 -299.940360 1.708913
BFGS: 6 22:04:50 -300.062102 1.936785
BFGS: 7 22:04:50 -300.147259 1.496375
BFGS: 8 22:04:50 -300.375569 1.517338
BFGS: 9 22:04:50 -300.497583 1.235754
BFGS: 10 22:04:51 -300.535181 0.741994
BFGS: 11 22:04:51 -300.551863 0.532513
BFGS: 12 22:04:51 -300.580325 0.446778
BFGS: 13 22:04:51 -300.584602 0.402640
BFGS: 14 22:04:51 -300.595414 0.145460
BFGS: 15 22:04:51 -300.597208 0.117704
BFGS: 16 22:04:52 -300.598110 0.112272
BFGS: 17 22:04:52 -300.599507 0.111561
BFGS: 18 22:04:52 -300.601184 0.124904
BFGS: 19 22:04:52 -300.602615 0.094731
BFGS: 20 22:04:53 -300.603242 0.052801
Step Time Energy fmax
BFGS: 0 22:04:53 -296.151282 4.367494
BFGS: 1 22:04:53 -296.656475 4.627136
BFGS: 2 22:04:53 -298.204729 3.106377
BFGS: 3 22:04:53 -297.184958 14.041636
BFGS: 4 22:04:53 -298.402425 1.864736
BFGS: 5 22:04:54 -298.466623 1.052705
BFGS: 6 22:04:54 -298.506622 0.781455
BFGS: 7 22:04:54 -298.515711 0.618489
BFGS: 8 22:04:55 -298.549053 0.548665
BFGS: 9 22:04:55 -298.555971 0.607318
BFGS: 10 22:04:55 -298.618911 1.315468
BFGS: 11 22:04:55 -298.692836 2.161169
BFGS: 12 22:04:55 -298.767649 2.839486
BFGS: 13 22:04:56 -298.838820 2.976716
BFGS: 14 22:04:56 -298.949010 3.041942
BFGS: 15 22:04:56 -299.352859 2.746345
BFGS: 16 22:04:56 -299.662860 1.936923
BFGS: 17 22:04:57 -299.759268 1.214633
BFGS: 18 22:04:57 -299.807193 0.772075
BFGS: 19 22:04:57 -299.858099 0.483845
BFGS: 20 22:04:57 -299.867383 0.462087
product2_energies = []
for config in product2_configs:
config.calc = calc
config.pbc = True
opt = BFGS(config)
opt.run(fmax=0.05, steps=optimization_steps)
product2_energies.append(config.get_potential_energy()) Step Time Energy fmax
BFGS: 0 22:04:57 -295.372539 1.171753
BFGS: 1 22:04:58 -295.441372 1.081665
BFGS: 2 22:04:58 -295.660689 1.049517
BFGS: 3 22:04:58 -295.681544 0.586723
BFGS: 4 22:04:58 -295.694236 0.491736
BFGS: 5 22:04:58 -295.731494 0.590873
BFGS: 6 22:04:58 -295.742223 0.564069
BFGS: 7 22:04:58 -295.775524 0.568378
BFGS: 8 22:04:59 -295.805315 0.589042
BFGS: 9 22:04:59 -295.831640 0.548744
BFGS: 10 22:04:59 -295.848191 0.505375
BFGS: 11 22:05:00 -295.857376 0.417004
BFGS: 12 22:05:00 -295.868956 0.308545
BFGS: 13 22:05:00 -295.880481 0.260912
BFGS: 14 22:05:00 -295.887078 0.271318
BFGS: 15 22:05:00 -295.891054 0.281171
BFGS: 16 22:05:01 -295.896836 0.288346
BFGS: 17 22:05:01 -295.906620 0.313803
BFGS: 18 22:05:01 -295.919667 0.295195
BFGS: 19 22:05:01 -295.929683 0.303962
BFGS: 20 22:05:02 -295.937517 0.273647
Step Time Energy fmax
BFGS: 0 22:05:02 -295.251449 1.353909
BFGS: 1 22:05:02 -295.333697 1.231393
BFGS: 2 22:05:02 -295.544237 1.458974
BFGS: 3 22:05:02 -295.579219 0.586664
BFGS: 4 22:05:03 -295.589843 0.515771
BFGS: 5 22:05:03 -295.622905 0.424955
BFGS: 6 22:05:03 -295.627175 0.408444
BFGS: 7 22:05:03 -295.669828 0.527146
BFGS: 8 22:05:03 -295.676271 0.566884
BFGS: 9 22:05:04 -295.745443 0.788494
BFGS: 10 22:05:04 -295.784821 0.695691
BFGS: 11 22:05:04 -295.811558 0.606568
BFGS: 12 22:05:04 -295.837307 0.518212
BFGS: 13 22:05:05 -295.871677 0.409864
BFGS: 14 22:05:05 -295.884026 0.444501
BFGS: 15 22:05:05 -295.893618 0.465850
BFGS: 16 22:05:05 -295.902142 0.425893
BFGS: 17 22:05:06 -295.911198 0.246989
BFGS: 18 22:05:06 -295.915020 0.127343
BFGS: 19 22:05:06 -295.917231 0.107064
BFGS: 20 22:05:06 -295.918686 0.116498
Step Time Energy fmax
BFGS: 0 22:05:06 -295.196847 1.441193
BFGS: 1 22:05:07 -295.286878 1.306939
BFGS: 2 22:05:07 -295.495443 1.710596
BFGS: 3 22:05:07 -295.542114 0.565479
BFGS: 4 22:05:08 -295.553321 0.560344
BFGS: 5 22:05:08 -295.583967 0.298766
BFGS: 6 22:05:08 -295.587998 0.323346
BFGS: 7 22:05:08 -295.599149 0.341303
BFGS: 8 22:05:09 -295.605872 0.316305
BFGS: 9 22:05:09 -295.612234 0.269202
BFGS: 10 22:05:09 -295.615351 0.341260
BFGS: 11 22:05:09 -295.621613 0.495175
BFGS: 12 22:05:09 -295.650948 0.959212
BFGS: 13 22:05:10 -295.682604 1.330111
BFGS: 14 22:05:10 -295.706148 1.215648
BFGS: 15 22:05:10 -295.723243 0.872204
BFGS: 16 22:05:10 -295.766024 0.838990
BFGS: 17 22:05:11 -295.784618 0.605840
BFGS: 18 22:05:11 -295.807778 0.395022
BFGS: 19 22:05:11 -295.816974 0.301863
BFGS: 20 22:05:12 -295.822026 0.350634
Step Time Energy fmax
BFGS: 0 22:05:12 -295.255169 1.341684
BFGS: 1 22:05:12 -295.336838 1.222943
BFGS: 2 22:05:12 -295.551229 1.463220
BFGS: 3 22:05:13 -295.586508 0.592318
BFGS: 4 22:05:13 -295.597286 0.518917
BFGS: 5 22:05:13 -295.630677 0.429675
BFGS: 6 22:05:13 -295.635204 0.416469
BFGS: 7 22:05:13 -295.679720 0.551179
BFGS: 8 22:05:14 -295.686801 0.589127
BFGS: 9 22:05:14 -295.759991 0.771558
BFGS: 10 22:05:14 -295.763858 1.077810
BFGS: 11 22:05:14 -295.811818 0.452374
BFGS: 12 22:05:15 -295.826849 0.381840
BFGS: 13 22:05:15 -295.845277 0.259882
BFGS: 14 22:05:15 -295.848894 0.281472
BFGS: 15 22:05:15 -295.858060 0.287846
BFGS: 16 22:05:16 -295.863286 0.219055
BFGS: 17 22:05:16 -295.868093 0.230698
BFGS: 18 22:05:16 -295.871245 0.243048
BFGS: 19 22:05:16 -295.875064 0.268691
BFGS: 20 22:05:17 -295.881828 0.381144
Step Time Energy fmax
BFGS: 0 22:05:17 -295.597030 0.739026
BFGS: 1 22:05:17 -295.649113 0.698141
BFGS: 2 22:05:18 -295.834763 0.417870
BFGS: 3 22:05:18 -295.844889 0.451264
BFGS: 4 22:05:18 -295.852817 0.454282
BFGS: 5 22:05:18 -295.880500 0.403072
BFGS: 6 22:05:19 -295.891537 0.342945
BFGS: 7 22:05:19 -295.900364 0.367858
BFGS: 8 22:05:19 -295.906731 0.264721
BFGS: 9 22:05:20 -295.911877 0.172663
BFGS: 10 22:05:20 -295.914708 0.184242
BFGS: 11 22:05:20 -295.916247 0.171137
BFGS: 12 22:05:20 -295.917572 0.143868
BFGS: 13 22:05:20 -295.919163 0.101989
BFGS: 14 22:05:21 -295.920427 0.079196
BFGS: 15 22:05:21 -295.921114 0.084693
BFGS: 16 22:05:21 -295.921573 0.075386
BFGS: 17 22:05:21 -295.922155 0.054995
BFGS: 18 22:05:22 -295.922769 0.036301
Step Time Energy fmax
BFGS: 0 22:05:22 -295.607273 0.760471
BFGS: 1 22:05:22 -295.656172 0.672124
BFGS: 2 22:05:22 -295.820462 0.237103
BFGS: 3 22:05:22 -295.828129 0.257781
BFGS: 4 22:05:23 -295.829788 0.249256
BFGS: 5 22:05:23 -295.840724 0.141588
BFGS: 6 22:05:23 -295.841490 0.131282
BFGS: 7 22:05:23 -295.845009 0.165316
BFGS: 8 22:05:23 -295.846694 0.213556
BFGS: 9 22:05:23 -295.849059 0.263806
BFGS: 10 22:05:23 -295.852522 0.304002
BFGS: 11 22:05:24 -295.858859 0.332829
BFGS: 12 22:05:24 -295.865090 0.318533
BFGS: 13 22:05:24 -295.875877 0.371377
BFGS: 14 22:05:24 -295.888801 0.417914
BFGS: 15 22:05:24 -295.897340 0.448448
BFGS: 16 22:05:25 -295.910540 0.294864
BFGS: 17 22:05:25 -295.917770 0.130114
BFGS: 18 22:05:25 -295.919755 0.111019
BFGS: 19 22:05:25 -295.920447 0.123872
BFGS: 20 22:05:26 -295.921412 0.104120
Step Time Energy fmax
BFGS: 0 22:05:26 -295.318427 1.252063
BFGS: 1 22:05:26 -295.392924 1.145259
BFGS: 2 22:05:26 -295.606365 1.210561
BFGS: 3 22:05:26 -295.631617 0.605872
BFGS: 4 22:05:27 -295.643354 0.453805
BFGS: 5 22:05:27 -295.679807 0.545871
BFGS: 6 22:05:27 -295.686772 0.516272
BFGS: 7 22:05:28 -295.746081 0.566839
BFGS: 8 22:05:28 -295.772690 0.741687
BFGS: 9 22:05:28 -295.796060 0.766658
BFGS: 10 22:05:29 -295.818022 0.633612
BFGS: 11 22:05:29 -295.843721 0.416076
BFGS: 12 22:05:29 -295.867152 0.266373
BFGS: 13 22:05:29 -295.878717 0.384212
BFGS: 14 22:05:29 -295.883378 0.360459
BFGS: 15 22:05:29 -295.888638 0.287588
BFGS: 16 22:05:30 -295.897000 0.222451
BFGS: 17 22:05:30 -295.905368 0.209428
BFGS: 18 22:05:30 -295.909246 0.171369
BFGS: 19 22:05:30 -295.911627 0.141691
BFGS: 20 22:05:30 -295.913660 0.129837
Step Time Energy fmax
BFGS: 0 22:05:31 -295.614207 0.711987
BFGS: 1 22:05:31 -295.664634 0.637443
BFGS: 2 22:05:31 -295.848012 0.371780
BFGS: 3 22:05:32 -295.856762 0.401872
BFGS: 4 22:05:32 -295.861528 0.394793
BFGS: 5 22:05:32 -295.885825 0.296960
BFGS: 6 22:05:32 -295.892374 0.254894
BFGS: 7 22:05:32 -295.897240 0.254464
BFGS: 8 22:05:32 -295.901881 0.290494
BFGS: 9 22:05:33 -295.909086 0.370648
BFGS: 10 22:05:33 -295.917665 0.445146
BFGS: 11 22:05:33 -295.925968 0.441978
BFGS: 12 22:05:33 -295.933919 0.346125
BFGS: 13 22:05:34 -295.943007 0.241549
BFGS: 14 22:05:34 -295.949222 0.207543
BFGS: 15 22:05:34 -295.953168 0.226684
BFGS: 16 22:05:34 -295.955191 0.198806
BFGS: 17 22:05:34 -295.956955 0.129723
BFGS: 18 22:05:35 -295.958260 0.051298
BFGS: 19 22:05:35 -295.958880 0.043244
Step Time Energy fmax
BFGS: 0 22:05:35 -295.332942 1.220099
BFGS: 1 22:05:35 -295.406392 1.117608
BFGS: 2 22:05:35 -295.622807 1.150928
BFGS: 3 22:05:36 -295.646093 0.608191
BFGS: 4 22:05:36 -295.658383 0.455563
BFGS: 5 22:05:36 -295.694679 0.567381
BFGS: 6 22:05:36 -295.702777 0.536049
BFGS: 7 22:05:37 -295.742763 0.435277
BFGS: 8 22:05:37 -295.765475 0.498765
BFGS: 9 22:05:37 -295.786077 0.527841
BFGS: 10 22:05:38 -295.796113 0.435493
BFGS: 11 22:05:38 -295.804345 0.317464
BFGS: 12 22:05:38 -295.815123 0.168782
BFGS: 13 22:05:38 -295.821221 0.192196
BFGS: 14 22:05:39 -295.823138 0.189466
BFGS: 15 22:05:39 -295.824082 0.155332
BFGS: 16 22:05:39 -295.825183 0.099036
BFGS: 17 22:05:40 -295.826461 0.058534
BFGS: 18 22:05:40 -295.827195 0.037724
Step Time Energy fmax
BFGS: 0 22:05:40 -295.668895 0.706483
BFGS: 1 22:05:40 -295.716494 0.626038
BFGS: 2 22:05:41 -295.884063 0.367487
BFGS: 3 22:05:41 -295.891961 0.367985
BFGS: 4 22:05:41 -295.894754 0.353412
BFGS: 5 22:05:42 -295.917867 0.254490
BFGS: 6 22:05:42 -295.922546 0.281613
BFGS: 7 22:05:42 -295.927462 0.306698
BFGS: 8 22:05:43 -295.932466 0.304228
BFGS: 9 22:05:43 -295.940393 0.256043
BFGS: 10 22:05:43 -295.946424 0.184859
BFGS: 11 22:05:44 -295.950656 0.180052
BFGS: 12 22:05:44 -295.952498 0.159373
BFGS: 13 22:05:44 -295.954836 0.115846
BFGS: 14 22:05:45 -295.956892 0.091680
BFGS: 15 22:05:45 -295.958157 0.086064
BFGS: 16 22:05:45 -295.958728 0.066076
BFGS: 17 22:05:45 -295.959085 0.037827
Enumerate NEBs¶

af = AutoFrameDissociation(
reaction=reaction,
reactant_system=reactant_configs[reactant_energies.index(min(reactant_energies))],
product1_systems=product1_configs,
product1_energies=product1_energies,
product2_systems=product2_configs,
product2_energies=product2_energies,
r_product1_max=2, # r1 in the above fig
r_product2_max=3, # r3 in the above fig
r_product2_min=1, # r2 in the above fig
)import random
nframes = 10
random.seed(
42
) # set the seed to make the random generation deterministic for the tutorial!
frame_sets, mapping_idxs = af.get_neb_frames(
calc,
n_frames=nframes,
n_pdt1_sites=4, # = 5 in the above fig (step 1)
n_pdt2_sites=4, # = 5 in the above fig (step 2)
) Step Time Energy fmax
BFGS: 0 22:05:45 -303.407567 1.394955
BFGS: 1 22:05:46 -303.462115 1.181098
BFGS: 2 22:05:46 -303.629327 1.001131
BFGS: 3 22:05:46 -303.654488 0.963961
BFGS: 4 22:05:46 -303.716825 0.734043
BFGS: 5 22:05:46 -303.742571 0.804356
BFGS: 6 22:05:47 -303.796485 1.158578
BFGS: 7 22:05:47 -303.838406 1.058832
BFGS: 8 22:05:47 -303.886882 0.504610
BFGS: 9 22:05:47 -303.909592 0.380588
BFGS: 10 22:05:48 -303.923901 0.336940
BFGS: 11 22:05:48 -303.930346 0.353386
BFGS: 12 22:05:48 -303.935773 0.274588
BFGS: 13 22:05:48 -303.942832 0.110604
BFGS: 14 22:05:49 -303.944312 0.083926
BFGS: 15 22:05:49 -303.945031 0.072276
BFGS: 16 22:05:49 -303.945736 0.070114
BFGS: 17 22:05:50 -303.946231 0.058952
BFGS: 18 22:05:50 -303.946529 0.051114
BFGS: 19 22:05:50 -303.946730 0.045288
Step Time Energy fmax
BFGS: 0 22:05:51 -303.525971 1.318126
BFGS: 1 22:05:51 -303.568601 1.050420
BFGS: 2 22:05:52 -303.664686 0.633349
BFGS: 3 22:05:52 -303.677294 0.539581
BFGS: 4 22:05:52 -303.709861 0.308864
BFGS: 5 22:05:52 -303.714581 0.249228
BFGS: 6 22:05:52 -303.721001 0.274743
BFGS: 7 22:05:53 -303.725072 0.276868
BFGS: 8 22:05:53 -303.729621 0.206849
BFGS: 9 22:05:53 -303.731959 0.185005
BFGS: 10 22:05:53 -303.733884 0.166472
BFGS: 11 22:05:54 -303.736224 0.224777
BFGS: 12 22:05:54 -303.740213 0.302356
BFGS: 13 22:05:54 -303.747372 0.381934
BFGS: 14 22:05:54 -303.761007 0.742166
BFGS: 15 22:05:54 -303.776837 0.933967
BFGS: 16 22:05:55 -303.810896 0.664911
BFGS: 17 22:05:55 -303.839576 0.572988
BFGS: 18 22:05:55 -303.872834 0.527266
BFGS: 19 22:05:55 -303.888989 0.563295
BFGS: 20 22:05:56 -303.905018 0.555315
BFGS: 21 22:05:56 -303.917489 0.363780
BFGS: 22 22:05:56 -303.925424 0.188258
BFGS: 23 22:05:57 -303.931151 0.142748
BFGS: 24 22:05:57 -303.933337 0.127708
BFGS: 25 22:05:57 -303.934778 0.085247
BFGS: 26 22:05:57 -303.935739 0.100975
BFGS: 27 22:05:58 -303.936727 0.124600
BFGS: 28 22:05:58 -303.937608 0.097653
BFGS: 29 22:05:58 -303.938090 0.044131
Step Time Energy fmax
BFGS: 0 22:05:58 -303.591814 1.169060
BFGS: 1 22:05:58 -303.634980 0.921982
BFGS: 2 22:05:59 -303.715926 0.691301
BFGS: 3 22:05:59 -303.726698 0.506286
BFGS: 4 22:05:59 -303.751887 0.412123
BFGS: 5 22:06:00 -303.756891 0.401205
BFGS: 6 22:06:00 -303.768891 0.480959
BFGS: 7 22:06:00 -303.781135 0.607101
BFGS: 8 22:06:00 -303.810010 0.887797
BFGS: 9 22:06:00 -303.830891 0.700467
BFGS: 10 22:06:01 -303.880049 0.479526
BFGS: 11 22:06:01 -303.892082 0.594715
BFGS: 12 22:06:01 -303.913903 0.721946
BFGS: 13 22:06:01 -303.930597 0.545870
BFGS: 14 22:06:02 -303.957085 0.233024
BFGS: 15 22:06:02 -303.961750 0.221116
BFGS: 16 22:06:02 -303.967398 0.165351
BFGS: 17 22:06:02 -303.970517 0.105344
BFGS: 18 22:06:03 -303.972132 0.074997
BFGS: 19 22:06:03 -303.972609 0.060584
BFGS: 20 22:06:03 -303.973014 0.066082
BFGS: 21 22:06:03 -303.973451 0.052107
BFGS: 22 22:06:04 -303.973717 0.033041
Step Time Energy fmax
BFGS: 0 22:06:04 -302.181014 4.059198
BFGS: 1 22:06:04 -302.550969 1.833564
BFGS: 2 22:06:04 -302.726274 1.155580
BFGS: 3 22:06:04 -302.847036 1.040392
BFGS: 4 22:06:05 -302.955939 1.043301
BFGS: 5 22:06:05 -303.077983 1.228810
BFGS: 6 22:06:05 -303.134376 0.972709
BFGS: 7 22:06:05 -303.296982 1.145185
BFGS: 8 22:06:06 -303.332875 0.673535
BFGS: 9 22:06:06 -303.359126 0.462647
BFGS: 10 22:06:06 -303.407011 0.239336
BFGS: 11 22:06:06 -303.410551 0.172537
BFGS: 12 22:06:06 -303.415174 0.145126
BFGS: 13 22:06:06 -303.416986 0.148476
BFGS: 14 22:06:07 -303.418827 0.156494
BFGS: 15 22:06:07 -303.421018 0.171586
BFGS: 16 22:06:07 -303.423895 0.194339
BFGS: 17 22:06:07 -303.427358 0.218699
BFGS: 18 22:06:08 -303.433008 0.253212
BFGS: 19 22:06:08 -303.444465 0.494232
BFGS: 20 22:06:08 -303.465378 0.846816
BFGS: 21 22:06:08 -303.500078 0.998907
BFGS: 22 22:06:08 -303.558035 0.964395
BFGS: 23 22:06:09 -303.639453 0.912612
BFGS: 24 22:06:09 -303.718994 1.200475
BFGS: 25 22:06:09 -303.790214 1.117598
BFGS: 26 22:06:09 -303.838658 0.750500
BFGS: 27 22:06:10 -303.862622 0.573922
BFGS: 28 22:06:10 -303.890478 0.560453
BFGS: 29 22:06:10 -303.906041 0.431518
BFGS: 30 22:06:10 -303.924521 0.214459
BFGS: 31 22:06:11 -303.930392 0.168190
BFGS: 32 22:06:11 -303.935310 0.145445
BFGS: 33 22:06:11 -303.936965 0.136533
BFGS: 34 22:06:11 -303.939743 0.118541
BFGS: 35 22:06:12 -303.942495 0.093063
BFGS: 36 22:06:12 -303.944449 0.068620
BFGS: 37 22:06:12 -303.945267 0.056078
BFGS: 38 22:06:12 -303.945654 0.048204
Step Time Energy fmax
BFGS: 0 22:06:13 -302.635620 3.961175
BFGS: 1 22:06:13 -303.015178 3.016150
BFGS: 2 22:06:13 -303.352392 3.056805
BFGS: 3 22:06:13 -303.468329 1.262667
BFGS: 4 22:06:13 -303.539313 0.686909
BFGS: 5 22:06:14 -303.620382 0.924507
BFGS: 6 22:06:14 -303.646301 0.965098
BFGS: 7 22:06:14 -303.696911 0.883906
BFGS: 8 22:06:14 -303.743482 0.760317
BFGS: 9 22:06:14 -303.780984 0.777425
BFGS: 10 22:06:15 -303.825038 0.968007
BFGS: 11 22:06:15 -303.864949 0.764094
BFGS: 12 22:06:15 -303.897038 0.386992
BFGS: 13 22:06:15 -303.912443 0.325186
BFGS: 14 22:06:16 -303.921059 0.227363
BFGS: 15 22:06:16 -303.925482 0.252908
BFGS: 16 22:06:16 -303.930042 0.218179
BFGS: 17 22:06:17 -303.934138 0.146156
BFGS: 18 22:06:17 -303.936728 0.073158
BFGS: 19 22:06:17 -303.937092 0.068282
BFGS: 20 22:06:17 -303.937726 0.062429
BFGS: 21 22:06:18 -303.938195 0.051071
BFGS: 22 22:06:18 -303.938538 0.051170
BFGS: 23 22:06:18 -303.938701 0.037386
Step Time Energy fmax
BFGS: 0 22:06:18 -302.385725 3.662123
BFGS: 1 22:06:19 -302.702199 2.782637
BFGS: 2 22:06:19 -303.017640 2.770986
BFGS: 3 22:06:19 -303.116722 1.266259
BFGS: 4 22:06:20 -303.201391 0.661470
BFGS: 5 22:06:20 -303.296569 0.946104
BFGS: 6 22:06:20 -303.324613 0.916924
BFGS: 7 22:06:21 -303.366942 0.699788
BFGS: 8 22:06:21 -303.405680 0.648502
BFGS: 9 22:06:21 -303.438455 0.970456
BFGS: 10 22:06:21 -303.514825 1.531049
BFGS: 11 22:06:22 -303.644685 1.971989
BFGS: 12 22:06:22 -303.735994 2.015879
BFGS: 13 22:06:22 -303.756659 1.913194
BFGS: 14 22:06:22 -303.775465 1.879986
BFGS: 15 22:06:22 -303.788641 1.863091
BFGS: 16 22:06:23 -303.799888 1.845822
BFGS: 17 22:06:23 -303.811738 1.790273
BFGS: 18 22:06:23 -303.834752 1.614398
BFGS: 19 22:06:23 -303.864137 1.351372
BFGS: 20 22:06:23 -303.903248 1.062531
BFGS: 21 22:06:23 -303.945431 1.109481
BFGS: 22 22:06:24 -303.995075 1.059575
BFGS: 23 22:06:24 -304.062493 1.035522
BFGS: 24 22:06:24 -304.122029 1.222414
BFGS: 25 22:06:25 -304.163945 1.212529
BFGS: 26 22:06:25 -304.198878 0.852811
BFGS: 27 22:06:25 -304.218098 0.820864
BFGS: 28 22:06:25 -304.240450 0.672987
BFGS: 29 22:06:26 -304.259481 0.565386
BFGS: 30 22:06:26 -304.285601 0.399787
BFGS: 31 22:06:26 -304.297047 0.386779
BFGS: 32 22:06:26 -304.317611 0.415682
BFGS: 33 22:06:27 -304.335970 0.375041
BFGS: 34 22:06:27 -304.358874 0.333872
BFGS: 35 22:06:27 -304.371107 0.308752
BFGS: 36 22:06:27 -304.379275 0.192131
BFGS: 37 22:06:27 -304.383627 0.142707
BFGS: 38 22:06:28 -304.386231 0.084906
BFGS: 39 22:06:28 -304.387998 0.114122
BFGS: 40 22:06:28 -304.388953 0.097150
BFGS: 41 22:06:29 -304.389553 0.066699
BFGS: 42 22:06:29 -304.390190 0.057911
BFGS: 43 22:06:29 -304.390786 0.042225
Step Time Energy fmax
BFGS: 0 22:06:30 -302.330375 3.736922
BFGS: 1 22:06:30 -302.667274 2.865761
BFGS: 2 22:06:30 -303.010352 2.742609
BFGS: 3 22:06:30 -303.164295 0.845211
BFGS: 4 22:06:30 -303.219820 0.686904
BFGS: 5 22:06:30 -303.315411 0.718097
BFGS: 6 22:06:31 -303.340572 0.769309
BFGS: 7 22:06:31 -303.390300 0.844788
BFGS: 8 22:06:31 -303.428307 0.804436
BFGS: 9 22:06:31 -303.482075 0.947580
BFGS: 10 22:06:31 -303.535852 1.264698
BFGS: 11 22:06:32 -303.688298 1.804327
BFGS: 12 22:06:32 -303.919226 1.617877
BFGS: 13 22:06:32 -303.918471 1.608821
BFGS: 14 22:06:32 -304.066430 1.061009
BFGS: 15 22:06:32 -304.130519 0.932438
BFGS: 16 22:06:33 -304.270812 0.749873
BFGS: 17 22:06:33 -304.308349 0.653050
BFGS: 18 22:06:33 -304.342342 0.660443
BFGS: 19 22:06:33 -304.370819 0.507259
BFGS: 20 22:06:34 -304.396258 0.326503
BFGS: 21 22:06:34 -304.409743 0.253226
BFGS: 22 22:06:34 -304.418608 0.296218
BFGS: 23 22:06:35 -304.427426 0.275864
BFGS: 24 22:06:35 -304.433375 0.166443
BFGS: 25 22:06:35 -304.436071 0.121346
BFGS: 26 22:06:36 -304.437613 0.095786
BFGS: 27 22:06:36 -304.439095 0.146141
BFGS: 28 22:06:36 -304.440786 0.155689
BFGS: 29 22:06:36 -304.442361 0.108043
BFGS: 30 22:06:37 -304.443213 0.045928
Step Time Energy fmax
BFGS: 0 22:06:37 -302.817913 3.804472
BFGS: 1 22:06:37 -303.206846 2.831264
BFGS: 2 22:06:38 -303.498073 2.992321
BFGS: 3 22:06:38 -303.618082 0.948921
BFGS: 4 22:06:38 -303.664591 0.597907
BFGS: 5 22:06:39 -303.714398 0.514195
BFGS: 6 22:06:39 -303.726387 0.545665
BFGS: 7 22:06:39 -303.754619 0.551910
BFGS: 8 22:06:40 -303.768292 0.455975
BFGS: 9 22:06:40 -303.782390 0.489523
BFGS: 10 22:06:40 -303.797101 0.638886
BFGS: 11 22:06:40 -303.830211 0.873966
BFGS: 12 22:06:40 -303.851652 0.653965
BFGS: 13 22:06:40 -303.879202 0.461688
BFGS: 14 22:06:41 -303.894237 0.485437
BFGS: 15 22:06:41 -303.920158 0.681135
BFGS: 16 22:06:41 -303.937623 0.657585
BFGS: 17 22:06:41 -303.942050 0.557529
BFGS: 18 22:06:41 -303.962437 0.276521
BFGS: 19 22:06:42 -303.968101 0.193685
BFGS: 20 22:06:42 -303.970185 0.142915
BFGS: 21 22:06:42 -303.971796 0.107375
BFGS: 22 22:06:42 -303.972864 0.069444
BFGS: 23 22:06:42 -303.973308 0.048538
/home/runner/work/_tool/Python/3.12.16/x64/lib/python3.12/site-packages/fairchem/applications/cattsunami/core/autoframe.py:1551: UserWarning: torch.range is deprecated and will be removed in a future release because its behavior is inconsistent with Python's range builtin. Instead, use torch.arange, which produces values in [start, end).
alpha = torch.range(0, num_frames - 1, device=device) / (num_frames - 1)
Run NEBs¶
## This will run all NEBs enumerated - to just run one, run the code cell below.
# On GPU, each NEB takes an average of ~1 minute so this could take around a half hour on GPU
# But much longer on CPU
# Remember that not all NEBs will converge -- the k, nframes would be adjusted to achieve convergence
fmax = 0.05 # [eV / ang**2]
delta_fmax_climb = 0.4
converged_idxs = []
for idx, frame_set in enumerate(frame_sets):
neb = DyNEB(frame_set, k=1)
for image in frame_set:
image.calc = FAIRChemCalculator(predictor, task_name="oc20")
optimizer = BFGS(
neb,
trajectory=f"ch_dissoc_on_Ru_{idx}.traj",
)
conv = optimizer.run(fmax=fmax + delta_fmax_climb, steps=optimization_steps)
if conv:
neb.climb = True
conv = optimizer.run(fmax=fmax, steps=optimization_steps)
if conv:
converged_idxs.append(idx)
print(converged_idxs)This cell will run a shorter calculations for just a single one of the enumerated transition state pathways. You can adapt this code to run transition state searches via nudged elastic band (NEB) calculations for any reaction.
# If you run the above cell -- dont run this one
fmax = 0.05 # [eV / ang**2]
delta_fmax_climb = 0.4
images = frame_sets[0]
neb = DyNEB(images, k=1)
for image in images:
image.calc = FAIRChemCalculator(predictor, task_name="oc20")
optimizer = BFGS(
neb,
trajectory="ch_dissoc_on_Ru_0.traj",
)
conv = optimizer.run(fmax=fmax + delta_fmax_climb, steps=optimization_steps)
if conv:
neb.climb = True
conv = optimizer.run(fmax=fmax, steps=optimization_steps)/home/runner/work/_tool/Python/3.12.16/x64/lib/python3.12/site-packages/ase/mep/neb.py:329: UserWarning: The default method has changed from 'aseneb' to 'improvedtangent'. The 'aseneb' method is an unpublished, custom implementation that is not recommended as it frequently results in very poor bands. Please explicitly set method='improvedtangent' to silence this warning, or set method='aseneb' if you strictly require the old behavior (results may vary). See: https://gitlab.com/ase/ase/-/merge_requests/3952
warnings.warn(
Step Time Energy fmax
BFGS: 0 22:08:01 -301.600470 3.005187
BFGS: 1 22:08:02 -301.822931 2.808227
BFGS: 2 22:08:04 -302.155879 6.844727
BFGS: 3 22:08:04 -302.268511 1.870367
BFGS: 4 22:08:06 -302.451400 1.709004
BFGS: 5 22:08:07 -302.665940 2.154304
BFGS: 6 22:08:11 -302.729344 1.403064
BFGS: 7 22:08:13 -302.963105 1.764835
BFGS: 8 22:08:16 -303.006591 1.641323
BFGS: 9 22:08:17 -302.974759 1.742388
BFGS: 10 22:08:18 -302.972502 1.221507
BFGS: 11 22:08:19 -303.017460 0.983164
BFGS: 12 22:08:23 -303.098704 1.800559
BFGS: 13 22:08:24 -303.134039 1.142236
BFGS: 14 22:08:28 -303.207864 1.179575
BFGS: 15 22:08:30 -303.351005 1.263238
BFGS: 16 22:08:34 -303.483367 1.631712
BFGS: 17 22:08:35 -303.534026 1.685674
BFGS: 18 22:08:39 -303.561350 1.127659
BFGS: 19 22:08:42 -303.599735 1.281494
BFGS: 20 22:08:43 -303.664742 1.346283
Visualize the results¶
Finally, let’s visualize the results!
optimized_neb = read("ch_dissoc_on_Ru_0.traj", ":")[-1 * nframes :]es = []
for frame in optimized_neb:
frame.set_calculator(calc)
es.append(frame.get_potential_energy())/tmp/ipykernel_9621/3247994494.py:3: FutureWarning: Please use atoms.calc = calc
frame.set_calculator(calc)
# Plot the reaction coordinate
es = [e - es[0] for e in es]
plt.plot(es)
plt.xlabel("frame number")
plt.ylabel("relative energy [eV]")
plt.title(f"CH dissociation on Ru(0001), Ea = {max(es):1.2f} eV")
plt.savefig("CH_dissoc_on_Ru_0001.png")
To generalize an interactive visualization, use ase gui from the command line or the X3D package
# Make an interactive html file of the optimized neb trajectory
x3d = X3D(optimized_neb)
x3d.write("optimized_neb_ch_disoc_on_Ru0001.html")