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

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 17:43:07     -302.270917  1407535.000000
BFGS:    1 17:43:07     -301.936809        4.028198
BFGS:    2 17:43:07     -302.303015        2.843485
BFGS:    3 17:43:07     -303.085715        3.286428
BFGS:    4 17:43:07     -303.252741        2.803139
BFGS:    5 17:43:07     -303.652296        2.081953
BFGS:    6 17:43:07     -303.761091        2.168875
BFGS:    7 17:43:07     -304.028110        1.611966
BFGS:    8 17:43:08     -304.112058        1.599332
BFGS:    9 17:43:08     -304.201111        1.545179
BFGS:   10 17:43:08     -304.261958        1.485085
BFGS:   11 17:43:08     -304.307445        1.430457
BFGS:   12 17:43:08     -304.325483        1.417298
BFGS:   13 17:43:08     -304.336563        1.427405
BFGS:   14 17:43:08     -304.349912        1.455388
BFGS:   15 17:43:08     -304.356107        1.474071
BFGS:   16 17:43:08     -304.359253        1.480203
BFGS:   17 17:43:08     -304.362456        1.480822
BFGS:   18 17:43:08     -304.366673        1.475965
BFGS:   19 17:43:09     -304.371070        1.465788
BFGS:   20 17:43:09     -304.375126        1.452615
      Step     Time          Energy          fmax
BFGS:    0 17:43:09     -302.683954  3175975.250000
BFGS:    1 17:43:09     -302.124192        3.664452
BFGS:    2 17:43:09     -302.506320        3.311488
BFGS:    3 17:43:09     -303.502371        2.952815
BFGS:    4 17:43:09     -303.638019        2.548251
BFGS:    5 17:43:09     -303.794226        1.635661
BFGS:    6 17:43:09     -303.851892        1.498515
BFGS:    7 17:43:09     -303.902395        1.591474
BFGS:    8 17:43:09     -303.988884        1.808308
BFGS:    9 17:43:09     -303.999865        1.816099
BFGS:   10 17:43:10     -304.023467        1.777138
BFGS:   11 17:43:10     -304.033743        1.718761
BFGS:   12 17:43:10     -304.038605        1.679519
BFGS:   13 17:43:10     -304.040711        1.672655
BFGS:   14 17:43:10     -304.043457        1.674325
BFGS:   15 17:43:10     -304.046387        1.682643
BFGS:   16 17:43:10     -304.048822        1.687725
BFGS:   17 17:43:10     -304.050907        1.680136
BFGS:   18 17:43:10     -304.053650        1.649274
BFGS:   19 17:43:10     -304.057129        1.584349
BFGS:   20 17:43:10     -304.059977        1.523230
      Step     Time          Energy          fmax
BFGS:    0 17:43:11     -301.694352   676699.812500
BFGS:    1 17:43:11     -301.111506        4.203496
BFGS:    2 17:43:11     -301.544481        3.736817
BFGS:    3 17:43:11     -302.692050        2.915458
BFGS:    4 17:43:11     -302.699322        5.673777
BFGS:    5 17:43:11     -303.123599        2.407960
BFGS:    6 17:43:11     -303.273095        1.595387
BFGS:    7 17:43:11     -303.450125        1.624661
BFGS:    8 17:43:11     -303.497709        1.665379
BFGS:    9 17:43:11     -303.602293        1.779027
BFGS:   10 17:43:11     -303.636037        1.809846
BFGS:   11 17:43:11     -303.672541        1.796533
BFGS:   12 17:43:12     -303.695028        1.741489
BFGS:   13 17:43:12     -303.705832        1.748518
BFGS:   14 17:43:12     -303.709839        1.761499
BFGS:   15 17:43:12     -303.712837        1.757344
BFGS:   16 17:43:12     -303.715102        1.738407
BFGS:   17 17:43:12     -303.716175        1.723946
BFGS:   18 17:43:12     -303.716879        1.727607
BFGS:   19 17:43:12     -303.717804        1.747538
BFGS:   20 17:43:12     -303.719125        1.772568
      Step     Time          Energy          fmax
BFGS:    0 17:43:12     -301.122786  1062096.625000
BFGS:    1 17:43:12     -300.443413        4.092463
BFGS:    2 17:43:13     -300.857112        3.859750
BFGS:    3 17:43:13     -301.868346        3.527354
BFGS:    4 17:43:13     -302.045742        3.036744
BFGS:    5 17:43:13     -301.811933        9.331802
BFGS:    6 17:43:13     -302.305698        2.167013
BFGS:    7 17:43:13     -302.357336        1.794183
BFGS:    8 17:43:13     -302.394461        1.784968
BFGS:    9 17:43:13     -302.423512        1.773294
BFGS:   10 17:43:13     -302.474914        2.207163
BFGS:   11 17:43:13     -302.483052        2.083992
BFGS:   12 17:43:13     -302.485228        2.102052
BFGS:   13 17:43:13     -302.490505        2.133084
BFGS:   14 17:43:14     -302.491992        2.117399
BFGS:   15 17:43:14     -302.493399        2.084961
BFGS:   16 17:43:14     -302.493893        2.075272
BFGS:   17 17:43:14     -302.494778        2.064430
BFGS:   18 17:43:14     -302.495565        2.059916
BFGS:   19 17:43:14     -302.496196        2.059734
BFGS:   20 17:43:14     -302.496631        2.060292
      Step     Time          Energy          fmax
BFGS:    0 17:43:14     -302.039535  1144588.750000
BFGS:    1 17:43:14     -301.516688        4.098871
BFGS:    2 17:43:14     -301.911929        3.089722
BFGS:    3 17:43:14     -302.921233        3.343160
BFGS:    4 17:43:14     -303.092739        3.204131
BFGS:    5 17:43:15     -303.342301        2.229354
BFGS:    6 17:43:15     -303.481549        2.485820
BFGS:    7 17:43:15     -303.544116        1.726623
BFGS:    8 17:43:15     -303.585798        1.715367
BFGS:    9 17:43:15     -303.680992        1.673366
BFGS:   10 17:43:15     -303.707734        1.675676
BFGS:   11 17:43:15     -303.750642        1.705937
BFGS:   12 17:43:15     -303.766790        1.728104
BFGS:   13 17:43:15     -303.777576        1.743597
BFGS:   14 17:43:15     -303.781793        1.740348
BFGS:   15 17:43:15     -303.785071        1.725412
BFGS:   16 17:43:16     -303.787508        1.706908
BFGS:   17 17:43:16     -303.789083        1.697056
BFGS:   18 17:43:16     -303.790525        1.698754
BFGS:   19 17:43:16     -303.792617        1.715548
BFGS:   20 17:43:16     -303.795879        1.755157
      Step     Time          Energy          fmax
