The Active Matter Evaluation Package (AMEP) - a Python library for the analysis of particle-based and continuum simulation data of soft and active matter systems
As described in discussion #61 , the gration_tensor gives greatly different results for the radius of gyration than the direct calculation of the radius_of_gyration.
Code for reproduction:
path="gyrationstuffex/"
traj= amep.load.traj(path, reload=False)
#need masses for gyration tensor
mass = 5e-2
masses = np.empty(traj[0].n(), dtype=np.double)
masses.fill(mass)
coords=traj[-1].coords()
box_boundary=traj[-1].box
clusters, ids=amep.cluster.identify(coords, box_boundary)
clusters = clusters[-10:]
print(box_boundary)
# sanity check radius of gyration first
gts = amep.cluster.gyration_tensor(coords, box_boundary, masses, pbc=True, clusters=clusters)
rogs = amep.cluster.radius_of_gyration(coords, box_boundary, masses, pbc=True, clusters=clusters)
for i, cluster in enumerate(clusters):
print(i)
print("how many particles",len(cluster))
# print(cluster)
print("gyration tensor\n",gts[i])
ev = np.linalg.eigvals(gts[i])
# print("ev", ev)
# print("sum ev",np.sum(ev))
print("sqrt(sum(ev))*0.05", np.sqrt(np.sum(ev))*0.05)
print("sqrt(sum(ev))", np.sqrt(np.sum(ev)))
print("rgs", rogs[i])
# print("sqrt(sum(ev))-rgs",np.sqrt(np.sum(ev))-rgs[i])
Error message:
No response
Python and AMEP versions:
1.0.3
Additional information:
gyrationstuffex.zip
The issue seems to be with the calculation of the distances between particles in gyration_tensor. The calculation with pbc_diff returns wrong results.
Description:
As described in discussion #61 , the
gration_tensor
gives greatly different results for the radius of gyration than the direct calculation of theradius_of_gyration
.Code for reproduction:
Error message:
No response
Python and AMEP versions:
1.0.3
Additional information:
gyrationstuffex.zip The issue seems to be with the calculation of the distances between particles in
gyration_tensor
. The calculation withpbc_diff
returns wrong results.How did you install AMEP?
None