  We present an open loop (bang-bang) scheme to control decoherence in a
generic one-qubit quantum gate and implement it in a realistic simulation. The
system is consistently described within the spin-boson model, with interactions
accounting for both adiabatic and thermal decoherence. The external control is
included from the beginning in the Hamiltonian as an independent interaction
term. After tracing out the environment modes, reduced equations are obtained
for the two-level system in which the effects of both decoherence and external
control appear explicitly. The controls are determined exactly from the
condition to eliminate decoherence, i.e. to restore unitarity. Numerical
simulations show excellent performance and robustness of the proposed control
scheme.