BFGS:    0 17:43:16     -301.235048  1319886.375000
BFGS:    1 17:43:16     -300.787062        3.907274
BFGS:    2 17:43:16     -301.182839        3.731670
BFGS:    3 17:43:16     -302.362162        3.325844
BFGS:    4 17:43:16     -302.068776        8.761470
BFGS:    5 17:43:16     -302.730450        2.777717
BFGS:    6 17:43:16     -302.882112        2.061087
BFGS:    7 17:43:17     -303.139791        3.072970
BFGS:    8 17:43:17     -303.271011        2.042817
BFGS:    9 17:43:17     -303.515972        1.952422
BFGS:   10 17:43:17     -303.587349        1.647256
BFGS:   11 17:43:17     -303.649057        1.762098
BFGS:   12 17:43:17     -303.677481        1.913704
BFGS:   13 17:43:17     -303.708133        2.003121
BFGS:   14 17:43:17     -303.735270        1.895969
BFGS:   15 17:43:17     -303.761525        1.758686
BFGS:   16 17:43:17     -303.777272        1.874107
BFGS:   17 17:43:17     -303.786703        1.892825
BFGS:   18 17:43:18     -303.795664        1.858503
BFGS:   19 17:43:18     -303.803036        1.804956
BFGS:   20 17:43:18     -303.809229        1.798152
      Step     Time          Energy          fmax
BFGS:    0 17:43:18     -300.606779  1144588.750000
BFGS:    1 17:43:18     -300.081333        4.106371
BFGS:    2 17:43:18     -300.557852        4.319582
BFGS:    3 17:43:18     -301.984831        3.629730
BFGS:    4 17:43:18     -301.314967       13.076915
BFGS:    5 17:43:18     -302.239170        3.292157
BFGS:    6 17:43:18     -302.376286        2.834184
BFGS:    7 17:43:18     -302.541677        2.319600
BFGS:    8 17:43:18     -302.619599        1.463435
BFGS:    9 17:43:19     -302.633530        1.452836
BFGS:   10 17:43:19     -302.655600        1.410152
BFGS:   11 17:43:19     -302.668170        1.368883
BFGS:   12 17:43:19     -302.674434        1.337837
BFGS:   13 17:43:19     -302.676537        1.333513
BFGS:   14 17:43:19     -302.680652        1.332678
BFGS:   15 17:43:19     -302.683493        1.336370
BFGS:   16 17:43:19     -302.685645        1.340925
BFGS:   17 17:43:19     -302.686706        1.342249
BFGS:   18 17:43:19     -302.687516        1.341617
BFGS:   19 17:43:19     -302.688509        1.340229
BFGS:   20 17:43:19     -302.689448        1.339536
      Step     Time          Energy          fmax
BFGS:    0 17:43:20     -300.925864   881422.812500
BFGS:    1 17:43:20     -300.441077        3.856240
BFGS:    2 17:43:20     -300.853641        3.565130
BFGS:    3 17:43:20     -302.113521        3.504467
BFGS:    4 17:43:20     -302.010896        7.682412
BFGS:    5 17:43:20     -302.438440        2.687116
BFGS:    6 17:43:20     -302.579983        1.762516
BFGS:    7 17:43:20     -302.634487        1.761515
BFGS:    8 17:43:20     -302.651261        1.793115
BFGS:    9 17:43:20     -302.671658        1.887983
BFGS:   10 17:43:20     -302.683940        1.975741
BFGS:   11 17:43:21     -302.695353        2.063255
BFGS:   12 17:43:21     -302.703798        2.083594
BFGS:   13 17:43:21     -302.725281        2.059215
BFGS:   14 17:43:21     -302.785062        1.899004
BFGS:   15 17:43:21     -302.857798        2.037935
BFGS:   16 17:43:21     -302.869975        3.316963
BFGS:   17 17:43:21     -303.015655        2.777282
BFGS:   18 17:43:21     -303.167704        2.503132
BFGS:   19 17:43:21     -303.340832        2.875561
BFGS:   20 17:43:21     -303.484063        1.986635
      Step     Time          Energy          fmax
BFGS:    0 17:43:21     -302.066764  2407761.500000
BFGS:    1 17:43:21     -301.560055        4.027708
BFGS:    2 17:43:22     -301.948323        3.380110
BFGS:    3 17:43:22     -302.900880        2.915282
BFGS:    4 17:43:22     -303.038541        2.784044
BFGS:    5 17:43:22     -303.264669        2.246339
BFGS:    6 17:43:22     -303.460191        2.985553
BFGS:    7 17:43:22     -303.563699        1.840821
BFGS:    8 17:43:22     -303.708017        1.375416
BFGS:    9 17:43:22     -303.739702        1.367945
BFGS:   10 17:43:22     -303.826348        1.374800
BFGS:   11 17:43:23     -303.866934        1.402923
BFGS:   12 17:43:23     -303.890201        1.415254
BFGS:   13 17:43:23     -303.904498        1.410533
BFGS:   14 17:43:23     -303.923342        1.401876
BFGS:   15 17:43:23     -303.937956        1.395096
BFGS:   16 17:43:23     -303.947361        1.378511
BFGS:   17 17:43:23     -303.953445        1.350328
BFGS:   18 17:43:23     -303.959912        1.307440
BFGS:   19 17:43:23     -303.967077        1.256919
BFGS:   20 17:43:23     -303.973279        1.271067
      Step     Time          Energy          fmax
BFGS:    0 17:43:23     -300.575294  1417846.750000
BFGS:    1 17:43:23     -299.815249        4.276046
BFGS:    2 17:43:24     -300.316791        4.511871
BFGS:    3 17:43:24     -301.799281        3.596909
BFGS:    4 17:43:24     -301.374500       11.049820
BFGS:    5 17:43:24     -302.047516        3.316401
BFGS:    6 17:43:24     -302.178107        2.892676
BFGS:    7 17:43:24     -302.363363        2.210143
BFGS:    8 17:43:24     -302.428474        1.607680
BFGS:    9 17:43:24     -302.444487        1.571557
BFGS:   10 17:43:24     -302.480512        1.648075
BFGS:   11 17:43:24     -302.486645        1.737202
BFGS:   12 17:43:24     -302.490422        1.783282
BFGS:   13 17:43:25     -302.493245        1.783773
BFGS:   14 17:43:25     -302.496362        1.746691
BFGS:   15 17:43:25     -302.497846        1.706178
BFGS:   16 17:43:25     -302.498806        1.678239
BFGS:   17 17:43:25     -302.499841        1.661541
BFGS:   18 17:43:25     -302.501164        1.659804
BFGS:   19 17:43:25     -302.502151        1.679294
BFGS:   20 17:43:25     -302.502679        1.702936
# 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 17:43:25     -297.198175  1206458.625000
BFGS:    1 17:43:25     -296.530704        4.519354
BFGS:    2 17:43:25     -296.987856        4.669678
BFGS:    3 17:43:25     -298.282522        4.031072
BFGS:    4 17:43:26     -298.827030        2.242182
BFGS:    5 17:43:26     -298.917759        2.219232
BFGS:    6 17:43:26     -299.068440        2.128877
BFGS:    7 17:43:26     -299.148597        2.028355
BFGS:    8 17:43:26     -299.179631        1.986087
BFGS:    9 17:43:26     -299.258049        1.886007
BFGS:   10 17:43:26     -299.331742        1.788144
BFGS:   11 17:43:26     -299.378372        1.763836
BFGS:   12 17:43:26     -299.417082        1.815485
BFGS:   13 17:43:26     -299.434843        1.894239
BFGS:   14 17:43:26     -299.443671        1.945454
BFGS:   15 17:43:27     -299.453474        2.010321
BFGS:   16 17:43:27     -299.459511        2.051704
BFGS:   17 17:43:27     -299.465258        2.088752
BFGS:   18 17:43:27     -299.469818        2.112671
BFGS:   19 17:43:27     -299.474075        2.123495
BFGS:   20 17:43:27     -299.479089        2.121357
      Step     Time          Energy          fmax
