Open
Conversation
When n=1, the first component (n-1)/r does not exist
Certain components of the derivatives aren't needed when n=1,2
When r=0, n=1, then the kinetic energy should return infinity
When r=0, n=1, the Laplacian should be infinity
FarnazH
reviewed
Jun 7, 2022
Member
FarnazH
left a comment
There was a problem hiding this comment.
@Ali-Tehrani, my commit updates the comments to make it more clear how 1st and 2nd derivatives are computed. I also removed the Notes of the second_derivative_radial_slater_type_orbital docstring which stated that When :math:n=1,2 and :math:r=0, then the derivative is infinity. Are you fine with that?
Comment on lines
+631
to
+642
| norm = np.power(2. * exps, numbers) * np.sqrt((2. * exps) / factorial(2. * numbers)) | ||
| slater_minus_one = SlaterAtoms.radial_slater_orbital( | ||
| exps, numbers - 1, points, normalized=False | ||
| ) | ||
| slater_r = norm.T * slater_minus_one | ||
| # When r=0 and n = 1, then slater/r is infinity. | ||
| i_r_zero = np.where(np.abs(points) == 0.0)[0] | ||
| i_numb_one = np.where(numbers[0] == 1)[0] | ||
| indices = np.array([[x, y] for x in i_r_zero for y in i_numb_one]) | ||
| if len(indices) != 0: # if-statement needed to remove numpy warning using list | ||
| slater_r[indices] = np.inf | ||
| phi_i_r[:, index] += np.ravel(np.dot(slater_r, self.orbitals_coeff[orbital])) |
Member
There was a problem hiding this comment.
@Ali-Tehrani can this be computed using first_derivative_radial_slater_type_orbital function?
Comment on lines
+546
to
+557
| norm = np.power(2. * exps, numbers) * np.sqrt((2. * exps) / factorial(2. * numbers)) | ||
| # Take unnormalized slater with number n-1, this is needed to remove divide by r^2 | ||
| slater_minus_one = SlaterAtoms.radial_slater_orbital( | ||
| exps, numbers - 1, points, normalized=False | ||
| ) | ||
| deriv_pref = norm.T * slater_minus_one | ||
| # When r=0 and n = 1, then the derivative is undefined and this returns infinity or nan | ||
| i_r_zero = np.where(np.abs(points) == 0.0)[0] | ||
| i_numb_one = np.where(numbers[0] == 1)[0] | ||
| indices = np.array([[x, y] for x in i_r_zero for y in i_numb_one]) | ||
| if len(indices) != 0: # if-statement needed to remove numpy warning using list | ||
| deriv_pref[indices] = np.inf |
Member
There was a problem hiding this comment.
@Ali-Tehrani can this be computed using first_derivative_radial_slater_type_orbital?
This file contains hidden or 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
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.
Added the second derivative of Slater orbital, second derivative of molecular orbital and the Laplacian of the atomic density.
The tests that were added are: