Skip to content
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

Improve code coverage #104

Merged
merged 2 commits into from
Sep 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 6 additions & 33 deletions src/evolution.jl
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,9 @@ function HEOMsolve(
end

# Generate propagator
if verbose
print("Generating propagator...")
flush(stdout)
end
verbose && print("Generating propagator...")
exp_Mt = Propagator(M, Δt; threshold = threshold, nonzero_tol = nonzero_tol)
if verbose
println("[DONE]")
flush(stdout)
end
verbose && println("[DONE]")

# start solving
if verbose
Expand All @@ -137,24 +131,14 @@ function HEOMsolve(
ρvec = exp_Mt * ρvec
next!(prog)
end
if verbose
println("[DONE]\n")
flush(stdout)
end

# save ADOs to file
if filename != ""
if verbose
print("Saving ADOs to $(FILENAME) ...")
flush(stdout)
end
verbose && print("Saving ADOs to $(FILENAME) ... ")
jldopen(FILENAME, "w") do file
return file["ados"] = ADOs_list
end
if verbose
println("[DONE]")
flush(stdout)
end
verbose && println("[DONE]\n")
end

return TimeEvolutionHEOMSol(
Expand Down Expand Up @@ -270,26 +254,15 @@ function HEOMsolve(
flush(stdout)
end
sol = solve(prob, solver)
if verbose
println("[DONE]\n")
flush(stdout)
end

ADOs_list = map(ρvec -> ADOs(_HandleVectorType(ρvec, false), M.dims, M.N, M.parity), sol.u)

# save ADOs to file
if filename != ""
if verbose
print("Saving ADOs to $(FILENAME) ...")
flush(stdout)
end
verbose && print("Saving ADOs to $(FILENAME) ... ")
jldopen(FILENAME, "w") do file
return file["ados"] = ADOs_list
end
if verbose
println("[DONE]")
flush(stdout)
end
verbose && println("[DONE]\n")
end

return TimeEvolutionHEOMSol(
Expand Down
Loading