grape_phase.m

From Spinach Documentation Wiki
Jump to: navigation, search

Cost function for optimal control using the GRAPE algorithm. Returns fidelity, gradient and Hessian for a given waveform, specified in polar coordinates. Only the phase channel gradient is returned, the amplitude profile is taken as a given.

Syntax

    [traj_data,fidelity,gradient,hessian]=grape_phase(phi_profile,spin_system)

Parameters

phi_profile - set of control pulse phases from an amplitude-phase
             description

Outputs

traj_data - trajectory data

fidelity  - figure of merit for the overlap of the current state of the
           system and the desired state(s). When penalty methods are
           specified, fidelity is returned as an array separating the
           penalties from the simulation fidelity

gradient  - gradient of the fidelity with respect to the control sequence

hessian   - Hessian of the fidelity with respect to the control sequence

Examples

A typical call would be from an optimisation function (see examples/optimal_control):

   % Run the optimization
   fmaxnewton.m(spin_system,@grape_phase,guess);

Notes

The fidelity, the gradient and the Hessian may be supplied to any optimisation routine, including those in the Optimisation Toolbox of Matlab.

See also

fmaxnewton.m, grape_coop.m, grape_curv.m, grape_hilb.m, grape_liouv.m, grape_xy.m, tgrape.m, Optimal control module

Version 2.2, authors: Ilya Kuprov, David Goodwin