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 25, 2023
1 parent d996f6d commit c08efa9
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 @@ -415,7 +415,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

Check warning on line 418 in src/InitialConditions/QuantisedDiatomic/QuantisedDiatomic.jl

View check run for this annotation

Codecov / codecov/patch

src/InitialConditions/QuantisedDiatomic/QuantisedDiatomic.jl#L418

Added line #L418 was not covered by tests

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

Expand All @@ -437,7 +437,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)

Check warning on line 440 in src/InitialConditions/QuantisedDiatomic/QuantisedDiatomic.jl

View check run for this annotation

Codecov / codecov/patch

src/InitialConditions/QuantisedDiatomic/QuantisedDiatomic.jl#L439-L440

Added lines #L439 - L440 were not covered by tests
end

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

0 comments on commit c08efa9

Please sign in to comment.