Difference between revisions of "Hess reorder.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:hess_reorder.m}} __NOTOC__
 
{{DISPLAYTITLE:hess_reorder.m}} __NOTOC__
−
 
+
A utility to reorder a Hessian for use in GRAPE optimal control problems. Swaps the Hessian ordering between control channel and time step variables being first or second. The Hessian elements correspond to the elements of a control waveform array ordered as:
−
A utility to reorder a Hessian for use in [[grape.m|GRAPE]] optimal control problems. Swaps the Hessian ordering between control channel and time step variables being first or second. The Hessian elements correspond to the elements of a control waveform array ordered as:
 
 
<center>
 
<center>
 
<math>\begin{bmatrix}X_1 & X_2 & \cdots & X_N\\ Y_1 & Y_2 & \cdots & Y_N\\ Z_1 & Z_2 & \cdots & Z_N\end{bmatrix}</math>
 
<math>\begin{bmatrix}X_1 & X_2 & \cdots & X_N\\ Y_1 & Y_2 & \cdots & Y_N\\ Z_1 & Z_2 & \cdots & Z_N\end{bmatrix}</math>
Line 12: Line 11:
 
==Syntax==
 
==Syntax==
  
−
hess=hess_reorder(hess,K,N)
 
  
−
==Outputs==
+
    hess=hess_reorder(hess,K,N)
  
−
hess    -  reordered Hessian with N first then K.
+
==Parameters==
  
−
  david.goodwin@inano.au.dk
+
    hess        - Hessian matrix,
−
  ilya.kuprov@weizmann.ac.il
+
   
 +
    K            - number of control channels.
 +
   
 +
    N            - number of time steps.
  
−
==See also==
+
==Outputs==
  
−
[[Optimal control module]]
+
    new_hess    - Re-ordered Hessian, with N first and K second
 +
                    (a KxK block matrix with blocks of size NxN).
  
 +
==See also==
 +
[[alpha_conds.m]], [[aux_mat.m]], [[bfgs.m]], [[cubic_interp.m]], [[dirdiff.m]], [[drifts.m]], [[ensemble.m]], [[objeval.m]], [[optimcon.m]], [[trapdiff.m]], [[Optimal control module]]
  
 
''Version 1.9, authors: [[David Goodwin]]''
 
''Version 1.9, authors: [[David Goodwin]]''
−
 
−
==Parameters==
 
−
 
−
hess        - Hessian matrix,
 
−
   
 
−
    K            - number of control channels.
 
−
   
 
−
    N            - number of time steps.
 

Latest revision as of 18:37, 6 June 2026

A utility to reorder a Hessian for use in GRAPE optimal control problems. Swaps the Hessian ordering between control channel and time step variables being first or second. The Hessian elements correspond to the elements of a control waveform array ordered as:

\(\begin{bmatrix}X_1 & X_2 & \cdots & X_N\\ Y_1 & Y_2 & \cdots & Y_N\\ Z_1 & Z_2 & \cdots & Z_N\end{bmatrix}\)

where X,Y,Z are different control channels and the index enumerates the time discretization points. A re-ordered Hessian will correspond to a waveform ordered as:

\(\begin{bmatrix}X_1 & Y_1 & Z_1\\ X_2 & Y_2 & Z_2\\ \vdots & \vdots & \vdots\\ X_N & Y_N & Z_N\end{bmatrix}\)

Syntax

    hess=hess_reorder(hess,K,N)

Parameters

    hess         - Hessian matrix, 

    K            - number of control channels.

    N            - number of time steps.

Outputs

    new_hess     - Re-ordered Hessian, with N first and K second 
                   (a KxK block matrix with blocks of size NxN).

See also

alpha_conds.m, aux_mat.m, bfgs.m, cubic_interp.m, dirdiff.m, drifts.m, ensemble.m, objeval.m, optimcon.m, trapdiff.m, Optimal control module

Version 1.9, authors: David Goodwin