BFGS:    0 17:43:27     -295.978420  1335353.625000
BFGS:    1 17:43:27     -295.590544        4.331620
BFGS:    2 17:43:27     -296.137040        4.723759
BFGS:    3 17:43:27     -297.863207        3.148725
BFGS:    4 17:43:27     -296.414528       17.237906
BFGS:    5 17:43:27     -298.044154        2.100755
BFGS:    6 17:43:28     -298.109128        1.512341
BFGS:    7 17:43:28     -298.146954        1.492536
BFGS:    8 17:43:28     -298.152662        1.487812
BFGS:    9 17:43:28     -298.160979        1.467139
BFGS:   10 17:43:28     -298.163334        1.450959
BFGS:   11 17:43:28     -298.164160        1.441370
BFGS:   12 17:43:28     -298.165315        1.425301
BFGS:   13 17:43:28     -298.166938        1.400221
BFGS:   14 17:43:28     -298.168987        1.366298
BFGS:   15 17:43:28     -298.170921        1.336374
BFGS:   16 17:43:28     -298.173413        1.306350
BFGS:   17 17:43:29     -298.180464        1.292821
BFGS:   18 17:43:29     -298.218325        1.844062
BFGS:   19 17:43:29     -298.357792        2.397641
BFGS:   20 17:43:29     -298.623030        2.853043
      Step     Time          Energy          fmax
BFGS:    0 17:43:29     -297.039333  1883158.125000
BFGS:    1 17:43:29     -296.746283        4.555602
BFGS:    2 17:43:29     -297.228564        4.694241
BFGS:    3 17:43:29     -298.528769        3.460962
BFGS:    4 17:43:29     -298.566167        6.564837
BFGS:    5 17:43:29     -298.917291        1.985106
BFGS:    6 17:43:29     -299.034504        1.833825
BFGS:    7 17:43:29     -299.423619        1.551190
BFGS:    8 17:43:30     -299.569680        1.684096
BFGS:    9 17:43:30     -299.608711        1.595282
BFGS:   10 17:43:30     -299.669823        1.578683
BFGS:   11 17:43:30     -299.717726        1.551262
BFGS:   12 17:43:30     -299.744327        1.520421
BFGS:   13 17:43:30     -299.762354        1.491238
BFGS:   14 17:43:30     -299.780241        1.458512
BFGS:   15 17:43:30     -299.788946        1.447021
BFGS:   16 17:43:30     -299.796539        1.446200
BFGS:   17 17:43:30     -299.805868        1.449360
BFGS:   18 17:43:30     -299.811145        1.447378
BFGS:   19 17:43:31     -299.814966        1.436948
BFGS:   20 17:43:31     -299.819734        1.413854
      Step     Time          Energy          fmax
BFGS:    0 17:43:31     -296.605375  2128156.250000
BFGS:    1 17:43:31     -295.928991        4.336052
BFGS:    2 17:43:31     -296.385141        4.522867
BFGS:    3 17:43:31     -297.695163        3.709200
BFGS:    4 17:43:31     -298.045968        4.617276
BFGS:    5 17:43:31     -298.251577        1.953521
BFGS:    6 17:43:31     -298.410127        1.931816
BFGS:    7 17:43:31     -298.854193        1.941044
BFGS:    8 17:43:31     -298.859683        2.916345
BFGS:    9 17:43:31     -298.911080        2.143047
BFGS:   10 17:43:32     -298.929530        2.099808
BFGS:   11 17:43:32     -298.970395        2.156201
BFGS:   12 17:43:32     -298.988872        2.277092
BFGS:   13 17:43:32     -299.019593        2.571546
BFGS:   14 17:43:32     -299.040338        2.753636
BFGS:   15 17:43:32     -299.072812        2.930003
BFGS:   16 17:43:32     -299.120618        3.033438
BFGS:   17 17:43:32     -299.158717        2.860729
BFGS:   18 17:43:32     -299.253092        2.637987
BFGS:   19 17:43:32     -299.340023        2.796004
BFGS:   20 17:43:32     -299.374648        2.816829
      Step     Time          Energy          fmax
BFGS:    0 17:43:32     -296.655651  2660394.750000
BFGS:    1 17:43:33     -296.080238        4.165079
BFGS:    2 17:43:33     -296.503504        4.376776
BFGS:    3 17:43:33     -297.854408        4.227559
BFGS:    4 17:43:33     -298.555721        1.714923
BFGS:    5 17:43:33     -298.635209        1.631868
BFGS:    6 17:43:33     -299.089100        2.378684
BFGS:    7 17:43:33     -299.400995        2.265090
BFGS:    8 17:43:33     -299.483160        2.247718
BFGS:    9 17:43:33     -299.591806        1.928387
BFGS:   10 17:43:33     -299.709430        1.401474
BFGS:   11 17:43:33     -299.796926        0.984395
BFGS:   12 17:43:34     -299.822045        1.053579
BFGS:   13 17:43:34     -299.835474        1.205103
BFGS:   14 17:43:34     -299.844401        1.355475
BFGS:   15 17:43:34     -299.848129        1.387431
BFGS:   16 17:43:34     -299.850920        1.347348
BFGS:   17 17:43:34     -299.853102        1.267007
BFGS:   18 17:43:34     -299.854572        1.201425
BFGS:   19 17:43:34     -299.855722        1.171086
BFGS:   20 17:43:34     -299.856759        1.176069
      Step     Time          Energy          fmax
BFGS:    0 17:43:34     -297.090237  2639772.000000
BFGS:    1 17:43:34     -296.635003        4.577689
BFGS:    2 17:43:34     -297.114701        4.763095
BFGS:    3 17:43:35     -298.436751        3.968571
BFGS:    4 17:43:35     -298.851335        3.808154
BFGS:    5 17:43:35     -299.025041        2.095957
BFGS:    6 17:43:35     -299.215774        2.223817
BFGS:    7 17:43:35     -299.682571        1.812252
BFGS:    8 17:43:35     -299.762990        1.908769
BFGS:    9 17:43:35     -299.865019        1.238848
BFGS:   10 17:43:35     -299.947335        1.279773
BFGS:   11 17:43:35     -300.251228        1.743031
BFGS:   12 17:43:35     -300.273521        2.236043
BFGS:   13 17:43:35     -300.346070        1.696452
BFGS:   14 17:43:36     -300.372437        1.520252
BFGS:   15 17:43:36     -300.421258        0.931689
BFGS:   16 17:43:36     -300.430523        0.965757
BFGS:   17 17:43:36     -300.444278        1.083156
BFGS:   18 17:43:36     -300.451678        1.192856
BFGS:   19 17:43:36     -300.458943        1.280053
BFGS:   20 17:43:36     -300.464549        1.295209
      Step     Time          Energy          fmax
