Skip to content

Commit

Permalink
Allow using fewer tmats.
Browse files Browse the repository at this point in the history
  • Loading branch information
amartyabose committed Nov 4, 2024
1 parent ce8d0aa commit 2891ac3
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/Simulate.jl
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,23 @@ end
out = h5open(sim.output, "r+")
method_group = out["$(sim.name)/$(sim.calculation)/$(sim.method)"]
data_node = calc(QDSimUtilities.Calculation(sim.calculation)(), sys, bath, sim, units, sim_node, method_group; dry=true)
num_tmats_used = get(sim_node, "num_tmats_used", -1)
Ts = read_dataset(data_node, "T0e")
if num_tmats_used != -1
Ts = Ts[1:num_tmats_used, :, :]
end
U0es = TTM.get_propagators_from_Ts(Ts, sim.nsteps)

ρ0s = sim_node["rho0"]
outputdirs = sim_node["outgroup"]
for (nρ, (ρ0file, outputdir)) in enumerate(zip(ρ0s, outputdirs))
@info "Processing initial density number $(nρ)."
ρ0 = ParseInput.parse_operator(ρ0file, sys.Hamiltonian)
ts, ρs = Utilities.apply_propagator(; propagators=U0es, ρ0, ntimes=sim.nsteps, sim.dt)
ts, ρs = Utilities.apply_propagator(; propagators=U0es, ρ0, ntimes=sim.nsteps, dt=sim.dt)
@info "Saving the data in $(outputdir)."
out = Utilities.create_and_select_group(data_node, outputdir)
Utilities.check_or_insert_value(out, "time", collect(ts))
Utilities.check_or_insert_value(out, "time_unit" , units.time_unit)
Utilities.check_or_insert_value(out, "time", collect(ts) ./ units.time_unit)
Utilities.check_or_insert_value(out, "time_unit", units.time_unit)
Utilities.check_or_insert_value(out, "rho", ρs)
end
close(out)
Expand Down

0 comments on commit 2891ac3

Please sign in to comment.