  Direct minimisation of a cost function can in principle provide a versatile
and highly controllable route to computational hologram generation. However, to
date iterative Fourier transform algorithms have been predominantly used. Here
we show that the careful design of cost functions, combined with numerically
efficient conjugate gradient minimisation, establishes a practical method for
the generation of holograms for a wide range of target light distributions.
This results in a guided optimisation process, with a crucial advantage
illustrated by the ability to circumvent optical vortex formation during
hologram calculation. We demonstrate the implementation of the conjugate
gradient method for both discrete and continuous intensity distributions and
discuss its applicability to optical trapping of ultracold atoms.
