Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Added ase Nudged Elastic Band in the NewtonNet recipe #2176

Open
wants to merge 469 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 156 commits
Commits
Show all changes
469 commits
Select commit Hold shift + click to select a range
027e759
pre-commit auto-fixes
pre-commit-ci[bot] Jun 21, 2024
0840c8c
Auto stash before merge of "neb_nn" and "origin/neb_nn"
kumaranu Jun 21, 2024
c1427d8
Removed unused code from test_run_neb
kumaranu Jun 21, 2024
1646d42
Merge branch 'neb_nn' of https://github.com/kumaranu/quacc into neb_nn
kumaranu Jun 21, 2024
bfc9ced
pre-commit auto-fixes
pre-commit-ci[bot] Jun 21, 2024
716e628
Auto stash before merge of "neb_nn" and "origin/neb_nn"
kumaranu Jun 21, 2024
a9d5ff2
Merge branch 'neb_nn' of https://github.com/kumaranu/quacc into neb_nn
kumaranu Jun 21, 2024
30d11dc
Merge branch 'neb_nn' of https://github.com/kumaranu/quacc into neb_nn
kumaranu Jun 21, 2024
33b8d4e
pre-commit auto-fixes
pre-commit-ci[bot] Jun 21, 2024
f615130
Added docstrings to summarize_neb_run and summarize_neb_run2
kumaranu Jun 21, 2024
40c29ca
Merge branch 'neb_nn' of https://github.com/kumaranu/quacc into neb_nn
kumaranu Jun 21, 2024
87a08ce
Got rid of random molecule and replaced it with C60.
kumaranu Jun 22, 2024
dc10ecc
pre-commit auto-fixes
pre-commit-ci[bot] Jun 22, 2024
4fea200
Added seed to test_ase for geodesic.
kumaranu Jun 22, 2024
6c6583b
Merge branch 'neb_nn' of https://github.com/kumaranu/quacc into neb_nn
kumaranu Jun 22, 2024
f18ea76
pre-commit auto-fixes
pre-commit-ci[bot] Jun 22, 2024
f06ac43
Merge branch 'main' into neb_nn
Andrew-S-Rosen Jun 26, 2024
28ced33
pre-commit auto-fixes
pre-commit-ci[bot] Jun 26, 2024
b13b4aa
Added print statements for newtonnet model and config.
kumaranu Jun 26, 2024
953ec3a
pre-commit auto-fixes
pre-commit-ci[bot] Jun 26, 2024
b3c9c1a
Auto stash before merge of "neb_nn" and "origin/neb_nn"
kumaranu Jun 26, 2024
04e92dc
pre-commit auto-fixes
pre-commit-ci[bot] Jun 26, 2024
411ac3c
Trying noqa to get rid of pre-commit warning for random seed.
kumaranu Jun 27, 2024
2acf47f
Moved optimizer import.
kumaranu Jun 27, 2024
695febf
Merge branch 'neb_nn' of https://github.com/kumaranu/quacc into neb_nn
kumaranu Jun 27, 2024
f44380d
Merge branch 'main' into neb_nn
kumaranu Jun 27, 2024
dc124cc
Auto stash before merge of "neb_nn" and "origin/neb_nn"
kumaranu Jun 27, 2024
d6f8b5f
Merge branch 'neb_nn' of https://github.com/kumaranu/quacc into neb_nn
kumaranu Jun 27, 2024
62ab50a
pre-commit auto-fixes
pre-commit-ci[bot] Jun 27, 2024
fe98bce
Auto stash before merge of "neb_nn" and "origin/neb_nn"
kumaranu Jun 27, 2024
92b10d3
Merge branch 'neb_nn' of https://github.com/kumaranu/quacc into neb_nn
kumaranu Jun 27, 2024
9e76d64
Auto stash before merge of "neb_nn" and "origin/neb_nn"
kumaranu Jun 27, 2024
1cadf16
pre-commit auto-fixes
pre-commit-ci[bot] Jun 27, 2024
f9c854b
Just trying to run the tests again.
kumaranu Jun 27, 2024
ad207b8
Added strip decorators to the ts_job calls inside neb_ts_job and geod…
kumaranu Jun 27, 2024
109c1d8
Added hess_method=None to avoid doing hessian calculations all the time.
kumaranu Jun 27, 2024
4143de1
Merge branch 'main' into neb_nn
kumaranu Jun 27, 2024
c79b2a1
Added opt_kwargs to the ts_job calls to allow hessian=True sella calc…
kumaranu Jun 28, 2024
2774be2
Merge branch 'neb_nn' of https://github.com/kumaranu/quacc into neb_nn
kumaranu Jun 28, 2024
c85d539
pre-commit auto-fixes
pre-commit-ci[bot] Jun 28, 2024
70b43d3
Made tests more robust for newtonnet.
kumaranu Jun 28, 2024
bf0a280
Correct calc_kwargs and opt_kwargs to make sure hessians are calculat…
kumaranu Jun 28, 2024
c24cb76
Modified add hessian and std function to allow calc_kwargs.
kumaranu Jun 28, 2024
adc8396
Merge branch 'neb_nn' of https://github.com/kumaranu/quacc into neb_nn
kumaranu Jun 28, 2024
a1c3c9f
pre-commit auto-fixes
pre-commit-ci[bot] Jun 28, 2024
09c9a4d
Changed ts_job call according to the requirements.
kumaranu Jun 28, 2024
dcd284a
Merge branch 'neb_nn' of https://github.com/kumaranu/quacc into neb_nn
kumaranu Jun 28, 2024
01105ab
just corrected the newtonnet tests.
kumaranu Jun 28, 2024
0a0cff4
pre-commit auto-fixes
pre-commit-ci[bot] Jun 28, 2024
5400196
Changed opt_kwargs to ts_job_kwargs
kumaranu Jun 29, 2024
9575103
Updated newtonnet tests for ts_job_kwargs.
kumaranu Jun 29, 2024
9697a29
Merge branch 'neb_nn' of https://github.com/kumaranu/quacc into neb_nn
kumaranu Jun 29, 2024
8c6b015
Merge branch 'neb_nn' of https://github.com/kumaranu/quacc into neb_nn
kumaranu Jun 29, 2024
160fa21
Merge branch 'main' into neb_nn
Andrew-S-Rosen Jul 1, 2024
ca46eae
Merge remote-tracking branch 'origin/main' into neb_nn
kumaranu Jul 1, 2024
42d0da2
Merge branch 'Quantum-Accelerators:main' into neb_nn
kumaranu Jul 1, 2024
a7cdef2
Merge branch 'neb_nn' of https://github.com/kumaranu/quacc into neb_nn
kumaranu Jul 1, 2024
91d556a
Auto stash before merge of "neb_nn" and "origin/neb_nn"
kumaranu Jul 2, 2024
c025d0d
Added additional fields to neb_summary.
kumaranu Jul 2, 2024
03e23a2
edited tests too. May be will change them later.
kumaranu Jul 2, 2024
045facb
pre-commit auto-fixes
pre-commit-ci[bot] Jul 2, 2024
191e3a8
Merge branch 'neb_nn' of https://github.com/kumaranu/quacc into neb_nn
kumaranu Jul 2, 2024
9ff5d75
added geodesic_job the schemas are not added yet.
kumaranu Jul 2, 2024
b8d3f6a
added test for geodesic job
kumaranu Jul 2, 2024
d19ce44
pre-commit auto-fixes
pre-commit-ci[bot] Jul 2, 2024
fe3f2cf
Merge branch 'main' into neb_nn
kumaranu Jul 2, 2024
4254141
modified the schemas for neb_job to only contain n_images of the traj…
kumaranu Jul 2, 2024
ea6392f
Test updated for neb job to check for the length for neb_job.
kumaranu Jul 2, 2024
90943e0
Merge branch 'neb_nn' of https://github.com/kumaranu/quacc into neb_nn
kumaranu Jul 2, 2024
fa830b1
pre-commit auto-fixes
pre-commit-ci[bot] Jul 2, 2024
363bd0c
Corrected the tests.
kumaranu Jul 3, 2024
ec3bfd8
Merge branch 'neb_nn' of https://github.com/kumaranu/quacc into neb_nn
kumaranu Jul 3, 2024
20c3443
Merge branch 'main' into neb_nn
kumaranu Jul 3, 2024
9bb1c39
Corrected TSSchema and OptSchema in ts.py.
kumaranu Jul 3, 2024
2f5b531
Merge branch 'neb_nn' of https://github.com/kumaranu/quacc into neb_nn
kumaranu Jul 3, 2024
f2ef51b
corrected OptSchema imports.
kumaranu Jul 3, 2024
f8b7438
Correct run_neb test.
kumaranu Jul 3, 2024
f88a6ba
pre-commit auto-fixes
pre-commit-ci[bot] Jul 3, 2024
4253d94
Edited runners/test_ase.py to pass the tests.
kumaranu Jul 3, 2024
df6c245
Merge branch 'neb_nn' of https://github.com/kumaranu/quacc into neb_nn
kumaranu Jul 3, 2024
a0245c5
Added check environment to look for environment on quacc GitHub.
kumaranu Jul 3, 2024
273ba6b
Changed seed setting from session to module.
kumaranu Jul 3, 2024
741c780
Changed number according to GitHub tests on github.com.
kumaranu Jul 3, 2024
54312a7
Corrected numbers in the test_run_neb.
kumaranu Jul 3, 2024
994dd46
Corrected the value in pytest for run_neb.
kumaranu Jul 3, 2024
93e1356
Merge branch 'main' into neb_nn
kumaranu Jul 11, 2024
6533f83
Changed the scope of the random seed to module from session. It was s…
kumaranu Jul 11, 2024
d709cec
Added geodesic_path.xyz file to directly load the gedesic path for th…
kumaranu Jul 11, 2024
4c1b3a8
Removed unnecessary path of the code after replacing the geodesic pat…
kumaranu Jul 11, 2024
72b0134
pre-commit auto-fixes
pre-commit-ci[bot] Jul 11, 2024
1838b1c
Added n returns to neb test.
kumaranu Jul 12, 2024
13cdff4
Got rid of summar_neb_run2.
kumaranu Jul 12, 2024
59fc5e3
Added n_iter_return = -1 by default inside neb_job.
kumaranu Jul 12, 2024
b1ea1d2
Merge branch 'neb_nn' of https://github.com/kumaranu/quacc into neb_nn
kumaranu Jul 12, 2024
b831ab8
pre-commit auto-fixes
pre-commit-ci[bot] Jul 12, 2024
35a13ae
Removed docstring from a test file.
kumaranu Jul 12, 2024
502253b
Merge branch 'neb_nn' of https://github.com/kumaranu/quacc into neb_nn
kumaranu Jul 12, 2024
44d365a
Removed geodesic from tests/requirements.txt.
kumaranu Jul 12, 2024
7a8924b
Corrected the relative geodesic path for geodesic_path.xyz file in th…
kumaranu Jul 12, 2024
b870a7d
Added geodesic as a requirement inside the github actions job require…
kumaranu Jul 12, 2024
59ace9c
pre-commit auto-fixes
pre-commit-ci[bot] Jul 12, 2024
160b232
Added trajectory import.
kumaranu Jul 12, 2024
acce40e
Merge branch 'neb_nn' of https://github.com/kumaranu/quacc into neb_nn
kumaranu Jul 12, 2024
c0c9655
pre-commit auto-fixes
pre-commit-ci[bot] Jul 12, 2024
8ae1bde
Reduced the relative threshold for error check for neb.
kumaranu Jul 12, 2024
18fd593
Merge branch 'neb_nn' of https://github.com/kumaranu/quacc into neb_nn
kumaranu Jul 12, 2024
49da3eb
Changed a few numbers here to match the tests on GitHub.
kumaranu Jul 12, 2024
3120fae
swapped neb_kwargs with run_kwargs. Suggested by Andrew.
kumaranu Jul 12, 2024
dae5796
Added a dynamics object in the returned type hint.
kumaranu Jul 12, 2024
d2d8ffd
Update some loop related to periodic systems.
kumaranu Jul 12, 2024
9a6c9ca
Removed a stray comment.
kumaranu Jul 12, 2024
5ce7cd8
Cleaned up the traj file related things from run_neb.
kumaranu Jul 12, 2024
c38b6c8
pre-commit auto-fixes
pre-commit-ci[bot] Jul 12, 2024
11cd0b9
Corrected a docstring.
kumaranu Jul 12, 2024
905c906
Merge branch 'neb_nn' of https://github.com/kumaranu/quacc into neb_nn
kumaranu Jul 12, 2024
cba79d3
Added sweep_cutoff_size and also change the "None" to "auto" in the g…
kumaranu Jul 12, 2024
01bfb17
Corrected the geodesic test to incorporate new tol args.
kumaranu Jul 12, 2024
979d193
Changed the geodesic test to directly put the variables inside the fu…
kumaranu Jul 12, 2024
0ff073c
Added tests for linear and idpp interpolation tests. Also edited the …
kumaranu Jul 12, 2024
d3eab91
Corrected the schema neb function to deal with the interpolate_flags …
kumaranu Jul 12, 2024
dc7c80b
Added interpolation methods from ase like linear and idpp in addition…
kumaranu Jul 12, 2024
bb58d2e
Removed has_geodesic_interpolate condition from neb_job.
kumaranu Jul 12, 2024
99bc8d5
pre-commit auto-fixes
pre-commit-ci[bot] Jul 12, 2024
39494c0
Changed geodesic_interpolate_flags to interpolate_flags inside runner…
kumaranu Jul 12, 2024
3468dcb
Increased the accuracy condition from 1e-2 to 1e-5 for geodesic neb t…
kumaranu Jul 12, 2024
6ba14ef
Merge branch 'neb_nn' of https://github.com/kumaranu/quacc into neb_nn
kumaranu Jul 12, 2024
45c4070
Update test numbers in newtonnet tests.
kumaranu Jul 12, 2024
a12fad8
Corrected neb_ts_job function to have correct arguments getting passe…
kumaranu Jul 12, 2024
dd1c6cb
pre-commit auto-fixes
pre-commit-ci[bot] Jul 12, 2024
51aac67
Not sure why the geodesic numbers are not matching but updated them i…
kumaranu Jul 12, 2024
5990dfc
Merge branch 'neb_nn' of https://github.com/kumaranu/quacc into neb_nn
kumaranu Jul 12, 2024
9c47266
Added paths to kwargs.
kumaranu Jul 12, 2024
da6c3af
Corrected neb_kwargs text in docstrings
kumaranu Jul 12, 2024
32ad251
Completely got rid of links for geodesic kwargs.
kumaranu Jul 12, 2024
6eb3582
Changed calc_kwargs to **calc_kwargs.
kumaranu Jul 12, 2024
bf752c4
Also changed the test calls to use **calc_kwargs instead of calc_kwar…
kumaranu Jul 12, 2024
b2b0466
pre-commit auto-fixes
pre-commit-ci[bot] Jul 12, 2024
d028529
Merge branch 'main' into neb_nn
Andrew-S-Rosen Jul 24, 2024
43d1504
Removed check_env.yml file.
kumaranu Jul 24, 2024
b9c8bd0
Modified _get_hessian to incorporate **calc_kwargs to allow used defi…
kumaranu Jul 24, 2024
2c46a94
pre-commit auto-fixes
pre-commit-ci[bot] Jul 24, 2024
b7cf522
Trying the resolve the issue with opt.traj's path.
kumaranu Jul 24, 2024
299c440
Merge branch 'neb_nn' of https://github.com/kumaranu/quacc into neb_nn
kumaranu Jul 24, 2024
439de1e
Converted geodesic_path to string to have posix_path functions applie…
kumaranu Jul 24, 2024
1bd71bf
pre-commit auto-fixes
pre-commit-ci[bot] Jul 24, 2024
36d933e
Changed the posixpath to string in os.path.dirname(str(os.path.abspat…
kumaranu Jul 24, 2024
314851d
Merge branch 'neb_nn' of https://github.com/kumaranu/quacc into neb_nn
kumaranu Jul 25, 2024
fa02d79
changed the posixpath inside os.path.dirname function.
kumaranu Jul 25, 2024
7db0b1f
pre-commit auto-fixes
pre-commit-ci[bot] Jul 25, 2024
d737a93
Merge branch 'main' into neb_nn
kumaranu Jul 25, 2024
0a40aa8
Trying to convert posixpath to str at: traj.filename = str(zpath(…
kumaranu Jul 25, 2024
81b05ce
Corrected the input with string inside zpath as suggested by Andrew.
kumaranu Jul 25, 2024
7187de3
Undid the changes in the test file for the posixpath to string conver…
kumaranu Jul 25, 2024
04bafa4
Moved custom type hints from ts.py to types.py
kumaranu Jul 25, 2024
2a7645a
pre-commit auto-fixes
pre-commit-ci[bot] Jul 25, 2024
6bea8a7
Imported the type-hints from types.py.
kumaranu Jul 25, 2024
9356e8b
Merge branch 'neb_nn' of https://github.com/kumaranu/quacc into neb_nn
kumaranu Jul 25, 2024
e5c3aee
pre-commit auto-fixes
pre-commit-ci[bot] Jul 25, 2024
c1704a5
Merge branch 'main' into neb_nn
kumaranu Jul 27, 2024
d5b481e
Removed a comment about 5 images in the neb_job function.
kumaranu Jul 27, 2024
5689e2b
Merge branch 'neb_nn' of https://github.com/kumaranu/quacc into neb_nn
kumaranu Jul 27, 2024
a673acd
Changed the key from geodesic_results to initial_images.
kumaranu Jul 27, 2024
afa79da
Again, changed the keys in the neb's returned schema from geodesic_re…
kumaranu Jul 27, 2024
c2605a5
pre-commit auto-fixes
pre-commit-ci[bot] Jul 27, 2024
c2d43f6
Changed a variable's name from i to result to make it more descriptive.
kumaranu Jul 27, 2024
9377a82
Merge branch 'neb_nn' of https://github.com/kumaranu/quacc into neb_nn
kumaranu Jul 27, 2024
f9e4af6
pre-commit auto-fixes
pre-commit-ci[bot] Jul 27, 2024
326f925
Added typehints for geodesic jobs.
kumaranu Jul 27, 2024
6fa67ee
updated ts.py to have geodesic schemas instead of dicts.
kumaranu Jul 27, 2024
b88c40c
Merge branch 'neb_nn' of https://github.com/kumaranu/quacc into neb_nn
kumaranu Jul 27, 2024
4b33856
pre-commit auto-fixes
pre-commit-ci[bot] Jul 27, 2024
58766ee
Removed an unnecessary check.
kumaranu Jul 27, 2024
ec95533
Merge branch 'neb_nn' of https://github.com/kumaranu/quacc into neb_nn
kumaranu Jul 27, 2024
7adf08e
Moved geodesic_path.xyz file to a directory called test_files.
kumaranu Jul 27, 2024
50eaf8b
Updated tests to have correct path to the geodesic_path.xyz file.
kumaranu Jul 27, 2024
e446487
Got rid of tmp_path or unused/empty calc_kwargs from newtonnet's test…
kumaranu Jul 27, 2024
e263622
pre-commit auto-fixes
pre-commit-ci[bot] Jul 27, 2024
60b7aef
Removed neb_ts_job and geodesic_ts_job
kumaranu Jul 27, 2024
93cf42d
Removed tests for neb_ts_job and geodesic_ts_job and the respective i…
kumaranu Jul 27, 2024
003e056
Merge branch 'neb_nn' of https://github.com/kumaranu/quacc into neb_nn
kumaranu Jul 27, 2024
ee28b48
pre-commit auto-fixes
pre-commit-ci[bot] Jul 27, 2024
a069d89
Removed tests for nen_ts_job and geodesic_ts_job.
kumaranu Jul 27, 2024
4c2d20f
Merge branch 'neb_nn' of https://github.com/kumaranu/quacc into neb_nn
kumaranu Jul 27, 2024
24b04cd
Manually edited the recipes list in the docs. Not sure if this was th…
kumaranu Jul 27, 2024
5483d27
Not sure why this test failed. Trying the new value.
kumaranu Jul 27, 2024
79ec33d
Added a test to raise a value error in run_neb function when optimize…
kumaranu Jul 27, 2024
7da2d1d
Modified run_neb to have none as neb_kwargs.
kumaranu Jul 27, 2024
0130aa3
pre-commit auto-fixes
pre-commit-ci[bot] Jul 27, 2024
2ff1bef
Added Callable back in ase.py.
kumaranu Jul 27, 2024
0d79cbf
Merge branch 'neb_nn' of https://github.com/kumaranu/quacc into neb_nn
kumaranu Jul 27, 2024
7b9a9e4
pre-commit auto-fixes
pre-commit-ci[bot] Jul 27, 2024
3c78709
Updated BFGSLineSearch check.
kumaranu Jul 27, 2024
8cab2cc
Merge branch 'neb_nn' of https://github.com/kumaranu/quacc into neb_nn
kumaranu Jul 27, 2024
a41fb04
Removed underscore from geodesic because it is not private.
kumaranu Jul 27, 2024
0665ee6
Removed underscore from geodesic because it is not private.
kumaranu Jul 27, 2024
ad975ab
Removed underscore from geodesic because it is not private.
kumaranu Jul 27, 2024
e36c3ea
Changed tolerance variable names to redestribute_tol and smoother_tol.
kumaranu Jul 27, 2024
5a8b6f0
Changed tolerance variable names to redestribute_tol and smoother_tol.
kumaranu Jul 27, 2024
93a93b6
pre-commit auto-fixes
pre-commit-ci[bot] Jul 27, 2024
f6e789b
Changed the default number of n_images in geodesic to 10 instead of 20.
kumaranu Jul 27, 2024
f75f70a
Merge branch 'neb_nn' of https://github.com/kumaranu/quacc into neb_nn
kumaranu Jul 27, 2024
00b0e63
corrected spelling for redistribute.
kumaranu Jul 27, 2024
7994881
Corrected assertion value.
kumaranu Jul 27, 2024
bf05f39
Moved geodesic wrapper function from ts ase to atoms directory. Also …
kumaranu Jul 27, 2024
eac9687
Removed the geodesic tests from test_ase.py and the relevant imports.
kumaranu Jul 27, 2024
d363d5e
test file for the geodesic wrapper.
kumaranu Jul 27, 2024
b47725a
getting rid of the geodesic wrapper from ase.
kumaranu Jul 27, 2024
25e79a0
pre-commit auto-fixes
pre-commit-ci[bot] Jul 27, 2024
d545f8b
Changed summarize_neb_run call.
kumaranu Jul 27, 2024
30a7dc6
Made n_images require argument in summarize_neb_run and n_iter_return…
kumaranu Jul 27, 2024
6023819
Merge branch 'neb_nn' of https://github.com/kumaranu/quacc into neb_nn
kumaranu Jul 27, 2024
1a4b1a1
Updated run_neb test.
kumaranu Jul 27, 2024
dc4cd86
pre-commit auto-fixes
pre-commit-ci[bot] Jul 27, 2024
4e8a05c
Merge branch 'main' into neb_nn
Andrew-S-Rosen Jul 27, 2024
db157db
Update ts.py
Andrew-S-Rosen Jul 27, 2024
19685f1
Merge branch 'main' into neb_nn
kumaranu Jul 29, 2024
c2ef8cb
Removed calculator from the trajectory object in summarize neb run.
kumaranu Jul 29, 2024
f140801
Changed trajectory to atoms_trajectory in summarize_neb_run to avoid …
kumaranu Jul 29, 2024
18a58dc
Merge branch 'neb_nn' of https://github.com/kumaranu/quacc into neb_nn
kumaranu Jul 29, 2024
05862d9
Changed i to result defined for a loop over trajectory_results.
kumaranu Jul 29, 2024
5465aa1
pre-commit auto-fixes
pre-commit-ci[bot] Jul 29, 2024
2c867db
Added typehints and docstrings to the function inside the summarize f…
kumaranu Jul 29, 2024
7c9e819
Merge branch 'neb_nn' of https://github.com/kumaranu/quacc into neb_nn
kumaranu Jul 29, 2024
4d9dcc8
pre-commit auto-fixes
pre-commit-ci[bot] Jul 29, 2024
5d92bfa
edited docstring.
kumaranu Jul 29, 2024
c72b95a
Merge branch 'neb_nn' of https://github.com/kumaranu/quacc into neb_nn
kumaranu Jul 29, 2024
fe00971
pre-commit auto-fixes
pre-commit-ci[bot] Jul 29, 2024
9a43dff
Merge branch 'main' into neb_nn
kumaranu Jul 30, 2024
c5ddcfa
Merge branch 'main' into neb_nn
Andrew-S-Rosen Aug 13, 2024
7128288
Merge branch 'main' into neb_nn
Andrew-S-Rosen Aug 16, 2024
777160d
Merge branch 'main' into neb_nn
Andrew-S-Rosen Aug 22, 2024
68d7ec9
Update ase.py
Andrew-S-Rosen Aug 22, 2024
2ba31ad
Update ase.py
Andrew-S-Rosen Aug 22, 2024
fce697e
Merge branch 'Quantum-Accelerators:main' into neb_nn
kumaranu Aug 29, 2024
e35f912
Removed the directory paths from the log and the json files for the o…
kumaranu Aug 29, 2024
49a21db
pre-commit auto-fixes
pre-commit-ci[bot] Aug 29, 2024
fa3150f
Merge branch 'main' into neb_nn
Andrew-S-Rosen Sep 17, 2024
d65aef9
pre-commit auto-fixes
pre-commit-ci[bot] Sep 17, 2024
7bbff3b
Merge branch 'main' into neb_nn
Andrew-S-Rosen Sep 17, 2024
7c680a9
pre-commit auto-fixes
pre-commit-ci[bot] Sep 17, 2024
0f99a89
Remove unused code block
Andrew-S-Rosen Sep 19, 2024
6e374de
Merge branch 'main' into neb_nn
Andrew-S-Rosen Sep 19, 2024
c67c622
Merge branch 'main' into neb_nn
Andrew-S-Rosen Oct 11, 2024
b722a35
Merge branch 'main' into neb_nn
Andrew-S-Rosen Dec 1, 2024
b453027
Update requirements-newtonnet.txt
Andrew-S-Rosen Dec 1, 2024
bf9d699
Fix tests
Andrew-S-Rosen Dec 1, 2024
aa5d323
Fix the run_neb method
Andrew-S-Rosen Dec 1, 2024
6e8058f
Add a test
Andrew-S-Rosen Dec 1, 2024
6b01611
Fix type hint
Andrew-S-Rosen Dec 1, 2024
833383f
fix
Andrew-S-Rosen Dec 1, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/quacc/__init__.py
kumaranu marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from __future__ import annotations

import logging
import os
from importlib.metadata import version

from ase.atoms import Atoms
Expand Down Expand Up @@ -37,6 +38,9 @@
# Load the settings
SETTINGS = QuaccSettings()

# Ignore ASE config file
os.environ["ASE_CONFIG_PATH"] = ""

# Set logging info
logging.basicConfig(level=logging.DEBUG if SETTINGS.DEBUG else logging.INFO)

Expand Down
249 changes: 246 additions & 3 deletions src/quacc/recipes/newtonnet/ts.py
Andrew-S-Rosen marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,25 @@
from importlib.util import find_spec
from typing import TYPE_CHECKING

import numpy as np
from monty.dev import requires

from quacc import SETTINGS, change_settings, job, strip_decorator
from quacc.recipes.newtonnet.core import _add_stdev_and_hess, freq_job, relax_job
from quacc.runners.ase import Runner
from quacc.schemas.ase import summarize_opt_run
from quacc.runners.ase import Runner, run_neb
from quacc.schemas.ase import summarize_neb_run, summarize_opt_run
from quacc.utils.dicts import recursive_dict_merge

has_geodesic_interpolate = bool(find_spec("geodesic_interpolate"))
has_sella = bool(find_spec("sella"))
has_newtonnet = bool(find_spec("newtonnet"))

if has_sella:
from sella import IRC, Sella
if has_newtonnet:
from newtonnet.utils.ase_interface import MLAseCalculator as NewtonNet

if has_geodesic_interpolate:
from quacc.runners.ase import _geodesic_interpolate_wrapper

if TYPE_CHECKING:
from typing import Any, Literal
Expand Down Expand Up @@ -264,6 +267,246 @@ def quasi_irc_job(
return relax_summary


@job
@requires(
has_newtonnet, "NewtonNet must be installed. Refer to the quacc documentation."
)
@requires(
has_geodesic_interpolate,
"geodesic-interpolate must be installed. Refer to the quacc documentation.",
)
def neb_job(
reactant_atoms: Atoms,
product_atoms: Atoms,
relax_job_kwargs: dict[str, Any] | None = None,
calc_kwargs: dict[str, Any] | None = None,
kumaranu marked this conversation as resolved.
Show resolved Hide resolved
geodesic_interpolate_kwargs: dict[str, Any] | None = None,
neb_kwargs: dict[str, Any] | None = None,
) -> dict:
kumaranu marked this conversation as resolved.
Show resolved Hide resolved
"""
Perform a quasi-IRC job using the given atoms object. The initial IRC job by default
is run with `max_steps: 5`.
kumaranu marked this conversation as resolved.
Show resolved Hide resolved

Parameters
----------
atoms
The atoms object representing the system
direction
The direction of the IRC calculation
kumaranu marked this conversation as resolved.
Show resolved Hide resolved
relax_job_kwargs
Keyword arguments to use for the [quacc.recipes.newtonnet.core.relax_job][]

Returns
-------
A dictionary containing the neb optimization summary.
See the type-hint for the data structure.
"""
kumaranu marked this conversation as resolved.
Show resolved Hide resolved
relax_job_kwargs = relax_job_kwargs or {}
neb_kwargs = neb_kwargs or {}
geodesic_interpolate_kwargs = geodesic_interpolate_kwargs or {}

calc_defaults = {
"model_path": SETTINGS.NEWTONNET_MODEL_PATH,
"settings_path": SETTINGS.NEWTONNET_CONFIG_PATH,
}

geodesic_defaults = {"nimages": 20}

neb_defaults = {"method": "aseneb", "precon": None}
calc_flags = recursive_dict_merge(calc_defaults, calc_kwargs)
geodesic_interpolate_flags = recursive_dict_merge(
geodesic_defaults, geodesic_interpolate_kwargs
)
neb_flags = recursive_dict_merge(neb_defaults, neb_kwargs)

# Define calculator
reactant_atoms.calc = NewtonNet(**calc_flags)
product_atoms.calc = NewtonNet(**calc_flags)

# Run IRC
relax_summary_r = strip_decorator(relax_job)(reactant_atoms, **relax_job_kwargs)
relax_summary_p = strip_decorator(relax_job)(product_atoms, **relax_job_kwargs)
kumaranu marked this conversation as resolved.
Show resolved Hide resolved

images = _geodesic_interpolate_wrapper(
relax_summary_r["atoms"].copy(),
relax_summary_p["atoms"].copy(),
kumaranu marked this conversation as resolved.
Show resolved Hide resolved
**geodesic_interpolate_flags,
)

for image in images:
image.calc = NewtonNet(**calc_flags)

dyn = run_neb(images, neb_kwargs=neb_flags)

return {
"relax_reactant": relax_summary_r,
"relax_product": relax_summary_p,
"geodesic_results": images,
kumaranu marked this conversation as resolved.
Show resolved Hide resolved
"neb_results": summarize_neb_run(dyn),
}


@job
@requires(
has_newtonnet, "NewtonNet must be installed. Refer to the quacc documentation."
)
@requires(
has_geodesic_interpolate,
"geodesic-interpolate must be installed. Refer to the quacc documentation.",
)
def neb_ts_job(
reactant_atoms: Atoms,
product_atoms: Atoms,
relax_job_kwargs: dict[str, Any] | None = None,
calc_kwargs: dict[str, Any] | None = None,
geodesic_interpolate_kwargs: dict[str, Any] | None = None,
neb_kwargs: dict[str, Any] | None = None,
) -> dict:
kumaranu marked this conversation as resolved.
Show resolved Hide resolved
"""
Perform a quasi-IRC job using the given atoms object. The initial IRC job by default
is run with `max_steps: 5`.
kumaranu marked this conversation as resolved.
Show resolved Hide resolved

Parameters
----------
atoms
The atoms object representing the system
direction
The direction of the IRC calculation
kumaranu marked this conversation as resolved.
Show resolved Hide resolved
relax_job_kwargs
Keyword arguments to use for the [quacc.recipes.newtonnet.core.relax_job][]

Returns
-------
A dictionary containing the neb optimization summary.
See the type-hint for the data structure.
kumaranu marked this conversation as resolved.
Show resolved Hide resolved
"""
relax_job_kwargs = relax_job_kwargs or {}
neb_kwargs = neb_kwargs or {}
geodesic_interpolate_kwargs = geodesic_interpolate_kwargs or {}
calc_kwargs = calc_kwargs or {}

calc_defaults = {
"model_path": SETTINGS.NEWTONNET_MODEL_PATH,
"settings_path": SETTINGS.NEWTONNET_CONFIG_PATH,
}

geodesic_defaults = {"nimages": 20}

neb_defaults = {"method": "aseneb", "precon": None}
calc_flags = recursive_dict_merge(calc_defaults, calc_kwargs)
geodesic_interpolate_flags = recursive_dict_merge(
geodesic_defaults, geodesic_interpolate_kwargs
)
neb_flags = recursive_dict_merge(neb_defaults, neb_kwargs)

neb_results = strip_decorator(neb_job)(
reactant_atoms,
product_atoms,
calc_kwargs=calc_flags,
geodesic_interpolate_kwargs=geodesic_interpolate_flags,
neb_kwargs=neb_flags,
relax_job_kwargs=relax_job_kwargs,
)

traj = neb_results["neb_results"]["trajectory"]
traj_results = neb_results["neb_results"]["trajectory_results"]
n_images = len(neb_results["geodesic_results"])

ts_index = np.argmax([i["energy"] for i in traj_results[-(n_images - 1) : -1]]) + 1
kumaranu marked this conversation as resolved.
Show resolved Hide resolved
ts_atoms = traj[-(n_images) + ts_index]

output = ts_job(ts_atoms)
neb_results["ts_results"] = output

return neb_results


@job
@requires(
has_newtonnet, "NewtonNet must be installed. Refer to the quacc documentation."
)
@requires(
has_geodesic_interpolate,
"geodesic-interpolate must be installed. Refer to the quacc documentation.",
)
def geodesic_ts_job(
reactant_atoms: Atoms,
product_atoms: Atoms,
relax_job_kwargs: dict[str, Any] | None = None,
calc_kwargs: dict[str, Any] | None = None,
geodesic_interpolate_kwargs: dict[str, Any] | None = None,
) -> dict:
kumaranu marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a lot of the same code between your three newly added functions. You should consider refactoring them such that you do not introduce large blocks of duplicated code into the codebase.

"""
Perform a transition state search using geodesic interpolation between reactant and product states.

Parameters
----------
reactant_atoms : Atoms
The atoms object representing the reactant state.
product_atoms : Atoms
The atoms object representing the product state.
relax_job_kwargs : dict[str, Any], optional
Keyword arguments to use for the relaxation job.
calc_kwargs : dict[str, Any], optional
Keyword arguments to configure the NewtonNet calculator.
geodesic_interpolate_kwargs : dict[str, Any], optional
Keyword arguments to configure the geodesic interpolation.
kumaranu marked this conversation as resolved.
Show resolved Hide resolved

Returns
-------
dict
A dictionary containing the NEB optimization summary, including:
- 'relax_reactant': Summary of the relaxation job for the reactant.
- 'relax_product': Summary of the relaxation job for the product.
- 'geodesic_results': The interpolated images between reactant and product.
- 'ts_results': The transition state optimization results.
"""
relax_job_kwargs = relax_job_kwargs or {}
geodesic_interpolate_kwargs = geodesic_interpolate_kwargs or {}

calc_defaults = {
"model_path": SETTINGS.NEWTONNET_MODEL_PATH,
"settings_path": SETTINGS.NEWTONNET_CONFIG_PATH,
}

geodesic_defaults = {"nimages": 20}

calc_flags = recursive_dict_merge(calc_defaults, calc_kwargs)
geodesic_interpolate_flags = recursive_dict_merge(
geodesic_defaults, geodesic_interpolate_kwargs
)

# Define calculator
reactant_atoms.calc = NewtonNet(**calc_flags)
product_atoms.calc = NewtonNet(**calc_flags)

# Run IRC
relax_summary_r = strip_decorator(relax_job)(reactant_atoms, **relax_job_kwargs)
relax_summary_p = strip_decorator(relax_job)(product_atoms, **relax_job_kwargs)

images = _geodesic_interpolate_wrapper(
relax_summary_r["atoms"].copy(),
relax_summary_p["atoms"].copy(),
**geodesic_interpolate_flags,
)

potential_energies = []
for image in images:
image.calc = NewtonNet(**calc_flags)
potential_energies.append(image.get_potential_energy())

ts_index = np.argmax(potential_energies)
ts_atoms = images[ts_index]

output = ts_job(ts_atoms)
return {
"relax_reactant": relax_summary_r,
"relax_product": relax_summary_p,
"geodesic_results": images,
"ts_results": output,
}


def _get_hessian(atoms: Atoms) -> NDArray:
"""
Calculate and retrieve the Hessian matrix for the given molecular configuration.
Expand Down
Loading
Loading