Difference between revisions of "Grape liouv.m"

From Spinach Documentation Wiki
Jump to: navigation, search
(→‎Syntax)
Line 1: Line 1:
 
{{DISPLAYTITLE:grape.m}}
 
{{DISPLAYTITLE:grape.m}}
−
 
+
Gradient Ascent Pulse Engineering (GRAPE) fidelity, gradient and Hessian. 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.
−
Gradient Ascent Pulse Engineering (GRAPE) fidelity, gradient and Hessian.  
 
  
 
==Syntax==
 
==Syntax==
Line 8: Line 7:
 
                                           waveform,dt,rho_init,rho_targ,...
 
                                           waveform,dt,rho_init,rho_targ,...
 
                                           fidelity_type)
 
                                           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==
 
==Arguments==
  
−
   drift              - The drift Liouvillian (matrix).
+
  spin_system        - Spinach data object that has been through
−
+
                        the [[optimcon.m]] problem setup function.
−
  controls            - Control operators in Liouville space (cell array
+
 
−
                        of matrices).
+
   drift              - the drift Liouvillian (matrix).
 
   
 
   
−
   waveform           - Control coefficients for each control operator,
+
   controls           - control operators in Liouville space (cell
−
                        rad/s (vector array)
+
                        array of matrices).
 
   
 
   
−
   dt                  - Size of time steps in the piecewise constant
+
   waveform            - control coefficients for each control ope-
−
                         approximation used within grape, seconds.
+
                         rator (in rows of a matrix), rad/s
 
   
 
   
−
   rho_init            - Initial state of the system as a vector in
+
   rho_init            - initial state of the system as a vector in
 
                         Liouville space.
 
                         Liouville space.
 
   
 
   
−
   rho_targ            - Target state of the system as a vector in
+
   rho_targ            - target state of the system as a vector in
 
                         Liouville space.
 
                         Liouville space.
 
   
 
   
−
   fidelity_type      - 'real' (real part of the overlap)
+
   fidelity_type      - 'real'   (real part of the overlap)
−
                         'imag' (imaginary part of the overlap)
+
                         'imag'   (imaginary part of the overlap)
 
                         'square' (absolute square of the overlap)
 
                         'square' (absolute square of the overlap)
  
Line 39: Line 35:
 
   fidelity            - fidelity of the control sequence
 
   fidelity            - fidelity of the control sequence
 
   
 
   
−
   grad                - gradient of the fidelity with
+
   grad                - gradient of the fidelity with respect to
−
                         repect to the control sequence
+
                         the control sequence
 
   
 
   
 
   hess                - Hessian of the fidelity with respect to the  
 
   hess                - Hessian of the fidelity with respect to the  
 
                         control sequence
 
                         control sequence
 
   
 
   
−
   traj_data.forward  - Forward trajectory of the grape simulation of
+
   traj_data.forward  - forward trajectory from the initial condi-
−
                         control amplitudes from the initial state.
+
                         tion(a stack of state vectors)
 
   
 
   
−
   traj_data.backward  - Backward trajectory of the grape simulation of
+
   traj_data.backward  - backward trajectory from the target state
−
                         control amplitudes from the desired target state.
+
                         (a stack of state vectors)
  
 
==Notes==
 
==Notes==
Line 55: Line 51:
  
 
==See also==
 
==See also==
−
[[dirdiff.m]], [[step.m]], [[optimcon.m]]
+
[[dirdiff.m]], [[step.m]], [[optimcon.m]], [[grape_xy.m]], [[grape_phase.m]], [[penalty.m]]
  
  
−
''Version 2.0, authors: [[Ilya Kuprov]], [[David Goodwin]]''
+
''Version 2.2, authors: [[Ilya Kuprov]], [[David Goodwin]]''

Revision as of 14:42, 13 August 2018

Gradient Ascent Pulse Engineering (GRAPE) fidelity, gradient and Hessian. 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.

Syntax

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

Arguments

  spin_system         - Spinach data object that has been through 
                        the optimcon.m problem setup function.
 
  drift               - the drift Liouvillian (matrix).

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

  waveform            - control coefficients for each control ope-
                        rator (in rows of a matrix), rad/s

  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 respect to
                        the control sequence

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

  traj_data.forward   - forward trajectory from the initial condi-
                        tion(a stack of state vectors)

  traj_data.backward  - backward trajectory from the target state
                        (a stack of state vectors)

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, optimcon.m, grape_xy.m, grape_phase.m, penalty.m


Version 2.2, authors: Ilya Kuprov, David Goodwin