But the maximum effective distance between any two points is L/2 in a system with a periodic length L in one dimension. Based on this, maybe it should be replaced by the diff -= np.floor(diff+0.5) or diff -= np.rint(diff). I wonder if my understanding is correct.
@zdcao121 Thanks for your comments. You are right, np.rint or np.round should be used for distance check. I just fixed it in a recent commit with the following actions
fixed the incorrect use of np.floor for distance check in several places
Hi, it's a nice project. While searching the proper generator in the pyxtal, the distance in the periodic unit cell is calculated as the follows:
https://github.com/qzhu2017/PyXtal/blob/344bb643d76e6e20fa72e11d05434a2446eb34da/pyxtal/wyckoff_site.py#L127
But the maximum effective distance between any two points is
L/2
in a system with a periodic lengthL
in one dimension. Based on this, maybe it should be replaced by thediff -= np.floor(diff+0.5)
ordiff -= np.rint(diff)
. I wonder if my understanding is correct.