|Solid State NMR|
The Hamiltonian of a control system can be separated into two parts, one which is beyond the control of the experiment named the drift Hamiltonian, , and all other parts of the Hamiltonian correspond to a specific controllable subsystem. In the case of magnetic resonance, the controllable part of the Hamiltonian consists of radio frequency control fields. In Hilbert space this Hamiltonian can be written as 
where are the control Hamiltonians and are the time-dependent coefficients of the control Hamiltonians, corresponding to a control vector being a vector of amplitudes, exciting the system at this amplitude of radio frequency.
Investigation within this study is concerned with optimal control of NMR systems, specifically using the GRAPE algorithm . The task of optimal control reduces to finding the amplitudes within the control vector, , which control the evolution of the system from a defined initial state to a target state using an numerical optimization algorithm. Numerical optimization is concerned with finding and recognizing the minimum of an objective function.
State transfer quality is defined by the fidelity of the target state and the state of the system after a time , .
where the double hat, , denotes the superoperator and is the time-ordered exponential .
Using the Hamiltonian separation outlined in earlier, we can define the optimality condition as
 N. Khaneja, T. Reiss, C. Kehlet, T. Schulte-Herbruggen and S. J. Glaser, Journal of Magnetic Resonance 172, 296 (2005).
 I. Kuprov, Journal of Magnetic Resonance 233, 107 (2013).
 R. R. Ernst, G. Bodenhausen, and A. Wokaun, Principles of nuclear magnetic resonance in one and two dimensions, Vol. 14 (1991).