Transition State Search (NEBs)#
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.
The first section of this tutorial walks through how to use the CatTsunami tools to automatically enumerate a number of hypothetical initial/final configurations for various types of reactions on a heterogeneous catalyst surface. If you already have a NEB you’re looking to optimize, you can jump straight to the last section (Run NEBs)!
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 = 300
Need to install fairchem-core or get UMA access or getting permissions/401 errors?
Install the necessary packages using pip, uv etc
Get 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.
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,
)
# 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
)
# 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))
# 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-1p1")
calc = FAIRChemCalculator(predictor, task_name="oc20")
WARNING:root:device was not explicitly set, using device='cuda'.
/home/runner/work/_tool/Python/3.12.12/x64/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:2249: UnsupportedFieldAttributeWarning: The 'repr' attribute with value False was provided to the `Field()` function, which has no effect in the context it was used. 'repr' is field-specific metadata, and can only be attached to a model field using `Annotated` metadata or by assignment. This may have happened because an `Annotated` type alias using the `type` statement was used, or if the `Field()` function was attached to a single member of a union type.
warnings.warn(
/home/runner/work/_tool/Python/3.12.12/x64/lib/python3.12/site-packages/pydantic/_internal/_generate_schema.py:2249: UnsupportedFieldAttributeWarning: The 'frozen' attribute with value True was provided to the `Field()` function, which has no effect in the context it was used. 'frozen' is field-specific metadata, and can only be attached to a model field using `Annotated` metadata or by assignment. This may have happened because an `Annotated` type alias using the `type` statement was used, or if the `Field()` function was attached to a single member of a union type.
warnings.warn(
# 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())
Step Time Energy fmax
BFGS: 0 07:12:43 -301.837190 1834178.000000
BFGS: 1 07:12:43 -301.504481 4.104021
BFGS: 2 07:12:44 -301.882129 3.182945
BFGS: 3 07:12:44 -302.841845 3.321768
BFGS: 4 07:12:44 -302.989037 3.256413
BFGS: 5 07:12:44 -303.242626 2.383632
BFGS: 6 07:12:44 -303.477512 3.723300
BFGS: 7 07:12:44 -303.600664 1.935992
BFGS: 8 07:12:44 -303.797607 1.184826
BFGS: 9 07:12:44 -303.886025 1.177528
BFGS: 10 07:12:44 -303.920421 1.090860
BFGS: 11 07:12:44 -303.976131 1.202205
BFGS: 12 07:12:44 -303.995441 1.265774
BFGS: 13 07:12:45 -304.022330 1.393849
BFGS: 14 07:12:45 -304.026926 1.407854
BFGS: 15 07:12:45 -304.032923 1.412865
BFGS: 16 07:12:45 -304.039302 1.413787
BFGS: 17 07:12:45 -304.045269 1.414099
BFGS: 18 07:12:45 -304.049361 1.415079
BFGS: 19 07:12:45 -304.053671 1.416899
BFGS: 20 07:12:45 -304.059293 1.419422
Step Time Energy fmax
BFGS: 0 07:12:45 -300.955897 696033.750000
BFGS: 1 07:12:45 -300.614334 3.998948
BFGS: 2 07:12:45 -301.003804 3.530920
BFGS: 3 07:12:46 -302.139952 3.287878
BFGS: 4 07:12:46 -301.873695 9.056539
BFGS: 5 07:12:46 -302.440432 2.728243
BFGS: 6 07:12:46 -302.574323 1.951101
BFGS: 7 07:12:46 -302.700201 1.694515
BFGS: 8 07:12:46 -302.732982 1.504444
BFGS: 9 07:12:46 -302.768914 1.531076
BFGS: 10 07:12:46 -302.819358 1.593200
BFGS: 11 07:12:46 -302.841142 1.605841
BFGS: 12 07:12:46 -302.866013 1.593606
BFGS: 13 07:12:46 -302.872663 1.583228
BFGS: 14 07:12:46 -302.880832 1.592458
BFGS: 15 07:12:47 -302.886998 1.589733
BFGS: 16 07:12:47 -302.894193 1.577966
BFGS: 17 07:12:47 -302.910170 1.551805
BFGS: 18 07:12:47 -302.999510 2.026492
BFGS: 19 07:12:47 -303.207487 4.197987
BFGS: 20 07:12:47 -303.658323 3.084242
Step Time Energy fmax
BFGS: 0 07:12:47 -300.752434 1237393.500000
BFGS: 1 07:12:47 -300.129720 3.906874
BFGS: 2 07:12:47 -300.496016 3.958827
BFGS: 3 07:12:47 -301.820915 3.524820
BFGS: 4 07:12:47 -301.021643 13.852757
BFGS: 5 07:12:48 -302.163905 3.276346
BFGS: 6 07:12:48 -302.328670 2.931456
BFGS: 7 07:12:48 -302.565531 1.906293
BFGS: 8 07:12:48 -302.629907 1.854880
BFGS: 9 07:12:48 -302.647219 1.856019
BFGS: 10 07:12:48 -302.700376 1.851936
BFGS: 11 07:12:48 -302.720812 1.838004
BFGS: 12 07:12:48 -302.733835 1.811872
BFGS: 13 07:12:48 -302.744983 1.776103
BFGS: 14 07:12:48 -302.762164 1.703855
BFGS: 15 07:12:48 -302.772156 1.657307
BFGS: 16 07:12:48 -302.778505 1.635787
BFGS: 17 07:12:49 -302.783701 1.628289
BFGS: 18 07:12:49 -302.791640 1.623226
BFGS: 19 07:12:49 -302.802947 1.621404
BFGS: 20 07:12:49 -302.813196 1.624909
Step Time Energy fmax
BFGS: 0 07:12:49 -300.752156 958979.812500
BFGS: 1 07:12:49 -300.294318 3.849440
BFGS: 2 07:12:49 -300.700012 3.655063
BFGS: 3 07:12:49 -302.009871 3.461925
BFGS: 4 07:12:49 -300.651436 17.857656
BFGS: 5 07:12:49 -302.270003 3.088399
BFGS: 6 07:12:49 -302.412902 2.643303
BFGS: 7 07:12:50 -302.625520 1.683475
BFGS: 8 07:12:50 -302.677086 1.657928
BFGS: 9 07:12:50 -302.695578 1.656826
BFGS: 10 07:12:50 -302.763265 1.645972
BFGS: 11 07:12:50 -302.766854 1.644060
BFGS: 12 07:12:50 -302.772737 1.635173
BFGS: 13 07:12:50 -302.775808 1.626734
BFGS: 14 07:12:50 -302.777684 1.619977
BFGS: 15 07:12:50 -302.778548 1.618210
BFGS: 16 07:12:50 -302.779566 1.618125
BFGS: 17 07:12:50 -302.780831 1.619834
BFGS: 18 07:12:51 -302.782308 1.623907
BFGS: 19 07:12:51 -302.783256 1.628815
BFGS: 20 07:12:51 -302.783810 1.633226
Step Time Energy fmax
BFGS: 0 07:12:51 -301.367776 734718.375000
BFGS: 1 07:12:51 -300.373613 4.251923
BFGS: 2 07:12:51 -300.697998 3.964267
BFGS: 3 07:12:51 -301.605781 3.470611
BFGS: 4 07:12:51 -301.862125 3.937727
BFGS: 5 07:12:51 -302.137763 3.472821
BFGS: 6 07:12:51 -302.557125 1.840855
BFGS: 7 07:12:51 -302.861679 4.297287
BFGS: 8 07:12:51 -303.094408 2.271455
BFGS: 9 07:12:52 -303.204131 1.707169
BFGS: 10 07:12:52 -303.266515 1.656627
BFGS: 11 07:12:52 -303.326790 2.166239
BFGS: 12 07:12:52 -303.351042 2.353221
BFGS: 13 07:12:52 -303.398000 2.472169
BFGS: 14 07:12:52 -303.426460 2.292179
BFGS: 15 07:12:52 -303.451545 2.004319
BFGS: 16 07:12:52 -303.468649 1.814169
BFGS: 17 07:12:52 -303.488268 1.684826
BFGS: 18 07:12:52 -303.506023 1.689187
BFGS: 19 07:12:52 -303.522368 1.805359
BFGS: 20 07:12:53 -303.533859 1.940736
Step Time Energy fmax
BFGS: 0 07:12:53 -300.692237 2242775.750000
BFGS: 1 07:12:53 -300.382386 3.956891
BFGS: 2 07:12:53 -300.773074 3.569161
BFGS: 3 07:12:53 -301.986693 3.409589
BFGS: 4 07:12:53 -300.839614 16.339235
BFGS: 5 07:12:53 -302.242521 3.117142
BFGS: 6 07:12:53 -302.385702 2.738616
BFGS: 7 07:12:53 -302.650630 1.568122
BFGS: 8 07:12:53 -302.713034 1.501343
BFGS: 9 07:12:53 -302.741886 1.474344
BFGS: 10 07:12:53 -302.829175 1.348827
BFGS: 11 07:12:54 -302.837122 1.373355
BFGS: 12 07:12:54 -302.841478 1.390398
BFGS: 13 07:12:54 -302.844425 1.403741
BFGS: 14 07:12:54 -302.847798 1.422694
BFGS: 15 07:12:54 -302.849095 1.428573
BFGS: 16 07:12:54 -302.849729 1.425538
BFGS: 17 07:12:54 -302.850188 1.417929
BFGS: 18 07:12:54 -302.850699 1.406000
BFGS: 19 07:12:54 -302.851046 1.397125
BFGS: 20 07:12:54 -302.851192 1.395729
Step Time Energy fmax
BFGS: 0 07:12:54 -301.021204 1183257.250000
BFGS: 1 07:12:55 -300.559050 3.857456
BFGS: 2 07:12:55 -300.963793 3.768289
BFGS: 3 07:12:55 -302.250743 3.522372
BFGS: 4 07:12:55 -301.592028 12.025145
BFGS: 5 07:12:55 -302.534960 3.012607
BFGS: 6 07:12:55 -302.668303 2.390933
BFGS: 7 07:12:55 -302.801585 1.829538
BFGS: 8 07:12:55 -302.843129 1.553139
BFGS: 9 07:12:55 -302.859922 1.563480
BFGS: 10 07:12:55 -302.943152 1.680257
BFGS: 11 07:12:55 -302.953424 1.685840
BFGS: 12 07:12:55 -303.007411 1.695568
BFGS: 13 07:12:56 -303.035158 1.682445
BFGS: 14 07:12:56 -303.062635 1.647693
BFGS: 15 07:12:56 -303.094914 1.611370
BFGS: 16 07:12:56 -303.173188 2.405181
BFGS: 17 07:12:56 -303.268279 3.002233
BFGS: 18 07:12:56 -303.467419 3.218233
BFGS: 19 07:12:56 -303.573911 1.997600
BFGS: 20 07:12:56 -303.833891 1.261686
Step Time Energy fmax
BFGS: 0 07:12:56 -300.967650 1662747.375000
BFGS: 1 07:12:56 -300.486064 3.998914
BFGS: 2 07:12:56 -300.918710 3.533284
BFGS: 3 07:12:57 -302.152393 3.642399
BFGS: 4 07:12:57 -302.235654 4.978955
BFGS: 5 07:12:57 -302.558838 2.187905
BFGS: 6 07:12:57 -302.614915 2.492773
BFGS: 7 07:12:57 -302.670182 1.388081
BFGS: 8 07:12:57 -302.680783 1.373629
BFGS: 9 07:12:57 -302.715941 1.584960
BFGS: 10 07:12:57 -302.723618 1.658198
BFGS: 11 07:12:57 -302.731375 1.673557
BFGS: 12 07:12:57 -302.738281 1.613313
BFGS: 13 07:12:57 -302.745847 1.490032
BFGS: 14 07:12:58 -302.750466 1.408343
BFGS: 15 07:12:58 -302.754429 1.411341
BFGS: 16 07:12:58 -302.760415 1.422424
BFGS: 17 07:12:58 -302.773408 1.428826
BFGS: 18 07:12:58 -302.810148 1.560925
BFGS: 19 07:12:58 -302.845790 1.921989
BFGS: 20 07:12:58 -302.863244 2.053810
Step Time Energy fmax
BFGS: 0 07:12:58 -302.470622 1874135.125000
BFGS: 1 07:12:58 -301.949555 3.855478
BFGS: 2 07:12:58 -302.271717 2.697441
BFGS: 3 07:12:58 -303.020413 3.126417
BFGS: 4 07:12:58 -303.205126 2.828788
BFGS: 5 07:12:59 -303.512553 2.151452
BFGS: 6 07:12:59 -303.577494 1.964283
BFGS: 7 07:12:59 -303.671383 1.922129
BFGS: 8 07:12:59 -303.746212 1.959042
BFGS: 9 07:12:59 -303.773836 1.961362
BFGS: 10 07:12:59 -303.807983 1.947705
BFGS: 11 07:12:59 -303.823529 1.931327
BFGS: 12 07:12:59 -303.841276 1.937527
BFGS: 13 07:12:59 -303.845989 1.991817
BFGS: 14 07:12:59 -303.850985 1.967407
BFGS: 15 07:12:59 -303.854093 1.938241
BFGS: 16 07:13:00 -303.856129 1.964756
BFGS: 17 07:13:00 -303.857450 1.987064
BFGS: 18 07:13:00 -303.859072 2.014813
BFGS: 19 07:13:00 -303.861419 2.051125
BFGS: 20 07:13:00 -303.864106 2.081580
Step Time Energy fmax
BFGS: 0 07:13:00 -301.662267 1914092.875000
BFGS: 1 07:13:00 -301.291570 4.206193
BFGS: 2 07:13:00 -301.664868 3.174215
BFGS: 3 07:13:00 -302.577165 3.379917
BFGS: 4 07:13:00 -302.754280 3.279892
BFGS: 5 07:13:00 -303.069435 2.217451
BFGS: 6 07:13:01 -303.329749 3.057029
BFGS: 7 07:13:01 -303.442282 1.613850
BFGS: 8 07:13:01 -303.588395 1.557306
BFGS: 9 07:13:01 -303.627142 1.598002
BFGS: 10 07:13:01 -303.674492 1.671283
BFGS: 11 07:13:01 -303.738188 1.784342
BFGS: 12 07:13:01 -303.798576 1.891012
BFGS: 13 07:13:01 -303.843424 1.942036
BFGS: 14 07:13:01 -303.871892 1.933655
BFGS: 15 07:13:01 -303.959794 1.881217
BFGS: 16 07:13:01 -304.011452 1.812025
BFGS: 17 07:13:01 -304.064620 1.760742
BFGS: 18 07:13:02 -304.096418 1.813427
BFGS: 19 07:13:02 -304.115007 1.850717
BFGS: 20 07:13:02 -304.135617 1.901388
# 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())
Step Time Energy fmax
BFGS: 0 07:13:02 -296.783161 2077789.500000
BFGS: 1 07:13:02 -296.345605 4.442060
BFGS: 2 07:13:02 -296.787379 4.656825
BFGS: 3 07:13:02 -298.113751 4.335704
BFGS: 4 07:13:02 -298.760213 2.015297
BFGS: 5 07:13:02 -298.871245 1.950872
BFGS: 6 07:13:02 -299.435171 2.803649
BFGS: 7 07:13:02 -299.835940 2.467000
BFGS: 8 07:13:03 -299.932204 2.654170
BFGS: 9 07:13:03 -300.036871 2.223992
BFGS: 10 07:13:03 -300.164971 1.634223
BFGS: 11 07:13:03 -300.280871 1.492879
BFGS: 12 07:13:03 -300.306737 1.499308
BFGS: 13 07:13:03 -300.322051 1.472772
BFGS: 14 07:13:03 -300.331619 1.430095
BFGS: 15 07:13:03 -300.337534 1.444683
BFGS: 16 07:13:03 -300.339590 1.474359
BFGS: 17 07:13:03 -300.341330 1.501964
BFGS: 18 07:13:03 -300.342424 1.514801
BFGS: 19 07:13:03 -300.343052 1.519162
BFGS: 20 07:13:04 -300.343425 1.521243
Step Time Energy fmax
BFGS: 0 07:13:04 -295.920636 1134277.250000
BFGS: 1 07:13:04 -295.360721 1134277.875000
BFGS: 2 07:13:04 -294.329066 4.731640
BFGS: 3 07:13:04 -294.982773 4.663005
BFGS: 4 07:13:04 -296.862139 3.449005
BFGS: 5 07:13:04 -294.647082 22.620621
BFGS: 6 07:13:04 -297.063149 2.487264
BFGS: 7 07:13:04 -297.118694 2.457153
BFGS: 8 07:13:04 -297.174408 2.362556
BFGS: 9 07:13:04 -297.185398 2.341496
BFGS: 10 07:13:05 -297.212269 2.398303
BFGS: 11 07:13:05 -297.216305 2.407972
BFGS: 12 07:13:05 -297.227858 2.409543
BFGS: 13 07:13:05 -297.237177 2.374737
BFGS: 14 07:13:05 -297.244302 2.315571
BFGS: 15 07:13:05 -297.248243 2.273307
BFGS: 16 07:13:05 -297.252213 2.233108
BFGS: 17 07:13:05 -297.256312 2.194187
BFGS: 18 07:13:05 -297.259546 2.166935
BFGS: 19 07:13:05 -297.261682 2.157786
BFGS: 20 07:13:05 -297.263510 2.158403
Step Time Energy fmax
BFGS: 0 07:13:06 -295.975402 2629461.000000
BFGS: 1 07:13:06 -295.679928 4.336806
BFGS: 2 07:13:06 -296.202575 4.710883
BFGS: 3 07:13:06 -297.879647 2.963678
BFGS: 4 07:13:06 -296.325768 17.858988
BFGS: 5 07:13:06 -298.046098 1.824306
BFGS: 6 07:13:06 -298.107985 1.407902
BFGS: 7 07:13:06 -298.146732 1.409045
BFGS: 8 07:13:06 -298.152541 1.411223
BFGS: 9 07:13:06 -298.160038 1.418756
BFGS: 10 07:13:07 -298.161576 1.423787
BFGS: 11 07:13:07 -298.161794 1.424733
BFGS: 12 07:13:07 -298.161974 1.424915
BFGS: 13 07:13:07 -298.162264 1.424440
BFGS: 14 07:13:07 -298.162669 1.422705
BFGS: 15 07:13:07 -298.163110 1.419611
BFGS: 16 07:13:07 -298.163671 1.415084
BFGS: 17 07:13:07 -298.164880 1.406259
BFGS: 18 07:13:07 -298.170823 1.375093
BFGS: 19 07:13:07 -298.185217 1.662574
BFGS: 20 07:13:07 -298.226685 2.752130
Step Time Energy fmax
BFGS: 0 07:13:08 -297.154118 1505495.500000
BFGS: 1 07:13:08 -296.750768 4.612737
BFGS: 2 07:13:08 -297.237339 4.751886
BFGS: 3 07:13:08 -298.522721 3.614109
BFGS: 4 07:13:08 -298.789742 4.407241
BFGS: 5 07:13:08 -298.990356 1.589313
BFGS: 6 07:13:08 -299.093610 1.605118
BFGS: 7 07:13:08 -299.263873 1.698712
BFGS: 8 07:13:08 -299.302395 1.682654
BFGS: 9 07:13:08 -299.336457 1.686079
BFGS: 10 07:13:08 -299.425484 1.696550
BFGS: 11 07:13:09 -299.449892 1.692026
BFGS: 12 07:13:09 -299.472139 1.688006
BFGS: 13 07:13:09 -299.478205 1.680359
BFGS: 14 07:13:09 -299.483818 1.665903
BFGS: 15 07:13:09 -299.487588 1.654732
BFGS: 16 07:13:09 -299.489024 1.661912
BFGS: 17 07:13:09 -299.491038 1.681379
BFGS: 18 07:13:09 -299.495814 1.736043
BFGS: 19 07:13:09 -299.509646 1.887856
BFGS: 20 07:13:09 -299.539818 2.182163
Step Time Energy fmax
BFGS: 0 07:13:09 -297.031244 1464249.875000
BFGS: 1 07:13:09 -296.776452 4.699897
BFGS: 2 07:13:10 -297.263975 4.661793
BFGS: 3 07:13:10 -298.392292 2.699121
BFGS: 4 07:13:10 -298.266532 8.404469
BFGS: 5 07:13:10 -298.655065 3.266573
BFGS: 6 07:13:10 -298.733481 3.181809
BFGS: 7 07:13:10 -298.874961 2.595062
BFGS: 8 07:13:10 -298.910005 2.492143
BFGS: 9 07:13:10 -298.925107 2.373738
BFGS: 10 07:13:10 -298.965481 2.145751
BFGS: 11 07:13:10 -298.975385 2.227127
BFGS: 12 07:13:10 -298.990272 2.522405
BFGS: 13 07:13:11 -298.998551 2.745405
BFGS: 14 07:13:11 -299.010164 2.984466
BFGS: 15 07:13:11 -299.033663 3.233999
BFGS: 16 07:13:11 -299.081624 3.576044
BFGS: 17 07:13:11 -299.106492 3.363757
BFGS: 18 07:13:11 -299.204478 2.233094
BFGS: 19 07:13:11 -299.279655 2.064682
BFGS: 20 07:13:11 -299.350656 2.216564
Step Time Energy fmax
BFGS: 0 07:13:11 -296.033438 1899914.500000
BFGS: 1 07:13:11 -295.755805 4.394859
BFGS: 2 07:13:11 -296.279682 4.751536
BFGS: 3 07:13:11 -297.911831 2.957132
BFGS: 4 07:13:12 -296.459690 17.057196
BFGS: 5 07:13:12 -298.078678 1.804429
BFGS: 6 07:13:12 -298.138599 1.499003
BFGS: 7 07:13:12 -298.176167 1.424992
BFGS: 8 07:13:12 -298.182052 1.412907
BFGS: 9 07:13:12 -298.191174 1.371607
BFGS: 10 07:13:12 -298.192538 1.363749
BFGS: 11 07:13:12 -298.193773 1.362400
BFGS: 12 07:13:12 -298.196634 1.367317
BFGS: 13 07:13:12 -298.203350 1.389475
BFGS: 14 07:13:12 -298.232117 1.525956
BFGS: 15 07:13:13 -298.275853 1.819165
BFGS: 16 07:13:13 -298.292882 2.325748
BFGS: 17 07:13:13 -298.325563 1.986092
BFGS: 18 07:13:13 -298.358564 1.863747
BFGS: 19 07:13:13 -298.434625 2.088169
BFGS: 20 07:13:13 -298.603531 3.013170
Step Time Energy fmax
BFGS: 0 07:13:13 -296.679439 1783908.875000
BFGS: 1 07:13:13 -296.336187 4.519692
BFGS: 2 07:13:13 -296.831067 4.737967
BFGS: 3 07:13:13 -298.211332 3.416826
BFGS: 4 07:13:13 -297.998663 8.691991
BFGS: 5 07:13:14 -298.525933 2.003640
BFGS: 6 07:13:14 -298.623158 1.674752
BFGS: 7 07:13:14 -298.965033 2.778054
BFGS: 8 07:13:14 -299.211696 2.914817
BFGS: 9 07:13:14 -299.301974 1.902047
BFGS: 10 07:13:14 -299.444760 1.812729
BFGS: 11 07:13:14 -299.528620 1.746637
BFGS: 12 07:13:14 -299.566655 1.705061
BFGS: 13 07:13:14 -299.607407 1.663742
BFGS: 14 07:13:14 -299.632480 1.643164
BFGS: 15 07:13:14 -299.650878 1.626191
BFGS: 16 07:13:14 -299.670462 1.602116
BFGS: 17 07:13:15 -299.706406 1.554346
BFGS: 18 07:13:15 -299.758929 1.492057
BFGS: 19 07:13:15 -299.791981 1.929851
BFGS: 20 07:13:15 -299.893753 1.864349
Step Time Energy fmax
BFGS: 0 07:13:15 -297.205527 1979829.500000
BFGS: 1 07:13:15 -296.692605 4.455489
BFGS: 2 07:13:15 -297.167851 4.613441
BFGS: 3 07:13:15 -298.472880 3.744016
BFGS: 4 07:13:15 -298.885203 2.789100
BFGS: 5 07:13:15 -299.015448 1.695416
BFGS: 6 07:13:15 -299.127895 1.702132
BFGS: 7 07:13:16 -299.314386 1.712131
BFGS: 8 07:13:16 -299.352514 1.683307
BFGS: 9 07:13:16 -299.449313 1.849308
BFGS: 10 07:13:16 -299.532026 1.898505
BFGS: 11 07:13:16 -299.581580 1.907621
BFGS: 12 07:13:16 -299.628140 2.021667
BFGS: 13 07:13:16 -299.686972 2.175126
BFGS: 14 07:13:16 -299.735531 2.206945
BFGS: 15 07:13:16 -299.793988 2.158250
BFGS: 16 07:13:16 -299.845668 2.024960
BFGS: 17 07:13:16 -299.868529 2.167953
BFGS: 18 07:13:16 -299.894543 2.156609
BFGS: 19 07:13:17 -299.910226 2.097422
BFGS: 20 07:13:17 -299.923014 2.067465
Step Time Energy fmax
BFGS: 0 07:13:17 -297.261996 1897336.375000
BFGS: 1 07:13:17 -296.553889 4.662014
BFGS: 2 07:13:17 -297.038084 4.841273
BFGS: 3 07:13:17 -298.309782 4.360722
BFGS: 4 07:13:17 -299.032932 1.944353
BFGS: 5 07:13:17 -299.179354 2.309070
BFGS: 6 07:13:17 -299.475103 1.815260
BFGS: 7 07:13:17 -299.582675 1.551556
BFGS: 8 07:13:17 -299.700291 1.548065
BFGS: 9 07:13:18 -299.762159 1.688138
BFGS: 10 07:13:18 -299.884660 2.145310
BFGS: 11 07:13:18 -299.991101 2.521709
BFGS: 12 07:13:18 -300.115547 2.104489
BFGS: 13 07:13:18 -300.180466 1.469389
BFGS: 14 07:13:18 -300.205031 1.405271
BFGS: 15 07:13:18 -300.251596 1.498473
BFGS: 16 07:13:18 -300.265123 1.587875
BFGS: 17 07:13:18 -300.278792 1.620858
BFGS: 18 07:13:18 -300.289216 1.629354
BFGS: 19 07:13:18 -300.297680 1.611002
BFGS: 20 07:13:19 -300.305086 1.572504
Step Time Energy fmax
BFGS: 0 07:13:19 -296.505685 1113654.125000
BFGS: 1 07:13:19 -295.993104 4.417868
BFGS: 2 07:13:19 -296.473404 4.632699
BFGS: 3 07:13:19 -297.869998 3.160908
BFGS: 4 07:13:19 -297.426222 10.063998
BFGS: 5 07:13:19 -298.130724 1.856328
BFGS: 6 07:13:19 -298.212848 1.581068
BFGS: 7 07:13:19 -298.404268 2.462076
BFGS: 8 07:13:19 -298.644577 3.032371
BFGS: 9 07:13:19 -298.803849 2.600151
BFGS: 10 07:13:19 -298.909658 1.989423
BFGS: 11 07:13:20 -299.160030 1.757016
BFGS: 12 07:13:20 -299.205548 1.751597
BFGS: 13 07:13:20 -299.232932 1.767072
BFGS: 14 07:13:20 -299.253366 1.736104
BFGS: 15 07:13:20 -299.273764 1.675157
BFGS: 16 07:13:20 -299.285023 1.655000
BFGS: 17 07:13:20 -299.316506 1.621547
BFGS: 18 07:13:20 -299.338705 1.620565
BFGS: 19 07:13:20 -299.372225 1.625759
BFGS: 20 07:13:20 -299.425123 1.859089
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 07:13:20 -295.580603 2046854.750000
BFGS: 1 07:13:21 -295.312132 1.556301
BFGS: 2 07:13:21 -295.364296 1.544456
BFGS: 3 07:13:21 -295.560624 1.531752
BFGS: 4 07:13:21 -295.576730 1.524903
BFGS: 5 07:13:21 -295.588382 1.529339
BFGS: 6 07:13:21 -295.634619 1.559592
BFGS: 7 07:13:21 -295.650571 1.568635
BFGS: 8 07:13:21 -295.668947 1.569405
BFGS: 9 07:13:21 -295.682222 1.555946
BFGS: 10 07:13:21 -295.693231 1.529216
BFGS: 11 07:13:21 -295.697133 1.512823
BFGS: 12 07:13:22 -295.698761 1.504776
BFGS: 13 07:13:22 -295.700256 1.498191
BFGS: 14 07:13:22 -295.701847 1.492534
BFGS: 15 07:13:22 -295.702823 1.491902
BFGS: 16 07:13:22 -295.703344 1.495402
BFGS: 17 07:13:22 -295.703820 1.501680
BFGS: 18 07:13:22 -295.704333 1.510282
BFGS: 19 07:13:22 -295.704644 1.515160
BFGS: 20 07:13:22 -295.704736 1.514150
Step Time Energy fmax
BFGS: 0 07:13:22 -295.261467 701141.500000
BFGS: 1 07:13:22 -294.853881 1.827023
BFGS: 2 07:13:22 -294.938457 1.792987
BFGS: 3 07:13:23 -295.135826 1.682911
BFGS: 4 07:13:23 -295.170092 1.673802
BFGS: 5 07:13:23 -295.182078 1.678925
BFGS: 6 07:13:23 -295.213755 1.716981
BFGS: 7 07:13:23 -295.217314 1.717803
BFGS: 8 07:13:23 -295.250535 1.735982
BFGS: 9 07:13:23 -295.255187 1.730148
BFGS: 10 07:13:23 -295.307142 1.664553
BFGS: 11 07:13:23 -295.331343 1.597595
BFGS: 12 07:13:23 -295.353411 1.604741
BFGS: 13 07:13:23 -295.379498 1.616255
BFGS: 14 07:13:24 -295.414243 1.687587
BFGS: 15 07:13:24 -295.432563 1.750539
BFGS: 16 07:13:24 -295.447966 1.828769
BFGS: 17 07:13:24 -295.456628 1.841678
BFGS: 18 07:13:24 -295.464220 1.830121
BFGS: 19 07:13:24 -295.469153 1.775508
BFGS: 20 07:13:24 -295.474564 1.715368
Step Time Energy fmax
BFGS: 0 07:13:24 -295.119708 1910226.125000
BFGS: 1 07:13:24 -294.831621 1.682837
BFGS: 2 07:13:24 -294.939252 1.501784
BFGS: 3 07:13:24 -295.112159 2.420975
BFGS: 4 07:13:24 -295.194950 1.377565
BFGS: 5 07:13:25 -295.210723 1.394685
BFGS: 6 07:13:25 -295.233940 1.434348
BFGS: 7 07:13:25 -295.243660 1.448455
BFGS: 8 07:13:25 -295.250807 1.450517
BFGS: 9 07:13:25 -295.255007 1.445183
BFGS: 10 07:13:25 -295.261162 1.434946
BFGS: 11 07:13:25 -295.264965 1.429587
BFGS: 12 07:13:25 -295.266206 1.430690
BFGS: 13 07:13:25 -295.266411 1.433189
BFGS: 14 07:13:25 -295.266629 1.436683
BFGS: 15 07:13:25 -295.266865 1.440258
BFGS: 16 07:13:26 -295.267067 1.442537
BFGS: 17 07:13:26 -295.267213 1.443168
BFGS: 18 07:13:26 -295.267407 1.443369
BFGS: 19 07:13:26 -295.267762 1.443888
BFGS: 20 07:13:26 -295.268361 1.445555
Step Time Energy fmax
BFGS: 0 07:13:26 -295.309618 1608611.500000
BFGS: 1 07:13:26 -294.832336 2.172853
BFGS: 2 07:13:26 -294.905423 2.088362
BFGS: 3 07:13:26 -295.168976 1.888723
BFGS: 4 07:13:26 -295.197012 1.766942
BFGS: 5 07:13:26 -295.213997 1.690562
BFGS: 6 07:13:27 -295.271773 1.632931
BFGS: 7 07:13:27 -295.287508 1.609771
BFGS: 8 07:13:27 -295.341069 1.523474
BFGS: 9 07:13:27 -295.364347 1.671179
BFGS: 10 07:13:27 -295.401770 1.879402
BFGS: 11 07:13:27 -295.413065 1.866079
BFGS: 12 07:13:27 -295.436716 1.733907
BFGS: 13 07:13:27 -295.447152 1.712398
BFGS: 14 07:13:27 -295.451894 1.652422
BFGS: 15 07:13:27 -295.455291 1.641374
BFGS: 16 07:13:27 -295.460066 1.746753
BFGS: 17 07:13:28 -295.464153 1.824382
BFGS: 18 07:13:28 -295.467452 1.854749
BFGS: 19 07:13:28 -295.470034 1.839935
BFGS: 20 07:13:28 -295.473209 1.797302
Step Time Energy fmax
BFGS: 0 07:13:28 -295.125862 719761.187500
BFGS: 1 07:13:28 -294.697790 1.877730
BFGS: 2 07:13:28 -294.811306 1.784468
BFGS: 3 07:13:28 -294.996982 2.165388
BFGS: 4 07:13:28 -295.069290 1.434986
BFGS: 5 07:13:28 -295.083749 1.390597
BFGS: 6 07:13:28 -295.108386 1.309095
BFGS: 7 07:13:28 -295.117753 1.308149
BFGS: 8 07:13:29 -295.124179 1.338366
BFGS: 9 07:13:29 -295.128021 1.368424
BFGS: 10 07:13:29 -295.133798 1.413623
BFGS: 11 07:13:29 -295.137658 1.431957
BFGS: 12 07:13:29 -295.139274 1.421006
BFGS: 13 07:13:29 -295.139822 1.404706
BFGS: 14 07:13:29 -295.140740 1.373835
BFGS: 15 07:13:29 -295.142006 1.337014
BFGS: 16 07:13:29 -295.143742 1.313926
BFGS: 17 07:13:29 -295.146094 1.313396
BFGS: 18 07:13:29 -295.150874 1.310065
BFGS: 19 07:13:30 -295.164129 1.310754
BFGS: 20 07:13:30 -295.178466 1.326811
Step Time Energy fmax
BFGS: 0 07:13:30 -295.446153 1394645.500000
BFGS: 1 07:13:30 -295.158471 1.544454
BFGS: 2 07:13:30 -295.231014 1.514818
BFGS: 3 07:13:30 -295.439357 1.382740
BFGS: 4 07:13:30 -295.463742 1.397675
BFGS: 5 07:13:30 -295.475489 1.399824
BFGS: 6 07:13:30 -295.509542 1.410043
BFGS: 7 07:13:30 -295.516308 1.414083
BFGS: 8 07:13:30 -295.567165 1.469386
BFGS: 9 07:13:31 -295.581171 1.470126
BFGS: 10 07:13:31 -295.591627 1.459120
BFGS: 11 07:13:31 -295.595023 1.454440
BFGS: 12 07:13:31 -295.603247 1.427790
BFGS: 13 07:13:31 -295.610291 1.400025
BFGS: 14 07:13:31 -295.614513 1.384760
BFGS: 15 07:13:31 -295.618543 1.381152
BFGS: 16 07:13:31 -295.626722 1.390471
BFGS: 17 07:13:31 -295.637804 1.424409
BFGS: 18 07:13:31 -295.648375 1.470890
BFGS: 19 07:13:32 -295.656820 1.495269
BFGS: 20 07:13:32 -295.664231 1.492494
Step Time Energy fmax
BFGS: 0 07:13:32 -295.455374 1399801.375000
BFGS: 1 07:13:32 -295.201619 1.495075
BFGS: 2 07:13:32 -295.258494 1.476105
BFGS: 3 07:13:32 -295.459519 1.388333
BFGS: 4 07:13:32 -295.476697 1.399709
BFGS: 5 07:13:32 -295.488068 1.412394
BFGS: 6 07:13:32 -295.529471 1.478700
BFGS: 7 07:13:32 -295.541305 1.493235
BFGS: 8 07:13:32 -295.559037 1.498349
BFGS: 9 07:13:33 -295.569656 1.480362
BFGS: 10 07:13:33 -295.579232 1.449481
BFGS: 11 07:13:33 -295.582811 1.439787
BFGS: 12 07:13:33 -295.587140 1.432424
BFGS: 13 07:13:33 -295.592218 1.427416
BFGS: 14 07:13:33 -295.598203 1.424898
BFGS: 15 07:13:33 -295.603485 1.427540
BFGS: 16 07:13:33 -295.609643 1.437251
BFGS: 17 07:13:33 -295.619471 1.459888
BFGS: 18 07:13:33 -295.633690 1.500873
BFGS: 19 07:13:33 -295.646869 1.527225
BFGS: 20 07:13:33 -295.658849 1.524877
Step Time Energy fmax
BFGS: 0 07:13:34 -295.525955 1916670.375000
BFGS: 1 07:13:34 -295.158452 1.711680
BFGS: 2 07:13:34 -295.222702 1.653141
BFGS: 3 07:13:34 -295.417357 1.263647
BFGS: 4 07:13:34 -295.434981 1.350711
BFGS: 5 07:13:34 -295.444776 1.384481
BFGS: 6 07:13:34 -295.478103 1.554363
BFGS: 7 07:13:34 -295.485204 1.557466
BFGS: 8 07:13:34 -295.510909 1.481644
BFGS: 9 07:13:34 -295.528038 1.357155
BFGS: 10 07:13:34 -295.542837 1.243677
BFGS: 11 07:13:35 -295.547841 1.270960
BFGS: 12 07:13:35 -295.550008 1.294101
BFGS: 13 07:13:35 -295.554533 1.334143
BFGS: 14 07:13:35 -295.560670 1.370449
BFGS: 15 07:13:35 -295.567368 1.390190
BFGS: 16 07:13:35 -295.573693 1.383922
BFGS: 17 07:13:35 -295.583020 1.356401
BFGS: 18 07:13:35 -295.597762 1.309361
BFGS: 19 07:13:35 -295.615153 1.262383
BFGS: 20 07:13:35 -295.635221 1.219711
Step Time Energy fmax
BFGS: 0 07:13:35 -295.105271 1020849.500000
BFGS: 1 07:13:36 -294.640857 2.820477
BFGS: 2 07:13:36 -294.774056 2.469208
BFGS: 3 07:13:36 -294.977686 2.463096
BFGS: 4 07:13:36 -295.062111 1.547620
BFGS: 5 07:13:36 -295.077911 1.553859
BFGS: 6 07:13:36 -295.099904 1.613537
BFGS: 7 07:13:36 -295.110157 1.649035
BFGS: 8 07:13:36 -295.116142 1.731120
BFGS: 9 07:13:36 -295.118758 1.790629
BFGS: 10 07:13:36 -295.122755 1.876949
BFGS: 11 07:13:36 -295.125943 1.912427
BFGS: 12 07:13:36 -295.127725 1.889905
BFGS: 13 07:13:37 -295.128309 1.859217
BFGS: 14 07:13:37 -295.128819 1.826047
BFGS: 15 07:13:37 -295.129309 1.794448
BFGS: 16 07:13:37 -295.129579 1.783533
BFGS: 17 07:13:37 -295.129710 1.787956
BFGS: 18 07:13:37 -295.129828 1.796813
BFGS: 19 07:13:37 -295.129992 1.807699
BFGS: 20 07:13:37 -295.130171 1.814145
Step Time Energy fmax
BFGS: 0 07:13:37 -295.402178 708923.375000
BFGS: 1 07:13:37 -294.617596 2.101707
BFGS: 2 07:13:37 -294.687341 1.993869
BFGS: 3 07:13:38 -294.878751 2.017051
BFGS: 4 07:13:38 -294.909816 1.837034
BFGS: 5 07:13:38 -294.922872 1.814779
BFGS: 6 07:13:38 -294.985581 1.827151
BFGS: 7 07:13:38 -294.993772 1.791261
BFGS: 8 07:13:38 -295.046838 1.842348
BFGS: 9 07:13:38 -295.078644 1.911270
BFGS: 10 07:13:38 -295.094692 1.876970
BFGS: 11 07:13:38 -295.113903 1.776033
BFGS: 12 07:13:38 -295.151619 1.601157
BFGS: 13 07:13:38 -295.161153 1.584339
BFGS: 14 07:13:39 -295.168062 1.632243
BFGS: 15 07:13:39 -295.172173 1.649754
BFGS: 16 07:13:39 -295.177044 1.737844
BFGS: 17 07:13:39 -295.180443 1.809443
BFGS: 18 07:13:39 -295.182811 1.825167
BFGS: 19 07:13:39 -295.184519 1.798071
BFGS: 20 07:13:39 -295.186303 1.755720
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 07:13:39 -302.783179 1.787541
BFGS: 1 07:13:39 -303.040702 1.311857
BFGS: 2 07:13:39 -303.607826 1.782674
BFGS: 3 07:13:39 -303.735459 1.283177
BFGS: 4 07:13:40 -303.820054 0.531783
BFGS: 5 07:13:40 -303.840288 0.461124
BFGS: 6 07:13:40 -303.863844 0.436467
BFGS: 7 07:13:40 -303.878603 0.439081
BFGS: 8 07:13:40 -303.892856 0.345464
BFGS: 9 07:13:40 -303.902230 0.300806
BFGS: 10 07:13:40 -303.909280 0.234385
BFGS: 11 07:13:40 -303.915266 0.244436
BFGS: 12 07:13:40 -303.919347 0.159559
BFGS: 13 07:13:40 -303.921430 0.184717
BFGS: 14 07:13:40 -303.923389 0.175319
BFGS: 15 07:13:41 -303.925364 0.157396
BFGS: 16 07:13:41 -303.926914 0.135658
BFGS: 17 07:13:41 -303.927976 0.105676
BFGS: 18 07:13:41 -303.928777 0.110649
BFGS: 19 07:13:41 -303.929730 0.118890
BFGS: 20 07:13:41 -303.930990 0.152961
BFGS: 21 07:13:41 -303.932476 0.133748
BFGS: 22 07:13:41 -303.934216 0.162726
BFGS: 23 07:13:41 -303.936936 0.217525
BFGS: 24 07:13:41 -303.941569 0.294124
BFGS: 25 07:13:41 -303.949250 0.441691
BFGS: 26 07:13:41 -303.961765 0.507186
BFGS: 27 07:13:42 -303.985054 0.838988
BFGS: 28 07:13:42 -304.024844 1.003723
BFGS: 29 07:13:42 -304.064584 0.753742
BFGS: 30 07:13:42 -304.083680 0.785363
BFGS: 31 07:13:42 -304.132602 0.719511
BFGS: 32 07:13:42 -304.168076 0.705623
BFGS: 33 07:13:42 -304.231757 0.817422
BFGS: 34 07:13:42 -304.292533 0.856719
BFGS: 35 07:13:42 -304.331214 0.996566
BFGS: 36 07:13:42 -304.368306 0.750940
BFGS: 37 07:13:42 -304.394458 0.381235
BFGS: 38 07:13:43 -304.415832 0.252574
BFGS: 39 07:13:43 -304.421067 0.260417
BFGS: 40 07:13:43 -304.433367 0.188989
BFGS: 41 07:13:43 -304.439320 0.171726
BFGS: 42 07:13:43 -304.442049 0.151876
BFGS: 43 07:13:43 -304.443838 0.133037
BFGS: 44 07:13:43 -304.446283 0.123440
BFGS: 45 07:13:43 -304.448889 0.109193
BFGS: 46 07:13:43 -304.451292 0.075202
BFGS: 47 07:13:43 -304.453098 0.090505
BFGS: 48 07:13:43 -304.454245 0.083282
BFGS: 49 07:13:44 -304.454865 0.066388
BFGS: 50 07:13:44 -304.455229 0.050231
BFGS: 51 07:13:44 -304.455517 0.037578
Step Time Energy fmax
BFGS: 0 07:13:44 -302.260301 3.839473
BFGS: 1 07:13:44 -302.660467 2.291014
BFGS: 2 07:13:44 -303.273538 0.941569
BFGS: 3 07:13:44 -303.531638 1.088936
BFGS: 4 07:13:44 -303.586794 1.058690
BFGS: 5 07:13:44 -303.662605 0.482844
BFGS: 6 07:13:44 -303.684575 0.489047
BFGS: 7 07:13:44 -303.709566 0.626871
BFGS: 8 07:13:45 -303.743570 0.821674
BFGS: 9 07:13:45 -303.800485 0.888282
BFGS: 10 07:13:45 -303.847059 0.627803
BFGS: 11 07:13:45 -303.891776 0.463063
BFGS: 12 07:13:45 -303.903879 0.370120
BFGS: 13 07:13:45 -303.920847 0.268493
BFGS: 14 07:13:45 -303.926722 0.231576
BFGS: 15 07:13:45 -303.932935 0.190958
BFGS: 16 07:13:45 -303.936476 0.199088
BFGS: 17 07:13:45 -303.939306 0.214431
BFGS: 18 07:13:45 -303.942894 0.235865
BFGS: 19 07:13:46 -303.949510 0.302259
BFGS: 20 07:13:46 -303.961756 0.493984
BFGS: 21 07:13:46 -303.978672 0.607412
BFGS: 22 07:13:46 -304.005703 0.564020
BFGS: 23 07:13:46 -304.043890 0.686709
BFGS: 24 07:13:46 -304.078692 0.532851
BFGS: 25 07:13:46 -304.107329 0.598855
BFGS: 26 07:13:46 -304.137073 0.575895
BFGS: 27 07:13:46 -304.164044 0.754689
BFGS: 28 07:13:46 -304.209339 0.763558
BFGS: 29 07:13:46 -304.272509 0.789425
BFGS: 30 07:13:47 -304.323979 0.690198
BFGS: 31 07:13:47 -304.364864 0.437351
BFGS: 32 07:13:47 -304.385553 0.385067
BFGS: 33 07:13:47 -304.397620 0.265059
BFGS: 34 07:13:47 -304.407162 0.208306
BFGS: 35 07:13:47 -304.423064 0.188552
BFGS: 36 07:13:47 -304.434398 0.307936
BFGS: 37 07:13:47 -304.440136 0.234066
BFGS: 38 07:13:47 -304.444742 0.129469
BFGS: 39 07:13:47 -304.447205 0.093554
BFGS: 40 07:13:47 -304.449060 0.086038
BFGS: 41 07:13:47 -304.450305 0.086203
BFGS: 42 07:13:48 -304.451386 0.076958
BFGS: 43 07:13:48 -304.452323 0.062668
BFGS: 44 07:13:48 -304.453160 0.056315
BFGS: 45 07:13:48 -304.453932 0.048780
Step Time Energy fmax
BFGS: 0 07:13:48 -303.045005 1.966903
BFGS: 1 07:13:48 -303.361599 1.531488
BFGS: 2 07:13:48 -304.071724 2.142534
BFGS: 3 07:13:48 -304.239855 1.462393
BFGS: 4 07:13:48 -304.325485 0.538948
BFGS: 5 07:13:48 -304.348938 0.417763
BFGS: 6 07:13:49 -304.371891 0.491023
BFGS: 7 07:13:49 -304.392567 0.540706
BFGS: 8 07:13:49 -304.414711 0.429155
BFGS: 9 07:13:49 -304.426477 0.231176
BFGS: 10 07:13:49 -304.431004 0.150043
BFGS: 11 07:13:49 -304.434704 0.157747
BFGS: 12 07:13:49 -304.437952 0.169036
BFGS: 13 07:13:49 -304.440778 0.130063
BFGS: 14 07:13:49 -304.442660 0.135164
BFGS: 15 07:13:49 -304.444109 0.130583
BFGS: 16 07:13:49 -304.445800 0.114553
BFGS: 17 07:13:49 -304.447459 0.124496
BFGS: 18 07:13:50 -304.448653 0.101047
BFGS: 19 07:13:50 -304.449409 0.093322
BFGS: 20 07:13:50 -304.450246 0.088328
BFGS: 21 07:13:50 -304.451553 0.114156
BFGS: 22 07:13:50 -304.452834 0.132146
BFGS: 23 07:13:50 -304.453666 0.094137
BFGS: 24 07:13:50 -304.454050 0.044876
Step Time Energy fmax
BFGS: 0 07:13:50 -302.986095 1.912576
BFGS: 1 07:13:50 -303.314508 1.861996
BFGS: 2 07:13:50 -304.132610 2.144902
BFGS: 3 07:13:51 -304.281020 1.340586
BFGS: 4 07:13:51 -304.372433 0.635387
BFGS: 5 07:13:51 -304.389691 0.380307
BFGS: 6 07:13:51 -304.411440 0.497655
BFGS: 7 07:13:51 -304.429213 0.433658
BFGS: 8 07:13:51 -304.443302 0.252641
BFGS: 9 07:13:51 -304.448392 0.123574
BFGS: 10 07:13:51 -304.449765 0.089590
BFGS: 11 07:13:51 -304.450827 0.115964
BFGS: 12 07:13:51 -304.452593 0.145975
BFGS: 13 07:13:51 -304.454253 0.122902
BFGS: 14 07:13:51 -304.455118 0.078309
BFGS: 15 07:13:52 -304.455530 0.049667
Step Time Energy fmax
BFGS: 0 07:13:52 -300.684890 3.919027
BFGS: 1 07:13:52 -301.061372 2.829808
BFGS: 2 07:13:52 -301.724856 1.146927
BFGS: 3 07:13:52 -301.932213 0.920697
BFGS: 4 07:13:52 -302.014901 0.798958
BFGS: 5 07:13:52 -302.072252 0.719539
BFGS: 6 07:13:52 -302.145803 0.429233
BFGS: 7 07:13:52 -302.167508 0.395143
BFGS: 8 07:13:52 -302.184671 0.371908
BFGS: 9 07:13:53 -302.199557 0.427267
BFGS: 10 07:13:53 -302.220310 0.461346
BFGS: 11 07:13:53 -302.241951 0.326131
BFGS: 12 07:13:53 -302.255034 0.369388
BFGS: 13 07:13:53 -302.268603 0.417963
BFGS: 14 07:13:53 -302.293002 0.584972
BFGS: 15 07:13:53 -302.349364 0.975298
BFGS: 16 07:13:53 -302.406713 1.962082
BFGS: 17 07:13:53 -302.469247 2.972282
BFGS: 18 07:13:53 -302.550586 3.764569
BFGS: 19 07:13:53 -302.667449 4.148293
BFGS: 20 07:13:53 -302.808930 3.880631
BFGS: 21 07:13:54 -302.855344 3.057012
BFGS: 22 07:13:54 -302.933598 3.294688
BFGS: 23 07:13:54 -303.062980 3.644478
BFGS: 24 07:13:54 -303.165499 3.472957
BFGS: 25 07:13:54 -303.224425 3.163321
BFGS: 26 07:13:54 -303.294414 2.792047
BFGS: 27 07:13:54 -303.351114 2.801151
BFGS: 28 07:13:54 -303.389930 2.776141
BFGS: 29 07:13:54 -303.445505 2.744636
BFGS: 30 07:13:54 -303.503262 2.595734
BFGS: 31 07:13:54 -303.542706 2.379214
BFGS: 32 07:13:55 -303.567241 2.176799
BFGS: 33 07:13:55 -303.589285 2.017404
BFGS: 34 07:13:55 -303.613807 1.906418
BFGS: 35 07:13:55 -303.640988 1.862023
BFGS: 36 07:13:55 -303.667934 1.895834
BFGS: 37 07:13:55 -303.704776 1.969685
BFGS: 38 07:13:55 -303.764409 2.061521
BFGS: 39 07:13:55 -303.833496 2.122542
BFGS: 40 07:13:55 -303.897279 2.160356
BFGS: 41 07:13:55 -303.963860 2.145229
BFGS: 42 07:13:55 -304.006227 1.980157
BFGS: 43 07:13:56 -304.052743 2.085171
BFGS: 44 07:13:56 -304.102441 2.208359
BFGS: 45 07:13:56 -304.134182 2.143292
BFGS: 46 07:13:56 -304.150165 2.047535
BFGS: 47 07:13:56 -304.165965 1.915581
BFGS: 48 07:13:56 -304.181904 1.841395
BFGS: 49 07:13:56 -304.199515 1.792806
BFGS: 50 07:13:56 -304.210675 1.840003
BFGS: 51 07:13:56 -304.217144 1.881859
BFGS: 52 07:13:56 -304.223911 1.903862
BFGS: 53 07:13:56 -304.231726 1.867459
BFGS: 54 07:13:56 -304.237897 1.772020
BFGS: 55 07:13:57 -304.242008 1.664585
BFGS: 56 07:13:57 -304.246099 1.553897
BFGS: 57 07:13:57 -304.252313 1.409284
BFGS: 58 07:13:57 -304.261912 1.210138
BFGS: 59 07:13:57 -304.272130 1.002007
BFGS: 60 07:13:57 -304.279551 0.935040
BFGS: 61 07:13:57 -304.287961 0.927450
BFGS: 62 07:13:57 -304.297741 0.949442
BFGS: 63 07:13:57 -304.310890 0.925815
BFGS: 64 07:13:57 -304.326889 0.809335
BFGS: 65 07:13:57 -304.345304 0.537636
BFGS: 66 07:13:58 -304.365665 0.505488
BFGS: 67 07:13:58 -304.388630 0.534863
BFGS: 68 07:13:58 -304.423007 0.646308
BFGS: 69 07:13:58 -304.453964 0.637823
BFGS: 70 07:13:58 -304.477377 0.479664
BFGS: 71 07:13:58 -304.512425 0.281639
BFGS: 72 07:13:58 -304.525506 0.226396
BFGS: 73 07:13:58 -304.532022 0.165607
BFGS: 74 07:13:58 -304.534003 0.141690
BFGS: 75 07:13:58 -304.535878 0.093635
BFGS: 76 07:13:58 -304.536994 0.048848
Step Time Energy fmax
BFGS: 0 07:13:59 -299.201545 9.031186
BFGS: 1 07:13:59 -300.628457 2.373293
BFGS: 2 07:13:59 -301.067756 2.115354
BFGS: 3 07:13:59 -301.618594 1.314208
BFGS: 4 07:13:59 -301.814603 0.893814
BFGS: 5 07:13:59 -301.900049 0.696922
BFGS: 6 07:13:59 -301.942304 0.698445
BFGS: 7 07:13:59 -302.002834 0.694671
BFGS: 8 07:13:59 -302.031980 0.617387
BFGS: 9 07:13:59 -302.058598 0.531907
BFGS: 10 07:13:59 -302.083594 0.489843
BFGS: 11 07:14:00 -302.109240 0.431990
BFGS: 12 07:14:00 -302.137523 0.337818
BFGS: 13 07:14:00 -302.157023 0.465292
BFGS: 14 07:14:00 -302.171817 0.445343
BFGS: 15 07:14:00 -302.193033 0.399959
BFGS: 16 07:14:00 -302.215132 0.454495
BFGS: 17 07:14:00 -302.235929 0.538821
BFGS: 18 07:14:00 -302.254724 0.492682
BFGS: 19 07:14:00 -302.276694 0.588670
BFGS: 20 07:14:00 -302.326281 0.849120
BFGS: 21 07:14:00 -302.378496 1.588629
BFGS: 22 07:14:01 -302.427968 2.503063
BFGS: 23 07:14:01 -302.476326 3.320418
BFGS: 24 07:14:01 -302.526949 3.903502
BFGS: 25 07:14:01 -302.590248 4.089715
BFGS: 26 07:14:01 -302.718820 3.722095
BFGS: 27 07:14:01 -302.971340 2.934231
BFGS: 28 07:14:01 -303.362970 2.097494
BFGS: 29 07:14:01 -303.684120 2.499507
BFGS: 30 07:14:01 -303.811801 1.909430
BFGS: 31 07:14:01 -303.871471 2.664410
BFGS: 32 07:14:01 -304.003114 2.205699
BFGS: 33 07:14:01 -304.108367 1.531492
BFGS: 34 07:14:02 -304.143809 1.592774
BFGS: 35 07:14:02 -304.254161 1.543246
BFGS: 36 07:14:02 -304.311209 1.445945
BFGS: 37 07:14:02 -304.373592 1.128644
BFGS: 38 07:14:02 -304.419117 0.727903
BFGS: 39 07:14:02 -304.455581 0.512896
BFGS: 40 07:14:02 -304.486757 0.424753
BFGS: 41 07:14:02 -304.511915 0.311639
BFGS: 42 07:14:02 -304.524985 0.185678
BFGS: 43 07:14:02 -304.530153 0.142221
BFGS: 44 07:14:02 -304.533179 0.114614
BFGS: 45 07:14:03 -304.534810 0.081900
BFGS: 46 07:14:03 -304.535849 0.067451
BFGS: 47 07:14:03 -304.536867 0.074107
BFGS: 48 07:14:03 -304.537819 0.090114
BFGS: 49 07:14:03 -304.538557 0.082312
BFGS: 50 07:14:03 -304.539058 0.056987
BFGS: 51 07:14:03 -304.539412 0.034983
Step Time Energy fmax
BFGS: 0 07:14:03 -300.624748 2.279193
BFGS: 1 07:14:03 -300.934455 2.078254
BFGS: 2 07:14:03 -301.747736 1.088936
BFGS: 3 07:14:04 -301.913676 0.771747
BFGS: 4 07:14:04 -301.973468 0.699486
BFGS: 5 07:14:04 -302.027966 0.544381
BFGS: 6 07:14:04 -302.084598 0.473295
BFGS: 7 07:14:04 -302.106809 0.437829
BFGS: 8 07:14:04 -302.123782 0.404846
BFGS: 9 07:14:04 -302.135369 0.369225
BFGS: 10 07:14:04 -302.150936 0.334488
BFGS: 11 07:14:04 -302.176152 0.390430
BFGS: 12 07:14:04 -302.195996 0.596424
BFGS: 13 07:14:04 -302.215513 0.662860
BFGS: 14 07:14:04 -302.240174 0.574100
BFGS: 15 07:14:05 -302.270363 0.548912
BFGS: 16 07:14:05 -302.313839 1.011906
BFGS: 17 07:14:05 -302.362416 1.638509
BFGS: 18 07:14:05 -302.417460 2.367580
BFGS: 19 07:14:05 -302.474984 3.051843
BFGS: 20 07:14:05 -302.537445 3.469602
BFGS: 21 07:14:05 -302.604098 3.531122
BFGS: 22 07:14:05 -302.660263 3.110182
BFGS: 23 07:14:05 -302.689699 2.003364
BFGS: 24 07:14:05 -302.776565 2.460585
BFGS: 25 07:14:05 -303.036121 2.667517
BFGS: 26 07:14:06 -303.299568 2.363404
BFGS: 27 07:14:06 -303.474437 1.444306
BFGS: 28 07:14:06 -303.570664 1.520427
BFGS: 29 07:14:06 -303.693811 0.889349
BFGS: 30 07:14:06 -303.769789 0.822866
BFGS: 31 07:14:06 -303.798530 0.794514
BFGS: 32 07:14:06 -303.814998 0.864751
BFGS: 33 07:14:06 -303.835017 0.879830
BFGS: 34 07:14:06 -303.867535 0.835865
BFGS: 35 07:14:06 -303.899040 0.576694
BFGS: 36 07:14:06 -303.923122 0.478736
BFGS: 37 07:14:07 -303.934651 0.465585
BFGS: 38 07:14:07 -303.950488 0.387114
BFGS: 39 07:14:07 -303.962521 0.321272
BFGS: 40 07:14:07 -303.970809 0.280919
BFGS: 41 07:14:07 -303.976053 0.239182
BFGS: 42 07:14:07 -303.979634 0.199545
BFGS: 43 07:14:07 -303.982206 0.145474
BFGS: 44 07:14:07 -303.984930 0.097863
BFGS: 45 07:14:07 -303.986712 0.073195
BFGS: 46 07:14:07 -303.987905 0.062418
BFGS: 47 07:14:07 -303.988613 0.056156
BFGS: 48 07:14:07 -303.989125 0.050037
BFGS: 49 07:14:08 -303.989647 0.041764
Step Time Energy fmax
BFGS: 0 07:14:08 -300.763763 2.552897
BFGS: 1 07:14:08 -301.047919 2.210049
BFGS: 2 07:14:08 -301.833520 0.921058
BFGS: 3 07:14:08 -301.967248 0.916044
BFGS: 4 07:14:08 -302.026978 0.769924
BFGS: 5 07:14:08 -302.101195 0.617497
BFGS: 6 07:14:08 -302.163568 0.510229
BFGS: 7 07:14:08 -302.192021 0.512205
BFGS: 8 07:14:08 -302.212574 0.461360
BFGS: 9 07:14:09 -302.232977 0.450976
BFGS: 10 07:14:09 -302.258496 0.499934
BFGS: 11 07:14:09 -302.291923 0.524979
BFGS: 12 07:14:09 -302.313004 0.538082
BFGS: 13 07:14:09 -302.340501 0.543718
BFGS: 14 07:14:09 -302.387054 0.915812
BFGS: 15 07:14:09 -302.447268 1.633014
BFGS: 16 07:14:09 -302.485114 2.432036
BFGS: 17 07:14:09 -302.574975 1.721695
BFGS: 18 07:14:09 -302.809101 1.813690
BFGS: 19 07:14:09 -303.000666 1.773847
BFGS: 20 07:14:09 -303.105012 2.220364
BFGS: 21 07:14:10 -303.192039 2.031795
BFGS: 22 07:14:10 -303.302645 1.557195
BFGS: 23 07:14:10 -303.567557 1.003799
BFGS: 24 07:14:10 -303.686787 0.762745
BFGS: 25 07:14:10 -303.756521 0.583808
BFGS: 26 07:14:10 -303.807600 0.550215
BFGS: 27 07:14:10 -303.841535 0.467145
BFGS: 28 07:14:10 -303.867568 0.553855
BFGS: 29 07:14:10 -303.897400 0.616081
BFGS: 30 07:14:10 -303.917201 0.492164
BFGS: 31 07:14:10 -303.931255 0.372087
BFGS: 32 07:14:11 -303.942561 0.365219
BFGS: 33 07:14:11 -303.956138 0.333086
BFGS: 34 07:14:11 -303.967590 0.277195
BFGS: 35 07:14:11 -303.974185 0.265745
BFGS: 36 07:14:11 -303.979428 0.183517
BFGS: 37 07:14:11 -303.982931 0.129701
BFGS: 38 07:14:11 -303.985836 0.105577
BFGS: 39 07:14:11 -303.987657 0.079195
BFGS: 40 07:14:11 -303.988436 0.079905
BFGS: 41 07:14:11 -303.988820 0.067829
BFGS: 42 07:14:11 -303.989152 0.049634
/home/runner/work/fairchem/fairchem/src/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)
Step Time Energy fmax
BFGS: 0 07:14:34 -302.501713 3.925265
BFGS: 1 07:14:34 -302.683898 3.117385
BFGS: 2 07:14:35 -303.208007 7.271789
BFGS: 3 07:14:36 -303.278937 2.057261
BFGS: 4 07:14:37 -303.501604 1.782922
BFGS: 5 07:14:38 -303.630774 1.475378
BFGS: 6 07:14:38 -303.659812 1.388509
BFGS: 7 07:14:39 -303.675785 0.854244
BFGS: 8 07:14:40 -303.704392 0.698873
BFGS: 9 07:14:41 -303.721559 0.704969
BFGS: 10 07:14:42 -303.735269 0.387208
BFGS: 11 07:14:42 -303.743790 0.387817
BFGS: 12 07:14:43 -303.752894 0.369999
BFGS: 13 07:14:44 -303.758593 0.336099
BFGS: 14 07:14:45 -303.762587 0.313480
BFGS: 15 07:14:46 -303.766780 0.266693
BFGS: 16 07:14:46 -303.771682 0.305355
BFGS: 17 07:14:47 -303.776414 0.285964
BFGS: 18 07:14:48 -303.779298 0.243799
BFGS: 19 07:14:49 -303.781786 0.245348
BFGS: 20 07:14:50 -303.785814 0.295296
BFGS: 21 07:14:50 -303.791594 0.371481
BFGS: 22 07:14:51 -303.796887 0.345329
BFGS: 23 07:14:52 -303.800174 0.339887
BFGS: 24 07:14:53 -303.804291 0.357144
BFGS: 25 07:14:54 -303.812121 0.386032
BFGS: 26 07:14:54 -303.823240 0.453909
BFGS: 27 07:14:55 -303.830857 0.465705
BFGS: 28 07:14:56 -303.830170 0.388500
BFGS: 29 07:14:57 -303.830461 0.416723
BFGS: 30 07:14:58 -303.831135 0.420392
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_3816/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 interative html file of the optimized neb trajectory
x3d = X3D(optimized_neb)
x3d.write("optimized_neb_ch_disoc_on_Ru0001.html")