Skip to content

Commit

Permalink
bug fix: correct assignment of use_np_pinv
Browse files Browse the repository at this point in the history
  • Loading branch information
yihengwuKP committed Aug 9, 2024
1 parent 42ac1aa commit ca18225
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions examples/openmm/abf/alanine-dipeptide_openmm.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/env python3


import matplotlib.pyplot as plt
import numpy

Expand Down Expand Up @@ -115,7 +114,7 @@ def post_run_action(**kwargs):
def main():
cvs = [DihedralAngle((4, 6, 8, 14)), DihedralAngle((6, 8, 14, 16))]
grid = pysages.Grid(lower=(-pi, -pi), upper=(pi, pi), shape=(32, 32), periodic=True)
method = ABF(cvs, grid)
method = ABF(cvs, grid, use_np_pinv=True)

raw_result = pysages.run(method, generate_simulation, 25, post_run_action=post_run_action)
result = pysages.analyze(raw_result, topology=(14,))
Expand Down
2 changes: 1 addition & 1 deletion pysages/methods/abf.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ def _abf(method, snapshot, helpers):
"""
cv = method.cv
grid = method.grid
use_np_pinv = method.use_np_pinv

dt = snapshot.dt
dims = grid.shape.size
Expand Down Expand Up @@ -207,7 +208,6 @@ def update(state, data):
xi, Jxi = cv(data)

p = data.momenta
use_np_pinv = data.use_np_pinv

# The following could equivalently be computed as `linalg.pinv(Jxi.T) @ p`
# (both seem to have the same performance).
Expand Down

0 comments on commit ca18225

Please sign in to comment.