BFGS:    0 17:43:36     -296.356028  1134277.250000
BFGS:    1 17:43:36     -296.151159        4.611089
BFGS:    2 17:43:36     -296.700317        4.879419
BFGS:    3 17:43:36     -298.180874        2.641982
BFGS:    4 17:43:36     -296.826066       16.043129
BFGS:    5 17:43:37     -298.318217        1.605590
BFGS:    6 17:43:37     -298.369989        1.261209
BFGS:    7 17:43:37     -298.439844        1.582710
BFGS:    8 17:43:37     -298.474331        1.661885
BFGS:    9 17:43:37     -298.651973        1.457937
BFGS:   10 17:43:37     -298.748420        2.122064
BFGS:   11 17:43:37     -298.914006        2.502555
BFGS:   12 17:43:37     -299.152444        2.905419
BFGS:   13 17:43:37     -299.392860        3.098700
BFGS:   14 17:43:37     -299.861915        2.407867
BFGS:   15 17:43:37     -300.165384        1.419487
BFGS:   16 17:43:38     -300.214936        1.433966
BFGS:   17 17:43:38     -300.275011        1.468674
BFGS:   18 17:43:38     -300.305244        1.470579
BFGS:   19 17:43:38     -300.323912        1.481317
BFGS:   20 17:43:38     -300.332534        1.477615
      Step     Time          Energy          fmax
BFGS:    0 17:43:38     -297.000664  1827733.375000
BFGS:    1 17:43:38     -296.513077        4.409902
BFGS:    2 17:43:38     -296.973172        4.599308
BFGS:    3 17:43:38     -298.272246        3.992210
BFGS:    4 17:43:38     -298.748135        3.145453
BFGS:    5 17:43:38     -298.886074        1.867995
BFGS:    6 17:43:38     -299.054504        1.917716
BFGS:    7 17:43:39     -299.421840        1.269628
BFGS:    8 17:43:39     -299.482455        1.371634
BFGS:    9 17:43:39     -299.563948        1.393720
BFGS:   10 17:43:39     -299.619425        1.540878
BFGS:   11 17:43:39     -299.644779        1.570939
BFGS:   12 17:43:39     -299.684358        1.538491
BFGS:   13 17:43:39     -299.700516        1.459506
BFGS:   14 17:43:39     -299.710560        1.378807
BFGS:   15 17:43:39     -299.717344        1.334535
BFGS:   16 17:43:39     -299.723044        1.319583
BFGS:   17 17:43:39     -299.728337        1.327412
BFGS:   18 17:43:39     -299.735753        1.354533
BFGS:   19 17:43:40     -299.743843        1.389876
BFGS:   20 17:43:40     -299.752010        1.416005
      Step     Time          Energy          fmax
BFGS:    0 17:43:40     -296.110002  1354688.125000
BFGS:    1 17:43:40     -295.581075        4.380171
BFGS:    2 17:43:40     -296.060608        4.681011
BFGS:    3 17:43:40     -297.561749        3.295255
BFGS:    4 17:43:40     -296.892611       11.721712
BFGS:    5 17:43:40     -297.797796        1.883995
BFGS:    6 17:43:40     -297.867172        1.745889
BFGS:    7 17:43:40     -297.914483        1.666893
BFGS:    8 17:43:40     -297.930555        1.635079
BFGS:    9 17:43:41     -297.991684        1.513181
BFGS:   10 17:43:41     -298.010271        1.513471
BFGS:   11 17:43:41     -298.067436        2.089006
BFGS:   12 17:43:41     -298.200325        2.276012
BFGS:   13 17:43:41     -298.363228        1.662906
BFGS:   14 17:43:41     -298.624967        2.123779
BFGS:   15 17:43:41     -298.866504        2.391693
BFGS:   16 17:43:41     -299.091028        2.379215
BFGS:   17 17:43:41     -299.324379        2.158325
BFGS:   18 17:43:41     -299.630804        1.805898
BFGS:   19 17:43:41     -299.699397        1.882384
BFGS:   20 17:43:41     -299.817002        1.960504
      Step     Time          Energy          fmax
BFGS:    0 17:43:42     -296.237198  2340735.750000
BFGS:    1 17:43:42     -295.762075        4.172797
BFGS:    2 17:43:42     -296.195421        4.455631
BFGS:    3 17:43:42     -297.656429        3.823347
BFGS:    4 17:43:42     -297.692464        6.585293
BFGS:    5 17:43:42     -298.049980        2.018633
BFGS:    6 17:43:42     -298.132128        1.830367
BFGS:    7 17:43:42     -298.186308        1.825667
BFGS:    8 17:43:42     -298.221799        1.806867
BFGS:    9 17:43:42     -298.395275        1.669357
BFGS:   10 17:43:42     -298.502768        2.096350
BFGS:   11 17:43:42     -298.639189        2.302411
BFGS:   12 17:43:43     -298.816905        2.326679
BFGS:   13 17:43:43     -299.249055        1.536764
BFGS:   14 17:43:43     -299.423901        1.592304
BFGS:   15 17:43:43     -299.442545        1.668812
BFGS:   16 17:43:43     -299.467289        1.719043
BFGS:   17 17:43:43     -299.512157        1.849896
BFGS:   18 17:43:43     -299.531857        1.890660
BFGS:   19 17:43:43     -299.590344        1.946104
BFGS:   20 17:43:43     -299.672696        1.949679
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 17:43:43     -295.613607   747591.812500
BFGS:    1 17:43:43     -294.988862        2.353073
BFGS:    2 17:43:44     -295.045423        2.146222
BFGS:    3 17:43:44     -295.198991        1.771899
BFGS:    4 17:43:44     -295.206600        1.763012
BFGS:    5 17:43:44     -295.232582        1.833684
BFGS:    6 17:43:44     -295.235527        1.817739
BFGS:    7 17:43:44     -295.261449        1.821111
BFGS:    8 17:43:44     -295.264224        1.812478
BFGS:    9 17:43:44     -295.276379        1.742303
BFGS:   10 17:43:44     -295.277157        1.732296
BFGS:   11 17:43:44     -295.277810        1.732983
BFGS:   12 17:43:44     -295.278659        1.744995
BFGS:   13 17:43:44     -295.279346        1.762911
BFGS:   14 17:43:45     -295.279716        1.772840
BFGS:   15 17:43:45     -295.279939        1.772419
BFGS:   16 17:43:45     -295.280156        1.763821
BFGS:   17 17:43:45     -295.280319        1.751099
BFGS:   18 17:43:45     -295.280397        1.743053
BFGS:   19 17:43:45     -295.280440        1.741259
BFGS:   20 17:43:45     -295.280481        1.742819
      Step     Time          Energy          fmax
