Difference between revisions of "Grape hilb.m"

From Spinach Documentation Wiki
Jump to: navigation, search
(Created page with "{{DISPLAYTITLE:grape_hilb.m}} __NOTOC__ Gradient Ascent Pulse Engineering objective function and gradient for Hilbert space. Propagates a system through a shaped pulse from an...")
 
(Sync syntax/arguments/outputs with current Spinach source)
Line 1: Line 1:
 
{{DISPLAYTITLE:grape_hilb.m}} __NOTOC__
 
{{DISPLAYTITLE:grape_hilb.m}} __NOTOC__
 +
 
Gradient Ascent Pulse Engineering objective function and gradient for Hilbert space. Propagates a system through a shaped pulse from an initial state to a target state and returns fidelity and its gradient.
 
Gradient Ascent Pulse Engineering objective function and gradient for Hilbert space. Propagates a system through a shaped pulse from an initial state to a target state and returns fidelity and its gradient.
  
 
==Syntax==
 
==Syntax==
  
−
    [traj_data,fidelity,grad]=grape_hilb(spin_system,drifts,controls,waveform,rho_init,rho_targ,fidelity_type)
+
[traj_data,fidelity,grad] = grape_hilb(spin_system,drifts,controls,waveform,rho_init,rho_targ,fidelity_type) %#ok<*PFBNS>
  
 
==Arguments==
 
==Arguments==
  
−
    spin_system        - Spinach data object that has been  
+
spin_system        - Spinach data object that has been  
 
                           through the optimcon.m problem  
 
                           through the optimcon.m problem  
 
                           setup function
 
                           setup function
Line 35: Line 36:
 
==Outputs==
 
==Outputs==
  
−
    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
Line 44: Line 45:
  
 
==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.
 
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==
 +
 
[[Optimal control module]]
 
[[Optimal control module]]
  
  
 
''Version 2.11, authors: [[Ilya Kuprov]], [[Maxi Keitel]]''
 
''Version 2.11, authors: [[Ilya Kuprov]], [[Maxi Keitel]]''

Revision as of 14:03, 5 April 2026


Gradient Ascent Pulse Engineering objective function and gradient for Hilbert space. Propagates a system through a shaped pulse from an initial state to a target state and returns fidelity and its gradient.

Syntax

[traj_data,fidelity,grad] = grape_hilb(spin_system,drifts,controls,waveform,rho_init,rho_targ,fidelity_type) %#ok<*PFBNS>

Arguments

spin_system - Spinach data object that has been

                         through the optimcon.m problem 
                         setup function

   drifts              - the drift Hamiltonians: a cell array 
                         containing one matrix (for time-inde-
                         pendent drift) or multiple matrices 
                         (for time-dependent drift)

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

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

   rho_init            - initial state of the system as a density 
                         matrix in Hilbert space

   rho_targ            - target state of the system as a density 
                         matrix in Hilbert space

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

Outputs

fidelity - fidelity of the control sequence

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

   traj_data.forward   - forward trajectory from the initial con-
                         dition (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

Optimal control module


Version 2.11, authors: Ilya Kuprov, Maxi Keitel