Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] #1

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft

[WIP] #1

wants to merge 3 commits into from

Conversation

ml-evs
Copy link
Owner

@ml-evs ml-evs commented Feb 7, 2023

Summary

This PR adds some optimizations and shortcuts for periodic image site detection that can be used in certain applications.

The optimizations are two-fold:

  • Currently, the periodic image check checks the lattice vectors of parent cell, species and position of a site and its potential image. For situations where the image checker is working with a fixed lattice, no overlapping sites, i.e., when performing a voronoi decomposition of a given cell, then these checks can be made optional. As these checks are wrapped in Python object niceties there can be quite a significant overhead from performing them, the composition check in particular (my benchmarks indicated ~30% of time when looping over a structure is just checking these compositions).

  • Secondly, the actual fractional coordinate diff can be optimized by replacing the element-wise tolerance check with a tolerance on an L1 norm (or L2, if desired). The default tolerance could be tweaked slightly to adjust for this.

Todo (if any)

Report back with a proper benchmark

Checklist

Work-in-progress pull requests are encouraged, but please put [WIP] in the pull request title.

Before a pull request can be merged, the following items must be checked:

  • Doc strings have been added in the Google docstring format. Run pydocstyle on your code.
  • Type annotations are highly encouraged. Run mypy path/to/file.py to type check your code.
  • Tests have been added for any new functionality or bug fixes.
  • All linting and tests pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant