Obtaining the delta vectors of the distance

10 views
Skip to first unread message

Bart Bruininks

unread,
Oct 4, 2023, 10:57:05 AM10/4/23
to freud-users
Hi Freudians,

I am using the AABBQuery in Freud for a project and I was wondering if it is possible to return the difference vector instead of returning the the length of the difference vector. 

I could not find this in the documentation and it also does not seem to be an optional kwarg like num_neighbors etc. It would be great if there is a nice solution possible, which would not require a custom Freud version, as I would like to flag Freud as a dependency and creating installers would become messy with custom versions.

I need such vectors for treatment of aggregates to classify their containment hierarchy. I have been using a voxel based paradigm in the past, but I am trying out Freud to replace and enhance my distance/PBC logic.

A project I want to use it for is MDVContainment (github link)

Cheers,

Bart

PS
If anyone turns out to be interested in inside and outside classification (containment) in Periodic Spaces and want to know how it works, feel free to send me an email. It is pretty wild, but can be really useful!



Joshua Anderson

unread,
Oct 4, 2023, 12:02:22 PM10/4/23
to freud-users
Bart,

This is already implemented and will be in freud 3.0: https://github.com/glotzerlab/freud/pull/738
You can test it now by checking out the `next` branch and installing from source.
------
Joshua A. Anderson, Ph.D.
Research Area Specialist, Chemical Engineering, University of Michigan

--
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/2d0ef1a0-a6d8-4b2f-8855-80ee42af8d60n%40googlegroups.com.

Bart Bruininks

unread,
Oct 4, 2023, 12:43:27 PM10/4/23
to freud-users
Nice that is excellent news and I guess I will have to keep an eye out for the final 3.0 API but that is something I can certainly accept. 
So far I really enjoyed using Freud :D

Cheers,

Bart

Op woensdag 4 oktober 2023 om 18:02:22 UTC+2 schreef Josh Anderson:

Tommy Waltmann

unread,
Oct 5, 2023, 11:23:33 AM10/5/23
to freud-users
Hi Bart,

Great to hear you're enjoying using freud!

If you don't want to wait for the version 3 release, there is quick way to get the neighbor vectors with some numpy indexing. The example in the documentation for the neighborlist class demonstrates this: https://freud.readthedocs.io/en/latest/modules/locality.html#freud.locality.NeighborList

Let me know if you have any more questions,

- Tommy

Bart Bruininks

unread,
Oct 8, 2023, 8:30:41 AM10/8/23
to freud...@googlegroups.com

Hoi Tommy,

Thanks even more, I think this is roughly what I was doing (I was performing the minimum distance convention myself). However, it just felt wrong for I presumed you would have that vector to calculate the distance in the first place.

Cheers,

Bart

Op do 5 okt 2023 om 17:23 schreef Tommy Waltmann <tom...@umich.edu>:
Reply all
Reply to author
Forward
0 new messages