grape.m

From Spinach Documentation Wiki
Revision as of 12:57, 3 November 2015 by Goodwin (talk | contribs) (title letter case change)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


This is the GRadient Ascent Pulse Engineering function; utilising the piecewise constant approximation in state to state transfer. Syntax:

    [diag_data,total_objective,total_grad,total_hess]=...
         grape(spin_system,drift,controls,waveform,time_step,nsteps,...
         initial_state_array,target_state_array,power_level)

Inputs

'spin_system' A spin system created with Spinach should always be passed to the grape optimal control module.
'drift' the "drift" Liouvillian: couplings, relaxation and other things that continue operating while the pulse is being executed.
'controls' a cell array of commutation superoperators whose coefficients are getting modulated by the pulse, e.g. {Lx,Ly}.
'waveform' matrix of doubles with n_controls rows and n_steps columns, where n_controls is the number of control operators and n_steps is the number of steps in the waveform. The waveform should be specified as fractions of the total power level, which is specified separately.
'time_step' waveform time step, in seconds.
'nsteps' number of time steps in the waveform.
'initial_state_array' cell array of initial state vectors (if multiple sources and targets are supplied, the resulting objective function and the gradient are sums over these source‐target pairs).
'target_state_array' a cell array of target state vectors (if multiple sources and targets are supplied, the resulting objective function and the gradient are sums over these source‐target pairs).
'power_level' nominal power level, in units of angular frequency. The waveform values should be specified as fractions of this power level.

Four derivative calculation methods are available: Hausdorff series, second order central finite difference, fourth order central finite difference and Sophie Schirmer's expm algorithm. The default (Sophie's algorithm) is fast and accurate to machine precision. Sophie Schirmer’s expm algorithm is the only option for the Newton‐Raphson method.

Outputs

'total_objective' the value of the GRAPE objective function.
'total_grad' the gradient of the objective function with respect to control amplitudes.
'total_hess' the Hessian of the objective function with respect to control amplitudes when

using the Newton‐Raphson method.

'diag_data' diagnostics data structure, containing complete information about the calculation. It has the following self‐explanatory fields:

diag_data.initial_state_array

diag_data.target_state_array

diag_data.total_objective

diag_data.spin_system

diag_data.power_level

diag_data.trajectory

diag_data.total_grad

diag_data.total_hess

diag_data.time_step

diag_data.controls

diag_data.waveform

diag_data.nsteps

diag_data.drift