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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Topology #47

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Topology #47

wants to merge 9 commits into from

Conversation

Ali-Tehrani
Copy link
Contributor

@Ali-Tehrani Ali-Tehrani commented Aug 4, 2021

Description

This pull-request is regarding topology/critical.py, a critical point finder class of any scalar function. The tests in topology/test/test_critical.py were commented out. Here, I fixed up the tests in test_critical.py in order to work with Topology class in critical.py (cf933df). I have three tests: single Gaussian, two Gaussians, and three Gaussian functions, where I know the exact positions of the critical points. The three Gaussian functions are centered as a equilateral triangle and so there is a additional critical point at the center of the triangle.

Sometimes, Newton-Raphson returns nan, so added an if-statement to make sure there is no nan (448fcae).

Additionally, I changed the order of the if-statement because calculating the electron density is cheaper than its gradient, hopefully saving a few seconds (64f0405).

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.

  • Each commit addresses one thing.
  • Each commit message is informative and is less than 50 characters.
  • Commits that can be grouped together are squashed.
  • Each unit of code added is tested.
  • Commits are rebased onto master.

Type of Changes

Please remove the lines that don't represent the type of your PR.

馃毃 Test
馃帹 Improve Format & Structure
Bug Fix

Moving a vector to a new-direction requires the formula:
"vector + direction". The old way wasn't calculating
the direction but rather just adding two vectors
The New-ton raphson algorithm for finding the roots/critical points
sometimes returns nan. I added a check here to the if statement.
First change is to make sure, if there is LinAlg error then
to discontinue.
If the density is zero, then discontinue
if the gradient isn't zero, then discontinue.
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.

None yet

1 participant