  We consider a two-level system with a fixed energy spacing (detuning) between
the two levels and a single transverse control field which can take values
between zero and a maximum amplitude. Using Pontryagin's maximum principle, we
completely solve the problem of generating in minimum time a uniform
superposition of the two quantum states when starting from one of them, for all
the values of the ratio between the maximum control amplitude and the detuning.
For each value of this ratio we find the optimal pulse sequence to have the
bang-bang form, and calculate the durations of the pulses composing it. The
suggested framework is not only restricted to the problem at hand, but it can
be also exploited in the problem of fast charging a quantum battery based on a
two-level system, as well as for the optimization of pulse-sequences used for
the controlled preparation of the excited state in a quantum emitter, which is
a prerequisite for its usage as a single-photon source.
