The work flow for solving a quantum optimal control problem consists of the following general steps:

  1. Setup
  2. Optimize
  3. Visualize the results

1. Setup

The setup phase includes specifying

  • The size of the state vector
  • The system and control Hamiltonians
  • The target gate transformation
  • Duration of the gate and number of time steps for integrating Schroedinger's equation.

For the parameterization of the control functions, you need to specify

  • Carrier wave frequencies
  • Number of B-spline coefficients in each spline

The properties of the control problem are stored in a mutable struct that is populated by calling

  • params = Juqbox.objparams().

The next steps are:

  • Assign the initial parameter vector (called pcof0 in the examples below)
  • Set bounds for the parameter vector to be imposed during the optimization
  • Allocate working arrays by calling wa = Juqbox.Working_arrays()
  • Assign convergence criteria and other parameters for the optimizer
  • Build the optimization structure by calling prob = Juqbox.setup_ipopt_problem()

2. Optimization

Once you have been assigned the params and prob objects, as well as the initial parameter vector pcof0, the optimizer is invoked by

  • pcof = Juqbox.run_optimizer(prob, pcof0)

3. Visualizing the results

General properties of the optimized solution such as trace infidelity and unitary accuracy can be evaluated, and a number of figures can generated by invoking

  • pl = Juqbox.plot_results(params, pcof)

An array of Julia plot objects is returned in pl. These objects can be visualized on the screen

  • display(pl[1])

where pl[1] is the first Julia plot object. The following plot objects are populated by the script:

  • pl[1] Evolution of the state vector population
  • pl[2] Control functions in the rotating frame of reference
  • pl[3] Population of forbidden energy levels
  • pl[4] Lab frame control function(s)
  • pl[5] Fourier transform of the lab-frame control functions (linear scale)
  • pl[6] Fourier transform of the lab-frame control functions (log scale)
  • pl[7] Coefficients of the optimized parameter vector
  • pl[8] Convergence of the optimization