-
Notifications
You must be signed in to change notification settings - Fork 4
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
Laplacian #32
base: master
Are you sure you want to change the base?
Laplacian #32
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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?
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])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Ali-Tehrani can this be computed using first_derivative_radial_slater_type_orbital
function?
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Ali-Tehrani can this be computed using first_derivative_radial_slater_type_orbital
?
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: