biotite icon indicating copy to clipboard operation
biotite copied to clipboard

Improve distance calculation speed for small systems

Open dnlbauer opened this issue 3 years ago • 2 comments

The current implementation of various functions (i.e. RDF) uses a cell list approach to calculate distances between two selections. However, this approach tends to be very slow for some edge cases such as:

  • systems with low number of particles
  • if one of the two selections is very small

In these cases, a bruteforce based approach is usually faster. It would be nice if biotite had some heuristic to switch between the two methods based on the given problem.

dnlbauer avatar Apr 16 '21 12:04 dnlbauer

To find a good heuristic might be quite challenging, but I will start with an optional use_cell_list parameter.

padix-key avatar Apr 19 '21 10:04 padix-key

This PR should fix the issue for the rdf() function. All other currently implemented functions, that use a CellList always need a large number of pairwise distances, so a brute-force witch is not required in those cases, in my opinion. Furthermore, PR #311 also increases the performance of the cell list based approach.

padix-key avatar May 18 '21 11:05 padix-key