optimcon.m

From Spinach Documentation Wiki
Jump to: navigation, search

Updates the spin_system object with optimal control information.

Syntax

    spin_system=optimcon(spin_system,control)

Arguments

    spin_system  - primary Spinach data structure,
                   created by create.m and updated
                   by basis.m functions

    control      - control data structure described 
                   in detail in the online manual

Outputs

    spin_system  - updated Spinach data structure

Examples

See the examples given in examples/optimal_control directory. A fairly typical control parameter structure appears below.

    % Define control parameters
    control.drifts={{H}};                           % Drift
    control.operators={LxH,LyH,LxC,LyC,LxF,LyF};    % Controls
    control.rho_init={rho_init};                    % Starting state
    control.rho_targ={rho_targ};                    % Destination state
    control.pwr_levels=2*pi*1e3;                    % Pulse power
    control.pulse_dur=10e-3;                        % Pulse duration
    control.pulse_nsteps=50;                        % Time points
    control.penalties={'SNS'};                      % Penalty
    control.p_weights=100;                          % Penalty weight
    control.method='newton';                        % Optimisation method
    control.tol_g=1e-5;                             % Termination tolerance
    control.freeze=zeros(6,50);                     % Freeze mask

    % Plots during optimisation
    control.plotting={'correlation_order','local_each_spin','xy_controls'};

Notes

The plotting should be switched off for large production calculations - optimal control diagnostic plots are computationally expensive.

See also

grape.m, ensemble.m, fminnewton.m


Version 2.4, authors: Ilya Kuprov, David Goodwin