bond clustering

73 views
Skip to first unread message

jude vishnu

unread,
Aug 28, 2021, 11:42:40 AM8/28/21
to freud-users

Hello everyone,
I wanted to know whether it is possible to get clusters in a system with bond as the parameter for clustering.

Regards,
Jude

Bradley Dice

unread,
Aug 28, 2021, 12:01:11 PM8/28/21
to jude vishnu, freud-users
Hi Jude,

Yes. I think you are looking for an algorithm to find connected components, like in graph theory? If so, this is exactly what the Cluster module does when provided with a custom NeighborList object containing the bonds. See this method to build a NeighborList from arrays of bond pairs:

Let me know if you have any questions. We should add an example of this to the documentation.

Best,
Bradley

--
You received this message because you are subscribed to the Google Groups "freud-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to freud-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/freud-users/50a90ea7-b64a-48ef-815c-a9484359fd38n%40googlegroups.com.
--
Bradley Dice
NSF GRFP Fellow, MolSSI Software Fellow
PhD, Physics & Scientific Computing | Glotzer Lab, University of Michigan
E: bd...@umich.edu | M: +1 (816) 536-9996 | W: bradleydice.com

jude vishnu

unread,
Aug 24, 2022, 7:13:27 AM8/24/22
to freud-users
Dear Bradley,
I tried the example script from git hub. It seems to work. However when I use ovito's inbuilt function to calculate the value of Rg the results to seems to be different.
Here is my python script and my trajectory file. Could you please compare it with the cluster Rg you get from ovito . I am not able to understand what I have done wrong in my script. My guess is that when I am using numpy.unique to sort the bonded arrays, something is happening.


Regards,
Jude

Rg.py

Tommy Waltmann

unread,
Aug 24, 2022, 11:12:31 AM8/24/22
to freud-users
Hi Jude,

If you are worried that the call to np.unique is the problem, you can investigate this by running your script with and without the call to np.unique and compare results. If you have tried this and still cannot find the problem, I would look at a single cluster in a single frame in the trajectory and compare what values freud and OVITO give.

If at that point you believe there is a bug in freud's implementation of the cluster radius of gyration, you will need to provide a minimal script and system (preferably one cluster) for which the results between OVITO and freud are different. You will also need to indicate what the values calculated by OVITO are

Hope this helps with debugging,
Tommy

Bradley Dice

unread,
Aug 25, 2022, 8:47:38 PM8/25/22
to freud-users
Jude,

Unfortunately, I no longer have an active OVITO Pro license and cannot debug interactions between freud and OVITO. I would suspect there may be differences in the calculations used by freud and OVITO for the radius of gyration. At present, freud does not have a way to define particle masses, for instance. You can see some discussion on the variations of how ClusterProperties quantities are calculated (using geometric centers, mass-weighted centers, etc.) here: https://github.com/glotzerlab/freud/issues/778

Tommy Waltmann

unread,
Aug 26, 2022, 10:37:44 AM8/26/22
to freud-users
Hi,

Just so everyone is up to date, I was able to debug this in some private emails with Jude, and we found the difference in radius of gyration was due to differences in how particles images are used by OVITO and in Jude's freud script.

- Tommy
Reply all
Reply to author
Forward
0 new messages