  In a Josephson phase qubit the coherent manipulations of the computational
states are achieved by modulating an applied ac current, typically in the
microwave range. In this work we show that it is possible to find optimal
modulations of the bias current to achieve high-fidelity gates. We apply
quantum optimal control theory to determine the form of the pulses and study in
details the case of a NOT-gate. To test the efficiency of the optimized pulses
in an experimental setup, we also address the effect of possible imperfections
in the pulses shapes, the role of off-resonance elements in the Hamiltonian,
and the effect of capacitive interaction with a second qubit.
