qutip_qoc._optimizer module
This module contains the optimization routine to find the control parameters in a local and global search. It also contains the callback class to keep track of the optimization process.
- qutip_qoc._optimizer._global_local_optimization(objectives, control_parameters, time_interval, time_options, algorithm_kwargs, optimizer_kwargs, minimizer_kwargs, integrator_kwargs, qtrl_optimizers=None)[source]
Optimize a pulse sequence to implement a given target unitary by optimizing the parameters of the pulse functions. The algorithm is a two-layered approach. The outer layer does a global optimization using basin-hopping or dual annealing. The inner layer does a local optimization using a gradient- based method (no gradient for CRAB). Gradients and error values are calculated in the MultiObjective module.
- Parameters:
- objectiveslist of
qutip_qoc.Objective List of objectives to be optimized.
- control_parametersdict
Dictionary of options for the control pulse optimization. For each control function it must specify:
- control_iddict
- guess: ndarray, shape (n,)
Initial guess. Array of real elements of size (n,), where
nis the number of independent variables.
- boundssequence, optional
Sequence of
(min, max)pairs for each element in guess. None is used to specify no bound.
- time_interval
qutip_qoc._TimeInterval Time interval for the optimization.
- time_optionsdict, optional
Only supported by GOAT and JOPT. Dictionary of options for the time interval optimization. It must specify both:
- guess: ndarray, shape (n,)
Initial guess. Array of real elements of size (n,), where
nis the number of independent variables.
- boundssequence, optional
Sequence of
(min, max)pairs for each element in guess. None is used to specify no bound.
- algorithm_kwargsdict, optional
Dictionary of options for the optimization algorithm.
- algstr
Algorithm to use for the optimization. Supported are: “GOAT”, “JOPT”.
- fid_err_targfloat, optional
Fidelity error target for the optimization.
- max_iterint, optional
Maximum number of global iterations to perform. Can be overridden by specifying in optimizer_kwargs/minimizer_kwargs.
- optimizer_kwargsdict, optional
Dictionary of options for the global optimizer. Only supported by GOAT and JOPT.
- methodstr, optional
Algorithm to use for the global optimization. Supported are: “basinhopping”, “dual_annealing”
- max_iterint, optional
Maximum number of iterations to perform.
Full list of options can be found in
scipy.optimize.basinhopping()andscipy.optimize.dual_annealing().- minimizer_kwargsdict, optional
Dictionary of options for the local minimizer.
- methodstr, optional
Algorithm to use for the local optimization. Gradient driven methods are supported.
Full list of options and methods can be found in
scipy.optimize.minimize().- integrator_kwargsdict, optional
Dictionary of options for the integrator. Only supported by GOAT and JOPT. Options for the solver, see
MESolver.optionsand Integrator for a list of all options.
- objectiveslist of
- Returns:
- result
qutip_qoc.Result Optimization result.
- result