Difference between revisions of "Grape liouv.m"

From Spinach Documentation Wiki
Jump to: navigation, search
Line 10: Line 10:
  
 
==Description==
 
==Description==
−
Propagates the system through a user-supplied shaped pulse from a given initial state and projects the result onto the given final state. The real part of the projection is returned, along with its gradient and Hessian with respect to amplitudes of all operators in every time step of the shaped pulse.
+
Propagates the system through a user-supplied shaped pulse from a given initial state and projects the result onto the given final state. The fidelity is returned, along with its gradient and Hessian with respect to amplitudes of all operators in every time step of the shaped pulse.
  
 
==Arguments==
 
==Arguments==
  
−
    spin_sys      - spin system
+
  drift               - The drift Liouvillian (matrix).
−
   
+
−
    ctrl_sys      - [[control_sys.m|control system]]
+
  controls            - Control operators in Liouville space (cell array
−
   
+
                        of matrices).
−
    drift         - Drift [[Hamiltonian.m|Hamiltonian]]. The "drift" Liouvillian:
+
−
                      couplings, relaxation and other things that continue operating
+
  waveform           - Control coefficients for each control operator,
−
                      while the pulse is being executed.
+
                        rad/s (vector array)
−
   
+
   
−
    waveform       - matrix of doubles with n_controls rows and n_steps columns,  
+
  dt                  - Size of time steps in the piecewise constant
−
                      where n_controls is the number of control operators and n_steps
+
                        approximation used within grape, seconds.
−
                      is the number of steps in the waveform. The waveform should be
+
−
                      specified as fractions of the total power level, which is
+
  rho_init            - Initial state of the system as a vector in
−
                      specified separately.
+
                        Liouville space.
−
 
+
 +
  rho_targ            - Target state of the system as a vector in
 +
                        Liouville space.
 +
 +
  fidelity_type      - 'real' (real part of the overlap)
 +
                        'imag' (imaginary part of the overlap)
 +
                        'square' (absolute square of the overlap)
  
 
==Returns==
 
==Returns==
  
−
    diag_data      - diagnostics data structure, containing complete information about
+
  fidelity            - fidelity of the control sequence
−
                      the calculation. It has the following self‐explanatory fields:
+
−
                              diag_data.current_state
+
  grad                - gradient of the fidelity with
−
                              diag_data.rho
+
                        repect to the control sequence
−
                              diag_data.target
+
−
                              diag_data.total_objective
+
  hess                - Hessian of the fidelity with respect to the
−
                              diag_data.spin_system
+
                        control sequence
−
                              diag_data.power_level
+
−
                              diag_data.trajectory
+
  traj_data.forward  - Forward trajectory of the grape simulation of  
−
                              diag_data.total_grad
+
                        control amplitudes from the initial state.
−
                              diag_data.total_hess
+
−
                              diag_data.dt
+
  traj_data.backward  - Backward trajectory of the grape simulation of
−
                              diag_data.controls
+
                        control amplitudes from the desired target state.
−
                              diag_data.waveform
 
−
                              diag_data.nsteps
 
−
                              diag_data.drift
 
−
   
 
−
    fidelity      - 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.
 
−
 
 
  
 
==Notes==
 
==Notes==
−
 
+
This is a low level function that is not designed to be called directly. Use [[grape_xy.m] and [[grape_phase.m]] instead.
  
 
==See also==
 
==See also==
Line 62: Line 58:
  
  
−
''Version 1.9, authors: [[Ilya Kuprov]], [[David Goodwin]]''
+
''Version 2.0, authors: [[Ilya Kuprov]], [[David Goodwin]]''

Revision as of 18:01, 21 July 2017


Gradient Ascent Pulse Engineering (GRAPE) fidelity, gradient and Hessian.

Syntax

    [traj_data,fidelity,grad,hess]=grape(spin_system,drift,controls,...
                                             waveform,dt,rho_init,rho_targ,...
                                             fidelity_type)

Description

Propagates the system through a user-supplied shaped pulse from a given initial state and projects the result onto the given final state. The fidelity is returned, along with its gradient and Hessian with respect to amplitudes of all operators in every time step of the shaped pulse.

Arguments

  drift               - The drift Liouvillian (matrix).

  controls            - Control operators in Liouville space (cell array 
                        of matrices).

  waveform            - Control coefficients for each control operator,
                        rad/s (vector array)

  dt                  - Size of time steps in the piecewise constant
                        approximation used within grape, seconds.

  rho_init            - Initial state of the system as a vector in
                        Liouville space.

  rho_targ            - Target state of the system as a vector in
                        Liouville space.

  fidelity_type       - 'real' (real part of the overlap)
                        'imag' (imaginary part of the overlap)
                        'square' (absolute square of the overlap)

Returns

  fidelity            - fidelity of the control sequence

  grad                - gradient of the fidelity with
                        repect to the control sequence

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

  traj_data.forward   - Forward trajectory of the grape simulation of 
                        control amplitudes from the initial state.

  traj_data.backward  - Backward trajectory of the grape simulation of
                        control amplitudes from the desired target state.

Notes

This is a low level function that is not designed to be called directly. Use [[grape_xy.m] and grape_phase.m instead.

See also

dirdiff.m, step.m, control_sys.m


Version 2.0, authors: Ilya Kuprov, David Goodwin