Commit 5bf839e9 authored by Carl Goodrich's avatar Carl Goodrich
Browse files

add minimize_endpoints option to find_paths

parent 7cb55a0b
......@@ -282,7 +282,8 @@ def find_DNEB_paths(R_endpoints,
max_num_steps_DNEB=10000,
max_grad_thresh_DNEB=1e-12,
dt_start_DNEB=0.001,
dt_max_DNEB=0.004):
dt_max_DNEB=0.004,
minimize_endpoints=True):
""" Minimize the set of endpoints and run DNEB calculation between endpoint pairs
This is the primary API function.
......@@ -303,13 +304,18 @@ def find_DNEB_paths(R_endpoints,
- list of length t containing DNEB results
"""
minimize_endpoints = setup_endpoint_minimization(
true_energy_fn,
shift_fn,
max_num_steps=max_num_steps,
max_grad_thresh=max_grad_thresh,
dt_start=dt_start,
dt_max=dt_max)
if minimize_endpoints:
minimize_endpoints = setup_endpoint_minimization(
true_energy_fn,
shift_fn,
max_num_steps=max_num_steps,
max_grad_thresh=max_grad_thresh,
dt_start=dt_start,
dt_max=dt_max)
R_endpoints_new, _, _ = minimize_endpoints(R_endpoints)
else:
R_endpoints_new = R_endpoints
minimize_DNEB = setup_DNEB_minimization(
true_energy_fn,
spring_energy_fn,
......@@ -319,8 +325,7 @@ def find_DNEB_paths(R_endpoints,
max_grad_thresh=max_grad_thresh_DNEB,
dt_start=dt_start_DNEB,
dt_max=dt_max_DNEB)
R_endpoints_new, _, _ = minimize_endpoints(R_endpoints)
DNEB_results_all = [
minimize_DNEB(Rs) for Rs in R_endpoints_new[jnp.array(transitions)]
]
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment