|
| | OptimProblem (const Config &config, TimeStepper *timestepper_, MPI_Comm comm_init_, MPI_Comm comm_optim, Output *output_, bool quietmode=false) |
| | Constructor for optimization problem.
|
| |
| | ~OptimProblem () |
| |
| int | getNdesign () |
| | Retrieves the number of design variables.
|
| |
| double | getObjective () |
| | Retrieves the current objective function value.
|
| |
| double | getCostT () |
| | Retrieves the final-time cost term.
|
| |
| double | getRegul () |
| | Retrieves the Tikhonov regularization term.
|
| |
| double | getPenaltyLeakage () |
| | Retrieves the integral term for leakage.
|
| |
| double | getPenaltyWeightedCost () |
| | Retrieves the integral penalty term for weighted running cost.
|
| |
| double | getPenaltyDpDm () |
| | Retrieves the second-order state derivative penalty term.
|
| |
| double | getPenaltyVariation () |
| | Retrieves the control variation penalty term.
|
| |
| double | getPenaltyEnergy () |
| | Retrieves the control energy penalty term.
|
| |
| double | getFidelity () |
| | Retrieves the current fidelity.
|
| |
| double | getTolFinalCost () |
| | Retrieves the objective function tolerance.
|
| |
| double | getTolGradAbs () |
| | Retrieves the gradient tolerance.
|
| |
| double | getTolInfidelity () |
| | Retrieves the infidelity tolerance.
|
| |
| int | getMPIrank_world () |
| | Retrieves the MPI rank in the world communicator.
|
| |
| int | getMaxIter () |
| | Retrieves the maximum number of iterations.
|
| |
| double | evalF (const Vec x) |
| | Evaluates the objective function F(x).
|
| |
| void | evalGradF (const Vec x, Vec G) |
| | Evaluates the gradient of the objective function with respect to the control parameters.
|
| |
| void | solve (Vec xinit) |
| | Runs the optimization solver.
|
| |
| void | getStartingPoint (Vec x) |
| | Computes initial guess for optimization variables.
|
| |
| void | getSolution (Vec *opt) |
| | Retrieves the optimization solution and prints summary information.
|
| |
|
| size_t | ninit |
| | Number of initial conditions to be considered (N^2, N, or 1)
|
| |
| int | ninit_local |
| | Local number of initial conditions on this processor.
|
| |
| Vec | rho_t0 |
| | Storage for initial condition of the ODE.
|
| |
| Vec | rho_t0_bar |
| | Storage for adjoint initial condition of the adjoint ODE (aka the terminal condition)
|
| |
| std::vector< Vec > | store_finalstates |
| | Storage for final states for each initial condition.
|
| |
| OptimTarget * | optim_target |
| | Pointer to the optimization target (gate or state)
|
| |
| MPI_Comm | comm_init |
| | MPI communicator for initial condition parallelization.
|
| |
| MPI_Comm | comm_optim |
| | MPI communicator for optimization parallelization, currently not used (size 1)
|
| |
| int | mpirank_optim |
| |
| int | mpisize_optim |
| | MPI rank and size for optimization communicator.
|
| |
| int | mpirank_petsc |
| |
| int | mpisize_petsc |
| | MPI rank and size for spatial parallelization (PETSc)
|
| |
| int | mpirank_world |
| |
| int | mpisize_world |
| | MPI rank and size for global communicator.
|
| |
| int | mpirank_init |
| |
| int | mpisize_init |
| | MPI rank and size for initial condition communicator.
|
| |
| bool | quietmode |
| | Flag for quiet mode operation.
|
| |
| std::vector< double > | obj_weights |
| | Weights for averaging objective over initial conditions.
|
| |
| int | ndesign |
| | Number of global design (optimization) parameters.
|
| |
| double | objective |
| | Current objective function value (sum over final-time cost, regularization terms and penalty terms)
|
| |
| double | obj_cost |
| | Final-time measure J(T) in objective.
|
| |
| double | obj_regul |
| | Regularization term in objective.
|
| |
| double | obj_penal_leakage |
| | Penalty term for leakage into guard levels.
|
| |
| double | obj_penal_weightedcost |
| | Penalty term for weighted running cost.
|
| |
| double | obj_penal_dpdm |
| | Penalty term second-order state derivatives (penalizes variations of the state evolution)
|
| |
| double | obj_penal_variation |
| | Penalty term for variation of control parameters.
|
| |
| double | obj_penal_energy |
| | Energy penalty term in objective.
|
| |
| double | fidelity |
| | Final-time fidelity: 1/ninit sum_i Tr(rho_target^dag rho(T)) for Lindblad, |1/ninit sum_i phi_target^dag phi|^2 for Schrodinger.
|
| |
| double | gnorm |
| | Current norm of gradient.
|
| |
| double | gamma_tikhonov |
| | Parameter for Tikhonov regularization.
|
| |
| bool | tikhonov_use_x0 |
| | Switch to use ||x - x0||^2 for Tikhonov regularization instead of ||x||^2.
|
| |
| double | gamma_penalty_leakage |
| | Parameter multiplying integral leakage term.
|
| |
| double | gamma_penalty_weightedcost |
| | Parameter multiplying integral weighted cost function.
|
| |
| double | gamma_penalty_dpdm |
| | Parameter multiplying integral penalty term for 2nd derivative of state variation.
|
| |
| double | gamma_penalty_energy |
| | Parameter multiplying energy penalty.
|
| |
| double | gamma_penalty_variation |
| | Parameter multiplying finite-difference squared regularization term.
|
| |
| double | tol_grad_abs |
| | Stopping criterion based on absolute gradient norm.
|
| |
| double | tol_grad_rel |
| | Stopping criterion based on relative gradient norm.
|
| |
| double | tol_final_cost |
| | Stopping criterion based on objective function value.
|
| |
| double | tol_infidelity |
| | Stopping criterion based on infidelity.
|
| |
| int | maxiter |
| | Stopping criterion based on maximum number of iterations.
|
| |
| Tao | tao |
| | PETSc's TAO optimization solver.
|
| |
| double * | mygrad |
| | Auxiliary gradient storage.
|
| |
| Vec | xtmp |
| | Temporary vector storage.
|
| |
Optimization problem solver for quantum optimal control.
This class manages the optimization of quantum control pulses using PETSc's TAO optimization library. It handles objective function evaluation, by propagating initial states forward in time solving the dynamical equation and computing the final-time objective cost function and integral penalty terms, as well as the gradient computation by backpropagating the adjoint terminal states backwards in time solving the adjoint dynamical equation and collecting gradient contributions. It further defines the interface functions for PETSc's TAO optimization via L-BFGS, including a callback function to monitor optimization progress.
Main functionality:
- evalF evaluates the objective function by calling TimeStepper::solveODE to evolve initial states to final time T and summing up the objective function measure over each target state
- evalGradF evaluates the objective function and its gradient with respect to the optimization parameters by calling TimeStepper::solveODE and TimeStepper::solveAdjointODE to propagate initial states forward and backward through the time domain while accumulating objective and gradient information.
This class contains references to:
- TimeStepper for handling the forward and backward time stepping process
- OptimTarget for evaluating the final-time cost for each initial condition
- Output for writing monitored optimization convergence to file