BFGS:    0 17:43:45     -295.610105  2039443.375000
BFGS:    1 17:43:45     -295.169367        2.082308
BFGS:    2 17:43:45     -295.229691        1.976027
BFGS:    3 17:43:45     -295.420067        1.673804
BFGS:    4 17:43:46     -295.431417        1.627384
BFGS:    5 17:43:46     -295.439785        1.594998
BFGS:    6 17:43:46     -295.463385        1.681072
BFGS:    7 17:43:46     -295.470171        1.694047
BFGS:    8 17:43:46     -295.475859        1.633040
BFGS:    9 17:43:46     -295.480383        1.560107
BFGS:   10 17:43:46     -295.486474        1.495113
BFGS:   11 17:43:46     -295.490105        1.493808
BFGS:   12 17:43:46     -295.492799        1.478583
BFGS:   13 17:43:46     -295.496704        1.446839
BFGS:   14 17:43:46     -295.506609        1.453583
BFGS:   15 17:43:46     -295.518768        1.508730
BFGS:   16 17:43:47     -295.534571        1.518718
BFGS:   17 17:43:47     -295.562321        1.549459
BFGS:   18 17:43:47     -295.575893        1.546885
BFGS:   19 17:43:47     -295.581340        1.532557
BFGS:   20 17:43:47     -295.595075        1.491250
      Step     Time          Energy          fmax
BFGS:    0 17:43:47     -295.601175  1363710.375000
BFGS:    1 17:43:47     -295.239806        1.910322
BFGS:    2 17:43:47     -295.298608        1.824290
BFGS:    3 17:43:47     -295.483025        1.488759
BFGS:    4 17:43:47     -295.495226        1.432367
BFGS:    5 17:43:47     -295.503408        1.428110
BFGS:    6 17:43:48     -295.524313        1.613614
BFGS:    7 17:43:48     -295.530425        1.637049
BFGS:    8 17:43:48     -295.540407        1.611862
BFGS:    9 17:43:48     -295.551158        1.534005
BFGS:   10 17:43:48     -295.562587        1.413350
BFGS:   11 17:43:48     -295.568986        1.371810
BFGS:   12 17:43:48     -295.572989        1.384404
BFGS:   13 17:43:48     -295.577677        1.404313
BFGS:   14 17:43:48     -295.589280        1.436868
BFGS:   15 17:43:48     -295.604286        1.471185
BFGS:   16 17:43:48     -295.616883        1.500453
BFGS:   17 17:43:48     -295.631420        1.517835
BFGS:   18 17:43:49     -295.635752        1.499135
BFGS:   19 17:43:49     -295.643498        1.469703
BFGS:   20 17:43:49     -295.648818        1.467417
      Step     Time          Energy          fmax
BFGS:    0 17:43:49     -295.507173   822351.000000
BFGS:    1 17:43:49     -295.166740        1.498813
BFGS:    2 17:43:49     -295.220644        1.493912
BFGS:    3 17:43:49     -295.412869        1.514190
BFGS:    4 17:43:49     -295.424570        1.510538
BFGS:    5 17:43:49     -295.432137        1.517718
BFGS:    6 17:43:49     -295.456274        1.547874
BFGS:    7 17:43:49     -295.464459        1.551541
BFGS:    8 17:43:50     -295.476555        1.541424
BFGS:    9 17:43:50     -295.485828        1.519111
BFGS:   10 17:43:50     -295.493405        1.494058
BFGS:   11 17:43:50     -295.497827        1.486682
BFGS:   12 17:43:50     -295.502368        1.493473
BFGS:   13 17:43:50     -295.508857        1.518196
BFGS:   14 17:43:50     -295.517462        1.562131
BFGS:   15 17:43:50     -295.526581        1.605504
BFGS:   16 17:43:50     -295.536221        1.622664
BFGS:   17 17:43:50     -295.548041        1.598148
BFGS:   18 17:43:50     -295.561145        1.533587
BFGS:   19 17:43:50     -295.571817        1.469030
BFGS:   20 17:43:51     -295.576831        1.446491
      Step     Time          Energy          fmax
BFGS:    0 17:43:51     -295.182700   634164.250000
BFGS:    1 17:43:51     -294.780992        1.315557
BFGS:    2 17:43:51     -294.858831        1.308539
BFGS:    3 17:43:51     -295.020532        1.810051
BFGS:    4 17:43:51     -295.051764        1.306109
BFGS:    5 17:43:51     -295.061197        1.309946
BFGS:    6 17:43:51     -295.079804        1.331048
BFGS:    7 17:43:51     -295.081473        1.331549
BFGS:    8 17:43:51     -295.091829        1.344003
BFGS:    9 17:43:51     -295.092463        1.347284
BFGS:   10 17:43:51     -295.093935        1.361824
BFGS:   11 17:43:52     -295.094942        1.373644
BFGS:   12 17:43:52     -295.095915        1.383199
BFGS:   13 17:43:52     -295.096607        1.383283
BFGS:   14 17:43:52     -295.097974        1.375195
BFGS:   15 17:43:52     -295.100819        1.353227
BFGS:   16 17:43:52     -295.108994        1.379912
BFGS:   17 17:43:52     -295.125364        1.451693
BFGS:   18 17:43:52     -295.153864        1.509341
BFGS:   19 17:43:52     -295.157006        1.544222
BFGS:   20 17:43:52     -295.215007        1.512315
      Step     Time          Energy          fmax
BFGS:    0 17:43:52     -295.228432  1550608.625000
BFGS:    1 17:43:53     -294.895667        1.556328
BFGS:    2 17:43:53     -294.989584        1.532953
BFGS:    3 17:43:53     -295.178944        1.826479
BFGS:    4 17:43:53     -295.244284        1.550286
BFGS:    5 17:43:53     -295.257163        1.547608
BFGS:    6 17:43:53     -295.278313        1.523056
BFGS:    7 17:43:53     -295.288056        1.497101
BFGS:    8 17:43:53     -295.295084        1.473567
BFGS:    9 17:43:53     -295.299541        1.468723
BFGS:   10 17:43:53     -295.306641        1.476656
BFGS:   11 17:43:53     -295.312561        1.496393
BFGS:   12 17:43:53     -295.316849        1.516098
BFGS:   13 17:43:54     -295.320293        1.524923
BFGS:   14 17:43:54     -295.330311        1.533816
BFGS:   15 17:43:54     -295.369808        1.544525
BFGS:   16 17:43:54     -295.437770        1.542026
BFGS:   17 17:43:54     -295.445436        1.532389
BFGS:   18 17:43:54     -295.476612        1.515010
BFGS:   19 17:43:54     -295.496922        1.492762
BFGS:   20 17:43:54     -295.544735        1.420002
      Step     Time          Energy          fmax
BFGS:    0 17:43:54     -295.104199   706345.187500
BFGS:    1 17:43:54     -294.266822        2.701023
BFGS:    2 17:43:54     -294.401497        2.378464
BFGS:    3 17:43:55     -294.758279        1.935462
BFGS:    4 17:43:55     -294.804294        1.945810
BFGS:    5 17:43:55     -294.825013        1.908557
BFGS:    6 17:43:55     -294.884728        1.764285
BFGS:    7 17:43:55     -294.895416        1.733034
BFGS:    8 17:43:55     -294.903009        1.730414
BFGS:    9 17:43:55     -294.908173        1.766185
BFGS:   10 17:43:55     -294.912359        1.816181
BFGS:   11 17:43:55     -294.913218        1.826615
BFGS:   12 17:43:55     -294.913594        1.822239
BFGS:   13 17:43:55     -294.914088        1.808221
BFGS:   14 17:43:55     -294.914453        1.793344
BFGS:   15 17:43:56     -294.914668        1.786025
BFGS:   16 17:43:56     -294.914841        1.785206
BFGS:   17 17:43:56     -294.915186        1.789618
BFGS:   18 17:43:56     -294.915865        1.803520
BFGS:   19 17:43:56     -294.917061        1.831234
BFGS:   20 17:43:56     -294.918791        1.868090
      Step     Time          Energy          fmax
