diff --git a/Exercise_02/state.py b/Exercise_02/state.py index fbd1df3..6242dc5 100644 --- a/Exercise_02/state.py +++ b/Exercise_02/state.py @@ -19,7 +19,8 @@ class State: return energy(self.positions()) def minimize(self) -> None: - res = minimize(energy, self.positions(), method='L-BFGS-B', bounds=Bounds(0,self.size), jac='3-point') + # report with jax gradient + res = minimize(energy, self.positions(), method='CG', jac='3-point') min = res.x min = np.matrix(min) min.shape = (self.count,3) @@ -75,6 +76,7 @@ def distances(P): XYZ = abs(XYZ) # nearest image convention + # replace with modulo XYZ = XYZ.at[XYZ > 0.5].add(-0.5) XYZ = XYZ**2