From 61c9e6984d84579783752ebc23b0d77f04024414 Mon Sep 17 00:00:00 2001 From: Patrick <> Date: Thu, 11 Apr 2024 15:11:04 +0900 Subject: [PATCH] fix init and target same for all objectives --- src/qutip_qoc/pulse_optim.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/qutip_qoc/pulse_optim.py b/src/qutip_qoc/pulse_optim.py index 6dd2c60..b5ad742 100644 --- a/src/qutip_qoc/pulse_optim.py +++ b/src/qutip_qoc/pulse_optim.py @@ -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(): @@ -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