Skip to content

Commit

Permalink
Delay rounding of J values until return
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesgardner1421 committed Aug 21, 2023
1 parent 5b992e5 commit e0c7539
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/InitialConditions/QuantisedDiatomic/QuantisedDiatomic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ include("energy_evaluation.jl")
include("binding_curve.jl")
include("random_configuration.jl")

struct EffectivePotential{T,B,F}
struct EffectivePotential{JType,T,B,F}
μ::T
J::Int
J::JType
binding_curve::BindingCurve{T,B,F}
end

Expand Down Expand Up @@ -394,7 +394,7 @@ function quantise_diatomic(sim::Simulation, v::Matrix, r::Matrix, binding_curve:
E = k + p

L = total_angular_momentum(r_com, p_com)
J = round(Int, (sqrt(1+4*L^2) - 1) / 2) # L^2 = J(J+1)ħ^2
J = (sqrt(1+4*L^2) - 1) / 2 # L^2 = J(J+1)ħ^2

μ = reduced_mass(masses(sim)[atom_indices])

Expand All @@ -416,7 +416,7 @@ function quantise_diatomic(sim::Simulation, v::Matrix, r::Matrix, binding_curve:
show_timer && show(TIMER)

@debug "Found ν="
return round(Int, ν), J
return round(Int, ν), round(Int, J)
end

function quantise_1D_vibration(model::AdiabaticModel, μ::Real, r::Real, v::Real;
Expand Down

0 comments on commit e0c7539

Please sign in to comment.