Skip to content

Commit

Permalink
updated minimizer
Browse files Browse the repository at this point in the history
  • Loading branch information
csbrasnett committed Apr 22, 2024
1 parent 129885a commit 113762a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions polyply/src/minimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def optimize_geometry(block, coords, inter_types=[], tolerance={"angles": 5,
"""
n_atoms = len(coords)
atom_to_idx = OrderedDict(zip(list(coords.keys()), range(0, n_atoms)))
positions = np.array(list(coords.values()))
positions = np.ravel(np.array(list(coords.values())))

def target_function(positions):
energy = 0
Expand All @@ -183,7 +183,7 @@ def target_function(positions):
energy += new
return energy

opt_results = scipy.optimize.minimize(target_function, np.ravel(positions),
opt_results = scipy.optimize.minimize(target_function,
method='L-BFGS-B',
options={'ftol': 0.001, 'maxiter': 100})

Expand Down

0 comments on commit 113762a

Please sign in to comment.