You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The docstring for pulseoptim.create_pulse_optimizer states that amp_lbound and amp_ubound can be a list specifying different bounds for each of the controls. But this does not work with the default alg='GRAPE' because when the pulse_generator is created in lines 2087-2097 in pulseoptim.py, a single pulse_generator is used for all controls, but the bounds are still set with amp_lbound and amp_ubound as lists. This will fail because the PulseGen class expects the bounds to be floats, e.g., when bounds checking in _apply_bounds_and_offset. Having a single pulse generator also does not conceptually align with having different bounds on each control. None of this is an issue if amp_lbound and amp_ubound are specified as a single float for all controls, or if alg='CRAB' is used instead because a pulse_generator is created for each control.
The coding fix is simple, but it is unclear whether instantiating a pulse generator for each control, like in CRAB, is still valid for GRAPE.
Below is a simple example that will fail:
fromqutipimportidentity, sigmax, sigmay, sigmazfromqutip_qip.operationsimporthadamard_transformimportqutip_qtrl.pulseoptimascpo# DriftH_d=sigmaz()
# ControlH_c= [sigmax(), sigmay()]
# Initial unitaryU_0=identity(2)
# Target unitaryU_targ=hadamard_transform(N=1)
# Number of time slotsn_ts=10# Total timeevo_time=10# Boundsamp_lbound= [-1for_inrange(len(H_c))]
amp_ubound= [1for_inrange(len(H_c))]
result=cpo.optimize_pulse_unitary(H_d, H_c, U_0, U_targ, n_ts, evo_time,
amp_lbound=amp_lbound, amp_ubound=amp_ubound,
alg='GRAPE')
The text was updated successfully, but these errors were encountered:
Can GRAPE have different bounds on each control?
The docstring for
pulseoptim.create_pulse_optimizer
states thatamp_lbound
andamp_ubound
can be a list specifying different bounds for each of the controls. But this does not work with the defaultalg='GRAPE'
because when thepulse_generator
is created in lines 2087-2097 in pulseoptim.py, a singlepulse_generator
is used for all controls, but the bounds are still set withamp_lbound
andamp_ubound
as lists. This will fail because thePulseGen
class expects the bounds to be floats, e.g., when bounds checking in_apply_bounds_and_offset
. Having a single pulse generator also does not conceptually align with having different bounds on each control. None of this is an issue ifamp_lbound
andamp_ubound
are specified as a single float for all controls, or ifalg='CRAB'
is used instead because apulse_generator
is created for each control.The coding fix is simple, but it is unclear whether instantiating a pulse generator for each control, like in CRAB, is still valid for GRAPE.
Below is a simple example that will fail:
The text was updated successfully, but these errors were encountered: