This commit is contained in:
nssc_kuen 2022-04-10 12:12:50 +02:00
parent a3d4d8a2c6
commit cdf9e3104f
1 changed files with 3 additions and 1 deletions

View File

@ -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