-
Notifications
You must be signed in to change notification settings - Fork 22
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
QTAIM Surface Algorithm #56
Open
Ali-Tehrani
wants to merge
90
commits into
theochem:master
Choose a base branch
from
Ali-Tehrani:qtaim
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Added gradient path vectorized - Added beta-spheres
- Write RK4(5) ODE solver - Vectorize over radial shells
- Added a maximum iteration to ODE solver - Added check for NNA
- Still needs refactoring
- Finding the intersections isn't added yet
- Took from Keith's thesis CH4, faster than solving for an entire interval at a time
- Beta-spheres to the Surface object - Spherical t-design to the grid objects
- Makes sure the beta-sphere is correct.
- Lots of molecules actually do intersect the basin more than three times
- Increases time efficiency
- Can create any angular degree
Easier to track atoms
For finding NNA
- The NNA was incredibly close and so the beta-sphere must have been decreased
- np.unique doesn't preserve order
- Sometimes the beta-sphere is so large, that there are points on the sphere whose density values are less than isosurface value, these points should b e classified as oas or else it will cause an IndexError
- only for surface atoms, because it doesn't work with negative indices
- Need this for refinement within Surface class
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Thursday, April 27, 2023: Mostly complete, needs refactoring, some features to be added, in progress
QTAIM is a theory that partitions the electron density based on the gradient path of the density. Each region is generally associated with an atom of the molecule, called the atomic basin of the atom. These basins all contain a boundary that borders each other. The boundary contains two parts, the interatomic surface where the boundary borders another atomic basin and the outeratomic surface which is the intersection of the isosurface of the electron density (at some value) and the atomic basin. The following is an example of a complicated hydrogen atomic basin that borders two atoms where the red points are the OAS points, black points are the IAS points, purple points are "refined" points, and green are the nuclei.
This pull-requests contains two algorithms (grid-based method of Henklemen [1] and Yu-trinkle [2] and a variant of Keith's PROMEGA algorithm [3] ) for finding atomic basins. The former is included in the file
yu_trinkle.py
and the latter inqtaim.py
. This pull-requests requires heavy refactoring/cleaning and a couple of days of discussions before it should be merged. The rest of the pull request would be talking about the PROMEGA algorithm.Requirements
General Algorithm
scipy.optimize
does not have a vectorized root-solver. Originally, the Newton-Ralpson was used since the logarithm of the electron density should be quadratic at large distances, where the Newton-Ralphson excels. However, this may not give the first root, but the second or third root.The following tricks are used to improve performance:
qtaim_depreciated.py
that doesn't require vectorization with memory management. However, the algorithm and its parameters are not optimized nor handle edge cases.With P100 GPU, it takes anywhere from 5 to 15 minutes to solve for all surfaces for simple organic molecules up to 25 atoms with cc-pvtz basis set, high angular degrees of 107 for carbon, oxygen and nitrogen and 135 for hydrogen atoms and boundary error of 1e-5. This roughly corresponds to about 6K to 9K points on each surface.
Further Improvements Needed
NonImplementedError
if the user wants them.API
Each calculation returns a
Surface
object from the filesurface.py
. The following is an example for methane:Tests
The four tests in
test_qtaim.py
are performed over H2O, CH4, NH3 over a small angular grid size, the time for each test is around a minute except for the last one:Checks
Please remove the checks that are not applicable to your PR, and replace [ ] with [x] to mark the
checks that are already completed. You can finish the other relevant checks after opening the PR.
Type of Changes
✨ New Feature
References
[1] - Henkelman, Graeme, Andri Arnaldsson, and Hannes Jónsson. "A fast and robust algorithm for Bader decomposition of charge density." Computational Materials Science 36.3 (2006): 354-360.
[2] - Yu, Min, and Dallas R. Trinkle. "Accurate and efficient algorithm for Bader charge integration." The Journal of chemical physics 134.6 (2011): 064111.
[3] - T.A. Keith, Chapter 4 of Ph.D. Thesis: Molecules in Magnetic Fields, 176-213 (1993)
[4] - Rodríguez, Juan I., et al. "An efficient grid‐based scheme to compute QTAIM atomic properties without explicit calculation of zero‐flux surfaces." Journal of computational chemistry 30.7 (2009): 1082-1092.