Quantum optimal control theory allows to design accurate quantum gates. We employ it to design high-fidelity two-bit gates for Josephson charge qubits in the presence of both leakage and noise. Our protocol considerably increases the fidelity of the gate and, more important, it is quite robust in the disruptive presence of 1/f noise. The improvement in the gate performances discussed in this work (errors ∼ 10 −3 ÷ 10 −4 in realistic cases) allows to cross the fault tolerance threshold.One of the fundamental requirements of any proposed implementation of quantum information processing is the ability to perform reliably single-and two-qubit gates. In the last decade there has been an intense experimental and theoretical activity to realize suitable schemes for quantum gates in a variety of physical systems as NMR, ion traps, cold atoms, solid state devices, just to mention a few [1]. Typically, as compared to single-bit gates, two-qubit gates are much more difficult to realize. The interaction between the qubits is more delicate to control while preserving coherence. Furthermore twobit gates are more sensitive to imperfections, noise and, whenever present, leakage to non-computational states. It is therefore of crucial importance to find strategies to alleviate all these problems. A powerful tool to realize accurate gates is quantum optimal control [2], already applied for example to quantum computation with cold atoms in an optical lattice [3]. Aim of the present work is to apply optimal control to the realm of solid-state quantum computation, more specifically to qubits realized with superconducting nanocircuits. Josephson-junction qubits [4,5] are considered among the most promising candidates for implementing quantum protocols in solid state devices. Due to their design flexibility, several different versions of superconducting (charge, flux, phase) qubits have been theoretically proposed and experimentally realized in a series of beautiful experiments [6]. Several schemes for qubit coupling have also been proposed (see the reviews [4,5]). On the experimental side, coupled qubits have been realized in the charge [7,8] and in the phase [9] regimes where a CNOT and a √ iSWAP gates have been implemented respectively. In the experiment of Steffen et al.[9] the measured fidelity was of the order of 75% increasing up to 87% after accounting for measurement errors. Further improvements in the accuracy rely on achieving larger decoherence times. In the experiment of Yamamoto et al.[8] a direct determination of the fidelity from the data was not possible, but it has been estimated to be ∼ 80%. Advances in fabrication techniques will play a crucial role in achieving accurate quantum gates, however as the thresholds for fault tolerant computation [10] are quite demanding, gate optimization is a powerful tool for a considerable improvement of their accuracy. A major open question is the resilience of optimized operations to imperfections affecting a real laboratory implementation, including: leakage to states outside the ...