Difference between revisions of "Grape liouv.m"

From Spinach Documentation Wiki
Jump to: navigation, search
(Sync syntax/arguments/outputs with current Spinach source)
(Update function See also links and function index membership)
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
{{DISPLAYTITLE:grape_liouv.m}} __NOTOC__
 
{{DISPLAYTITLE:grape_liouv.m}} __NOTOC__
 
+
Gradient Ascent Pulse Engineering (GRAPE) objective function, 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 control operators in every time step of the shaped pulse.
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==
 
==Syntax==
  
[traj_data,fidelity,grad,hess]=grape_liouv(spin_system,drifts,controls,waveform,rho_init,rho_targ,fidelity_type) %#ok<*PFBNS>
+
    [traj_data,fidelity,grad,hess]=grape_liouv(spin_system,drifts,controls,...
 +
                                                waveform,rho_init,rho_targ,...
 +
                                                fidelity_type)
  
==Arguments==
+
==Parameters==
 
 
spin_system        - Spinach data object that has been through
 
                        the optimcon.m problem setup function.
 
 
 
  drifts              - the drift Liouvillians: a cell array con-
 
                        taining one matrix (for time-independent
 
                        drift) or multiple matrices (for time-de-
 
                        pendent drift).
 
 
 
  controls            - control operators in Liouville space (cell
 
                        array of matrices).
 
  
 +
  spin_system        - Spinach data object that has been through
 +
                        the [[optimcon.m]] problem setup function.
 +
 +
  drifts              - the drift Liouvillians: a cell array containing
 +
                        one matrix for time-independent drift, or multiple
 +
                        matrices for time-dependent drift.
 +
 +
  controls            - control operators in Liouville space (cell
 +
                        array of matrices).
 +
 
   waveform            - control coefficients for each control ope-
 
   waveform            - control coefficients for each control ope-
                         rator (in vertical dimension) at each time
+
                         rator in the vertical dimension, at each time
                         step (in horizonal dimension), rad/s
+
                         slice in the horizontal dimension, 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, ignored in stroboscopic
 
+
                        steady state optimisations.
 +
 
   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)
  
==Outputs==
+
==Returns==
 
 
fidelity            - fidelity of the control sequence
 
  
 +
  fidelity            - fidelity of the control sequence
 +
 
   grad                - gradient of the fidelity with respect to
 
   grad                - gradient of the fidelity with respect 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, not available for piecewise-linear
 
+
                        and stroboscopic steady state optimisations
   traj_data.forward  - forward trajectory from the initial condi-
+
                         tion(a stack of state vectors)
+
   traj_data.forward  - forward trajectory from the initial condition
 
+
                         or stroboscopic steady state; this is returned
Note: this is a low level function that is not designed to be called
+
                        only when requested by the control settings
      directly. Use grape_xy.m and grape_phase.m instead.
 
 
 
david.goodwin@inano.au.dk
 
u.rasulov@soton.ac.uk
 
ilya.kuprov@weizmann.ac.il
 
m.keitel@soton.ac.uk
 
 
 
TODO (Keitel): add logic to avoid computing backward trajectory
 
                when the gradient is not requested
 
  
 
==Notes==
 
==Notes==
 
+
This is a low level function that is not designed to be called directly. Use [[grape_xy.m]], [[grape_phase.m]], or other wrapper functions instead.
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==
 
+
[[dirdiff.m]], [[step.m]], [[optimcon.m]], [[grape_xy.m]], [[grape_phase.m]], [[penalty.m]], [[grape_coop.m]], [[grape_curv.m]], [[grape_hilb.m]], [[tgrape.m]], [[Optimal_control_module]]
[[dirdiff.m]], [[step.m]], [[optimcon.m]], [[grape_xy.m]], [[grape_phase.m]], [[penalty.m]]
 
 
 
  
 
''Version 2.2, authors: [[Ilya Kuprov]], [[David Goodwin]]''
 
''Version 2.2, authors: [[Ilya Kuprov]], [[David Goodwin]]''
 
==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)
 

Latest revision as of 19:37, 6 June 2026

Gradient Ascent Pulse Engineering (GRAPE) objective function, 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 control operators in every time step of the shaped pulse.

Syntax

    [traj_data,fidelity,grad,hess]=grape_liouv(spin_system,drifts,controls,...
                                               waveform,rho_init,rho_targ,...
                                               fidelity_type)

Parameters

  spin_system         - Spinach data object that has been through 
                        the optimcon.m problem setup function.

  drifts              - the drift Liouvillians: a cell array containing
                        one matrix for time-independent drift, or multiple
                        matrices for time-dependent drift.

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

  waveform            - control coefficients for each control ope-
                        rator in the vertical dimension, at each time
                        slice in the horizontal dimension, rad/s

  rho_init            - initial state of the system as a vector in
                        Liouville space, ignored in stroboscopic
                        steady state optimisations.

  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, not available for piecewise-linear
                        and stroboscopic steady state optimisations

  traj_data.forward   - forward trajectory from the initial condition
                        or stroboscopic steady state; this is returned
                        only when requested by the control settings

Notes

This is a low level function that is not designed to be called directly. Use grape_xy.m, grape_phase.m, or other wrapper functions instead.

See also

dirdiff.m, step.m, optimcon.m, grape_xy.m, grape_phase.m, penalty.m, grape_coop.m, grape_curv.m, grape_hilb.m, tgrape.m, Optimal_control_module

Version 2.2, authors: Ilya Kuprov, David Goodwin