  We develop an efficient and general method for optimizing the microwave field
that achieves magnetization switching with a smaller static field. This method
is based on optimal control and renders an exact solution for the 3D microwave
field that triggers the switching of a nanomagnet with a given anisotropy and
in an oblique static field. Applying this technique to the particular case of
uniaxial anisotropy, we show that the optimal microwave field, that achieves
switching with minimal absorbed energy, is modulated both in frequency and in
magnitude. Its role is to drive the magnetization from the metastable
equilibrium position towards the saddle point and then damping induces the
relaxation to the stable equilibrium position. For the pumping to be efficient,
the microwave field frequency must match at the early stage of the switching
process the proper precession frequency of the magnetization, which depends on
the magnitude and direction of the static field. We investigate the effect of
the static field (in amplitude and direction) and of damping on the
characteristics of the microwave field. We have computed the switching curves
in the presence of the optimal microwave field. The results are in qualitative
agreement with micro-SQUID experiments on isolated nanoclusters. The strong
dependence of the microwave field and that of the switching curve on the
damping parameter may be useful in probing damping in various nanoclusters.
