-
Notifications
You must be signed in to change notification settings - Fork 2
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
Out-source n!/k! to Combinatorics.jl #7
base: master
Are you sure you want to change the base?
Conversation
jagot
commented
Jul 8, 2020
@@ -50,7 +50,7 @@ function radial_dipole_moment(a::Orbital, b::Orbital) | |||
n == n′ && return 3/2*n*√(n^2-ℓ^2) | |||
|
|||
A = powneg1(n′-ℓ)/(4*factorial(2ℓ-1)) | |||
B = √(factorial_ratio(n+ℓ,n-ℓ-1)*factorial_ratio(n′+ℓ-1,n′-ℓ)) | |||
B = √(factorial(n+ℓ,n-ℓ-1)*factorial(n′+ℓ-1,n′-ℓ)) |
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.
Wouldn't the gamma function from SpecialFunctions be better here, for the high n
/ell
cases?
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.
I am actually unsure, when talking about ratios of factorials. Should be investigated. This is of course related to #2, however, a numerically stable evaluation of the formula will not help for arbitrarily large values of n
/ell
, anyway, since the dipole moments (in the length gauge) are analytically divergent. This is physically reasonable, since the matrix element is ~ <n' ell' | r | n ell>
, which of course will increase, the larger the values of the quantum numbers are.
Codecov Report
@@ Coverage Diff @@
## master #7 +/- ##
===========================================
- Coverage 32.00% 21.90% -10.10%
===========================================
Files 6 5 -1
Lines 100 105 +5
===========================================
- Hits 32 23 -9
- Misses 68 82 +14
Continue to review full report at Codecov.
|