Skip to content

Commit

Permalink
Out-source n!/k! to Combinatorics.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
jagot committed Jul 8, 2020
1 parent b92a18f commit 50387d5
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 35 deletions.
2 changes: 2 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ version = "0.1.0"
[deps]
AngularMomentumAlgebra = "0bb1b1ac-0216-11e9-361b-bb110c659ce1"
AtomicLevels = "10933b4c-d60f-11e8-1fc6-bd9035a249a1"
Combinatorics = "861a8166-3701-5b0c-9a16-15d98fcdc6aa"
EnergyExpressions = "f4b57a2e-27c7-11e9-0cb0-edd185b706f6"
HypergeometricFunctions = "34004b35-14d8-5ef3-9330-4cdb6864b03a"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Expand All @@ -15,6 +16,7 @@ SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"
SpecialPolynomials = "a25cea48-d430-424a-8ee7-0d3ad3742e9e"

[compat]
Combinatorics = "1.0"
HypergeometricFunctions = "0.2, 0.3"
Polynomials = "1"
SpecialFunctions = "0.10"
Expand Down
2 changes: 1 addition & 1 deletion src/Hydrogen.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ module Hydrogen

using LinearAlgebra
using SparseArrays
using Combinatorics

using AtomicLevels
using AngularMomentumAlgebra
Expand All @@ -13,7 +14,6 @@ using SpecialPolynomials: Laguerre
using SpecialFunctions: gamma

include("sparse_builder.jl")
include("factorial_ratio.jl")

include("constants.jl")
include("energies.jl")
Expand Down
2 changes: 1 addition & 1 deletion src/dipoles.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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′-ℓ))
C = (4*n*n′)^(ℓ+1)*(n-n′)^(n+n′-2-2)/((n+n′)^(n+n′))

nᵣ = n--1
Expand Down
25 changes: 0 additions & 25 deletions src/factorial_ratio.jl

This file was deleted.

8 changes: 0 additions & 8 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,6 @@ function lyman_balmer²(o, n, ℓ)
end

@testset "Hydrogen.jl" begin
@testset "Factorial ratios" begin
for a = 1:6
for b = 1:6
@test Hydrogen.factorial_ratio(a,b) == factorial(a)/factorial(b)
end
end
end

@testset "Radial dipole moments" begin
# We cannot compare with Table 13 of Bethe and Salpeter 1977,
# since it provides so few figures and some of the values
Expand Down

0 comments on commit 50387d5

Please sign in to comment.