Skip to content

Out-source n!/k! to Combinatorics.jl#7

Open
jagot wants to merge 2 commits into
masterfrom
factorials
Open

Out-source n!/k! to Combinatorics.jl#7
jagot wants to merge 2 commits into
masterfrom
factorials

Conversation

@jagot

@jagot jagot commented Jul 8, 2020

Copy link
Copy Markdown
Member

Comment thread src/dipoles.jl

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′-ℓ))

Copy link
Copy Markdown
Member

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?

Copy link
Copy Markdown
Member Author

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

codecov Bot commented Jul 8, 2020

Copy link
Copy Markdown

Codecov Report

Merging #7 (abf9519) into master (b92a18f) will decrease coverage by 10.09%.
The diff coverage is 5.00%.

Impacted file tree graph

@@             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     
Impacted Files Coverage Δ
src/Hydrogen.jl 100.00% <ø> (ø)
src/orbitals.jl 29.62% <0.00%> (-70.38%) ⬇️
src/dipoles.jl 46.66% <100.00%> (+2.91%) ⬆️
src/energies.jl 0.00% <0.00%> (ø)
src/sparse_builder.jl 0.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b92a18f...abf9519. Read the comment docs.

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.

2 participants