BFGS:    0 17:43:56     -295.102137  1171656.875000
BFGS:    1 17:43:56     -294.663760        1.808903
BFGS:    2 17:43:56     -294.778408        1.766687
BFGS:    3 17:43:56     -294.956182        2.439359
BFGS:    4 17:43:56     -295.039720        1.794995
BFGS:    5 17:43:56     -295.056138        1.798905
BFGS:    6 17:43:57     -295.082887        1.809168
BFGS:    7 17:43:57     -295.094200        1.812119
BFGS:    8 17:43:57     -295.102300        1.808043
BFGS:    9 17:43:57     -295.106952        1.801377
BFGS:   10 17:43:57     -295.113693        1.791198
BFGS:   11 17:43:57     -295.117825        1.787871
BFGS:   12 17:43:57     -295.119191        1.790263
BFGS:   13 17:43:57     -295.119409        1.792550
BFGS:   14 17:43:57     -295.119648        1.795721
BFGS:   15 17:43:57     -295.119933        1.799629
BFGS:   16 17:43:57     -295.120223        1.803062
BFGS:   17 17:43:58     -295.120476        1.804915
BFGS:   18 17:43:58     -295.120814        1.806104
BFGS:   19 17:43:58     -295.121448        1.807598
BFGS:   20 17:43:58     -295.122657        1.810387
      Step     Time          Energy          fmax
BFGS:    0 17:43:58     -295.363134  1437181.000000
BFGS:    1 17:43:58     -295.098812        1.343777
BFGS:    2 17:43:58     -295.166079        1.346882
BFGS:    3 17:43:58     -295.354203        1.510849
BFGS:    4 17:43:58     -295.379043        1.417932
BFGS:    5 17:43:58     -295.390095        1.426218
BFGS:    6 17:43:58     -295.413878        1.466153
BFGS:    7 17:43:58     -295.418566        1.466560
BFGS:    8 17:43:59     -295.470540        1.436633
BFGS:    9 17:43:59     -295.496913        1.405080
BFGS:   10 17:43:59     -295.532294        1.369148
BFGS:   11 17:43:59     -295.561433        1.375799
BFGS:   12 17:43:59     -295.606477        1.432453
BFGS:   13 17:43:59     -295.627622        1.493371
BFGS:   14 17:43:59     -295.634763        1.531990
BFGS:   15 17:43:59     -295.637785        1.546794
BFGS:   16 17:43:59     -295.640918        1.538152
BFGS:   17 17:43:59     -295.648597        1.514980
BFGS:   18 17:43:59     -295.649660        1.515946
BFGS:   19 17:44:00     -295.650279        1.519126
BFGS:   20 17:44:00     -295.650686        1.519780
      Step     Time          Energy          fmax
BFGS:    0 17:44:00     -295.542244  1227404.000000
BFGS:    1 17:44:00     -295.077731        1.389152
BFGS:    2 17:44:00     -295.130716        1.354463
BFGS:    3 17:44:00     -295.295607        1.262509
BFGS:    4 17:44:00     -295.306801        1.260876
BFGS:    5 17:44:00     -295.314199        1.270847
BFGS:    6 17:44:00     -295.327215        1.301172
BFGS:    7 17:44:00     -295.331649        1.311765
BFGS:    8 17:44:00     -295.341092        1.328662
BFGS:    9 17:44:00     -295.351733        1.339615
BFGS:   10 17:44:01     -295.360479        1.332274
BFGS:   11 17:44:01     -295.365125        1.314415
BFGS:   12 17:44:01     -295.366238        1.307635
BFGS:   13 17:44:01     -295.367574        1.298613
BFGS:   14 17:44:01     -295.368754        1.288063
BFGS:   15 17:44:01     -295.369362        1.279643
BFGS:   16 17:44:01     -295.369617        1.273667
BFGS:   17 17:44:01     -295.369845        1.265826
BFGS:   18 17:44:01     -295.370154        1.252696
BFGS:   19 17:44:01     -295.370437        1.239334
BFGS:   20 17:44:01     -295.370651        1.232063

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 17:44:02     -303.403131        1.518271
BFGS:    1 17:44:02     -303.511714        1.340418
BFGS:    2 17:44:02     -303.808551        0.574924
BFGS:    3 17:44:02     -303.837070        0.595770
BFGS:    4 17:44:02     -303.863448        0.433318
BFGS:    5 17:44:02     -303.885334        0.403295
BFGS:    6 17:44:02     -303.899384        0.269549
BFGS:    7 17:44:02     -303.906140        0.266165
BFGS:    8 17:44:02     -303.910638        0.241089
BFGS:    9 17:44:02     -303.914840        0.154356
BFGS:   10 17:44:02     -303.918183        0.182553
BFGS:   11 17:44:03     -303.921224        0.172298
BFGS:   12 17:44:03     -303.923601        0.157851
BFGS:   13 17:44:03     -303.925410        0.137939
BFGS:   14 17:44:03     -303.927247        0.136096
BFGS:   15 17:44:03     -303.929099        0.146406
BFGS:   16 17:44:03     -303.930697        0.132173
BFGS:   17 17:44:03     -303.932245        0.146116
BFGS:   18 17:44:03     -303.934499        0.181533
BFGS:   19 17:44:03     -303.937604        0.211321
BFGS:   20 17:44:03     -303.941612        0.264791
BFGS:   21 17:44:03     -303.947095        0.328532
BFGS:   22 17:44:03     -303.954452        0.358403
BFGS:   23 17:44:04     -303.965358        0.348157
BFGS:   24 17:44:04     -303.980230        0.419491
BFGS:   25 17:44:04     -303.998461        0.668771
BFGS:   26 17:44:04     -304.016798        0.686609
BFGS:   27 17:44:04     -304.047801        0.584236
BFGS:   28 17:44:04     -304.075370        0.484014
BFGS:   29 17:44:04     -304.135668        0.902295
BFGS:   30 17:44:04     -304.196929        1.199318
BFGS:   31 17:44:04     -304.249795        1.327513
BFGS:   32 17:44:04     -304.297931        1.019070
BFGS:   33 17:44:04     -304.340797        0.640561
BFGS:   34 17:44:04     -304.381352        0.390125
BFGS:   35 17:44:05     -304.407896        0.294105
BFGS:   36 17:44:05     -304.421003        0.309174
BFGS:   37 17:44:05     -304.433406        0.275803
BFGS:   38 17:44:05     -304.439504        0.169873
BFGS:   39 17:44:05     -304.443433        0.151760
BFGS:   40 17:44:05     -304.447283        0.168486
BFGS:   41 17:44:05     -304.450004        0.164530
BFGS:   42 17:44:05     -304.452088        0.128556
BFGS:   43 17:44:05     -304.453292        0.078187
BFGS:   44 17:44:05     -304.453867        0.045780
      Step     Time          Energy          fmax
