  Generation of a single photon or a pair of photons from a single emitter is
important for quantum information applications. Using the generating function
formalism we investigate the theory of a few photons on demand for the square
laser pulse and the rapid adiabatic following method. Exact theory and
numerical solutions are used to design control fields for a two level emitter,
which yield an optimal single or two photon source, under the constrains of
finite laser field strength and finite interaction time. Comparison to
experiments of Brunel et al, shows that the experiments were made close to
optimal conditions.
