  A new method for controlling harmonic generation, in the framework of quantum
optimal control theory (QOCT), is developed. The problem is formulated in the
frequency domain using a new maximization functional. The relaxation method is
used as the optimization procedure. The new formulation is generalized to other
control problems with requirements in the frequency domain. The method is
applied to several simple problems. The results are analysed and discussed.
General conclusions on harmonic generation mechanisms are obtained.
