Skip to content

Commit

Permalink
fix init and target same for all objectives
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick committed Apr 11, 2024
1 parent 0749663 commit 61c9e69
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/qutip_qoc/pulse_optim.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,6 @@ def optimize_pulses(
Hd_lst.append(objective.H[0])
Hc_lst.append([H[0] if isinstance(H, list) else H for H in objective.H[1:]])

# extract initial and target states/operators from the objective
init = objective.initial
targ = objective.target

# extract guess and bounds for the control pulses
x0, bounds = [], []
for key in control_parameters.keys():
Expand Down Expand Up @@ -207,8 +203,8 @@ def optimize_pulses(
params = {
"drift": Hd_lst[i],
"ctrls": Hc_lst[i],
"initial": init,
"target": targ,
"initial": objective.initial,
"target": objective.target,
"num_tslots": time_interval.n_tslots,
"evo_time": time_interval.evo_time,
"tau": None, # implicitly derived from tslots
Expand Down

0 comments on commit 61c9e69

Please sign in to comment.