BFGS:    0 17:44:06     -304.091120        1.779234
BFGS:    1 17:44:06     -304.183764        1.572454
BFGS:    2 17:44:06     -304.418305        0.595469
BFGS:    3 17:44:06     -304.430035        0.386134
BFGS:    4 17:44:06     -304.442373        0.178334
BFGS:    5 17:44:06     -304.445929        0.131188
BFGS:    6 17:44:06     -304.448361        0.160354
BFGS:    7 17:44:06     -304.449976        0.148965
BFGS:    8 17:44:06     -304.451601        0.113362
BFGS:    9 17:44:06     -304.453144        0.115571
BFGS:   10 17:44:06     -304.454380        0.084065
BFGS:   11 17:44:06     -304.455027        0.072373
BFGS:   12 17:44:07     -304.455384        0.050932
BFGS:   13 17:44:07     -304.455624        0.036333
      Step     Time          Energy          fmax
BFGS:    0 17:44:07     -303.269461        3.395837
BFGS:    1 17:44:07     -303.542397        1.324093
BFGS:    2 17:44:07     -303.678368        0.978809
BFGS:    3 17:44:07     -303.741060        0.839100
BFGS:    4 17:44:07     -303.785367        0.839353
BFGS:    5 17:44:07     -303.817070        0.561175
BFGS:    6 17:44:07     -303.838934        0.477409
BFGS:    7 17:44:07     -303.852095        0.480981
BFGS:    8 17:44:08     -303.868151        0.630489
BFGS:    9 17:44:08     -303.902025        1.002195
BFGS:   10 17:44:08     -303.915809        1.413240
BFGS:   11 17:44:08     -303.974785        1.092393
BFGS:   12 17:44:08     -304.024699        0.988357
BFGS:   13 17:44:08     -304.141560        0.924866
BFGS:   14 17:44:08     -304.183856        0.800426
BFGS:   15 17:44:08     -304.215694        0.801154
BFGS:   16 17:44:08     -304.319498        0.823118
BFGS:   17 17:44:08     -304.404785        0.942566
BFGS:   18 17:44:08     -304.468860        1.227540
BFGS:   19 17:44:09     -304.562070        1.205745
BFGS:   20 17:44:09     -304.609992        1.027724
BFGS:   21 17:44:09     -304.641589        0.568940
BFGS:   22 17:44:09     -304.654759        0.422074
BFGS:   23 17:44:09     -304.669846        0.260409
BFGS:   24 17:44:09     -304.674969        0.269404
BFGS:   25 17:44:09     -304.680970        0.299716
BFGS:   26 17:44:09     -304.685630        0.215561
BFGS:   27 17:44:09     -304.687850        0.115338
BFGS:   28 17:44:09     -304.689000        0.117370
BFGS:   29 17:44:09     -304.689868        0.092470
BFGS:   30 17:44:09     -304.690493        0.062852
BFGS:   31 17:44:10     -304.690998        0.047582
      Step     Time          Energy          fmax
BFGS:    0 17:44:10     -303.447290        3.228225
BFGS:    1 17:44:10     -303.651317        1.930616
BFGS:    2 17:44:10     -303.836416        0.804825
BFGS:    3 17:44:10     -303.900255        0.552376
BFGS:    4 17:44:10     -303.926724        0.405266
BFGS:    5 17:44:10     -303.940117        0.266825
BFGS:    6 17:44:10     -303.950197        0.166107
BFGS:    7 17:44:10     -303.954980        0.105596
BFGS:    8 17:44:10     -303.956967        0.099288
BFGS:    9 17:44:11     -303.958345        0.117411
BFGS:   10 17:44:11     -303.959987        0.109828
BFGS:   11 17:44:11     -303.961106        0.104305
BFGS:   12 17:44:11     -303.962357        0.091488
BFGS:   13 17:44:11     -303.963215        0.059360
BFGS:   14 17:44:11     -303.963630        0.036673
      Step     Time          Energy          fmax
BFGS:    0 17:44:11     -303.707880        1.492029
BFGS:    1 17:44:11     -303.764394        1.228994
BFGS:    2 17:44:11     -303.910753        0.460017
BFGS:    3 17:44:11     -303.924646        0.404817
BFGS:    4 17:44:11     -303.949976        0.211699
BFGS:    5 17:44:12     -303.955348        0.171844
BFGS:    6 17:44:12     -303.958764        0.135317
BFGS:    7 17:44:12     -303.960110        0.081675
BFGS:    8 17:44:12     -303.960999        0.077095
BFGS:    9 17:44:12     -303.961866        0.082379
BFGS:   10 17:44:12     -303.962812        0.093665
BFGS:   11 17:44:12     -303.963690        0.095472
BFGS:   12 17:44:12     -303.964167        0.058364
BFGS:   13 17:44:12     -303.964341        0.024634
      Step     Time          Energy          fmax
BFGS:    0 17:44:12     -303.628737        1.582612
BFGS:    1 17:44:13     -303.705089        1.357397
BFGS:    2 17:44:13     -303.915164        0.494543
BFGS:    3 17:44:13     -303.930407        0.295455
BFGS:    4 17:44:13     -303.942468        0.168984
BFGS:    5 17:44:13     -303.948193        0.144881
BFGS:    6 17:44:13     -303.952972        0.152153
BFGS:    7 17:44:13     -303.956676        0.130266
BFGS:    8 17:44:13     -303.958837        0.096905
BFGS:    9 17:44:13     -303.960023        0.104972
BFGS:   10 17:44:13     -303.961236        0.088028
BFGS:   11 17:44:13     -303.962337        0.087737
BFGS:   12 17:44:13     -303.963193        0.067009
BFGS:   13 17:44:14     -303.963641        0.037115
      Step     Time          Energy          fmax
BFGS:    0 17:44:14     -302.760132        3.809636
BFGS:    1 17:44:14     -303.067841        2.050122
BFGS:    2 17:44:14     -303.295326        0.858897
BFGS:    3 17:44:14     -303.380979        0.598802
BFGS:    4 17:44:14     -303.426898        0.578925
BFGS:    5 17:44:14     -303.452912        0.484821
BFGS:    6 17:44:14     -303.469345        0.336432
BFGS:    7 17:44:14     -303.479753        0.297808
BFGS:    8 17:44:14     -303.490967        0.355979
BFGS:    9 17:44:14     -303.500370        0.391372
BFGS:   10 17:44:15     -303.510214        0.395541
BFGS:   11 17:44:15     -303.521707        0.362390
BFGS:   12 17:44:15     -303.534571        0.490512
BFGS:   13 17:44:15     -303.549229        0.656114
BFGS:   14 17:44:15     -303.584423        0.843080
BFGS:   15 17:44:15     -303.620585        0.750565
BFGS:   16 17:44:15     -303.666723        0.748138
BFGS:   17 17:44:15     -303.703550        0.582395
BFGS:   18 17:44:15     -303.722945        0.526139
BFGS:   19 17:44:15     -303.767161        0.748320
BFGS:   20 17:44:15     -303.822202        0.886351
BFGS:   21 17:44:16     -303.867704        0.800922
BFGS:   22 17:44:16     -303.909814        0.437013
BFGS:   23 17:44:16     -303.929160        0.358531
BFGS:   24 17:44:16     -303.939344        0.261819
BFGS:   25 17:44:16     -303.947593        0.187536
BFGS:   26 17:44:16     -303.955730        0.129246
BFGS:   27 17:44:16     -303.958159        0.127303
BFGS:   28 17:44:16     -303.959741        0.129781
BFGS:   29 17:44:16     -303.961079        0.108524
BFGS:   30 17:44:16     -303.962219        0.062292
BFGS:   31 17:44:16     -303.962886        0.041068
      Step     Time          Energy          fmax
