  This article is aimed at extending the framework of optimal control
techniques to the situation where the control field values are restricted to a
finite set. We propose a generalization of the standard GRAPE algorithm suited
to this constraint. We test the validity and the efficiency of this approach
for the inversion of an inhomogeneous ensemble of spin systems with different
offset frequencies. It is shown that a remarkable efficiency can be achieved
even for a very limited number of discrete values. Some applications in Nuclear
Magnetic Resonance are discussed.
