Skip to content

Commit

Permalink
bounds bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick committed May 1, 2024
1 parent 0a96185 commit 41dd7e2
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/qutip_qoc/pulse_optim.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,6 @@ def optimize_pulses(
qtrl_optimizers = []
if alg == "CRAB" or alg == "GRAPE":
if alg == "GRAPE": # algorithm specific kwargs
# only scalar bounds
lbound = lbound[0]
ubound = ubound[0]
use_as_amps = True
alg_params = algorithm_kwargs.get("alg_params", {})

Expand All @@ -210,6 +207,11 @@ def optimize_pulses(
"fix_frequency": fix_frequency,
}

if use_as_amps:
# same bounds for all controls
lbound = lbound[0]
ubound = ubound[0]

# one optimizer for each objective
for i, objective in enumerate(objectives):
params = {
Expand Down

0 comments on commit 41dd7e2

Please sign in to comment.