BFGS:    0 17:44:17     -303.381849        2.205781
BFGS:    1 17:44:17     -303.542463        1.625922
BFGS:    2 17:44:17     -303.859283        0.543984
BFGS:    3 17:44:17     -303.899602        0.441157
BFGS:    4 17:44:17     -303.914886        0.391794
BFGS:    5 17:44:17     -303.933958        0.282727
BFGS:    6 17:44:17     -303.941799        0.211092
BFGS:    7 17:44:17     -303.946528        0.181000
BFGS:    8 17:44:17     -303.949687        0.221920
BFGS:    9 17:44:17     -303.953603        0.232159
BFGS:   10 17:44:17     -303.957631        0.184732
BFGS:   11 17:44:18     -303.960379        0.094074
BFGS:   12 17:44:18     -303.961674        0.078449
BFGS:   13 17:44:18     -303.962476        0.077933
BFGS:   14 17:44:18     -303.963267        0.071243
BFGS:   15 17:44:18     -303.963988        0.052263
BFGS:   16 17:44:18     -303.964598        0.037274
      Step     Time          Energy          fmax
BFGS:    0 17:44:18     -303.063441        2.581837
BFGS:    1 17:44:18     -303.338081        1.725215
BFGS:    2 17:44:18     -303.734621        0.678237
BFGS:    3 17:44:18     -303.827201        0.719917
BFGS:    4 17:44:19     -303.867806        0.624898
BFGS:    5 17:44:19     -303.900099        0.512120
BFGS:    6 17:44:19     -303.922285        0.358904
BFGS:    7 17:44:19     -303.934086        0.220733
BFGS:    8 17:44:19     -303.940157        0.180667
BFGS:    9 17:44:19     -303.945964        0.204206
BFGS:   10 17:44:19     -303.952848        0.194985
BFGS:   11 17:44:19     -303.957304        0.132591
BFGS:   12 17:44:19     -303.959428        0.105272
BFGS:   13 17:44:19     -303.960622        0.097852
BFGS:   14 17:44:19     -303.961682        0.089106
BFGS:   15 17:44:19     -303.962791        0.074156
BFGS:   16 17:44:20     -303.963798        0.058445
BFGS:   17 17:44:20     -303.964478        0.062507
BFGS:   18 17:44:20     -303.964853        0.050101
BFGS:   19 17:44:20     -303.965036        0.036429
      Step     Time          Energy          fmax
BFGS:    0 17:44:20     -303.226141        2.139997
BFGS:    1 17:44:20     -303.448426        1.598245
BFGS:    2 17:44:20     -303.808939        0.528464
BFGS:    3 17:44:20     -303.864925        0.559592
BFGS:    4 17:44:20     -303.887591        0.533785
BFGS:    5 17:44:20     -303.920876        0.430723
BFGS:    6 17:44:21     -303.938284        0.302402
BFGS:    7 17:44:21     -303.947420        0.189720
BFGS:    8 17:44:21     -303.951847        0.182290
BFGS:    9 17:44:21     -303.955587        0.146695
BFGS:   10 17:44:21     -303.959421        0.150165
BFGS:   11 17:44:21     -303.962104        0.114417
BFGS:   12 17:44:21     -303.963185        0.066662
BFGS:   13 17:44:21     -303.963637        0.050577
BFGS:   14 17:44:21     -303.964083        0.048926
      Step     Time          Energy          fmax
BFGS:    0 17:44:21     -303.154603        2.877800
BFGS:    1 17:44:21     -303.411931        1.907305
BFGS:    2 17:44:22     -303.749352        0.728904
BFGS:    3 17:44:22     -303.824928        0.569466
BFGS:    4 17:44:22     -303.857296        0.553418
BFGS:    5 17:44:22     -303.890812        0.478684
BFGS:    6 17:44:22     -303.914571        0.368730
BFGS:    7 17:44:22     -303.926986        0.252078
BFGS:    8 17:44:22     -303.935264        0.274132
BFGS:    9 17:44:22     -303.944856        0.242656
BFGS:   10 17:44:22     -303.953482        0.248531
BFGS:   11 17:44:22     -303.958599        0.184885
BFGS:   12 17:44:22     -303.960696        0.105265
BFGS:   13 17:44:22     -303.961472        0.066753
BFGS:   14 17:44:23     -303.962202        0.060481
BFGS:   15 17:44:23     -303.963058        0.075542
BFGS:   16 17:44:23     -303.963717        0.072692
BFGS:   17 17:44:23     -303.964097        0.049736
/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 17:44:51     -302.585901        3.579593
BFGS:    1 17:44:51     -302.785300        3.052088
BFGS:    2 17:44:52     -303.313005        8.080640
BFGS:    3 17:44:53     -303.371454        1.889380
BFGS:    4 17:44:54     -303.541871        1.557382
BFGS:    5 17:44:54     -303.673452        1.058228
BFGS:    6 17:44:55     -303.716258        0.982965
BFGS:    7 17:44:56     -303.739199        0.786402
BFGS:    8 17:44:57     -303.757107        0.741724
BFGS:    9 17:44:58     -303.780566        0.450110
BFGS:   10 17:44:58     -303.788981        0.389550
BFGS:   11 17:44:59     -303.793979        0.431301
BFGS:   12 17:45:00     -303.796916        0.400342
BFGS:   13 17:45:01     -303.798110        0.385896
BFGS:   14 17:45:01     -303.797779        0.327694
BFGS:   15 17:45:02     -303.796980        0.291063
BFGS:   16 17:45:03     -303.797622        0.355639
BFGS:   17 17:45:03     -303.799744        0.405216
BFGS:   18 17:45:04     -303.802579        0.428226
BFGS:   19 17:45:05     -303.807255        0.422690
BFGS:   20 17:45:06     -303.815171        0.574401
BFGS:   21 17:45:07     -303.822834        0.815539
BFGS:   22 17:45:07     -303.826094        0.708286
BFGS:   23 17:45:08     -303.827447        0.379935
BFGS:   24 17:45:09     -303.828976        0.387593
BFGS:   25 17:45:10     -303.830671        0.421865
BFGS:   26 17:45:10     -303.830897        0.576151
BFGS:   27 17:45:11     -303.828286        0.493907
BFGS:   28 17:45:12     -303.825973        0.354765
BFGS:   29 17:45:13     -303.828066        0.372889
BFGS:   30 17:45:14     -303.832882        0.406035

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_3503/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")
../../_images/026d9d0c6df3276ebd821661284a30bec4940d5ae2cd8babf8be48fe1de9a842.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")