  This paper addresses the question how to implement a desired two-qubit gate U
using a given tunable two-qubit entangling interaction H_int. We present a
general method which is based on the K_1 A K_2 decomposition of unitary
matrices in SU(4) to calculate analytically the smallest number of two-qubit
gates U_int [based on H_int] and single-qubit rotations, and the explicit
sequence of these operations that are required to implement U. We illustrate
our protocol by calculating the implementation of (1) the transformation from
standard basis to Bell basis, (2) the CNOT gate, and (3) the quantum Fourier
transform for two kinds of interaction - Heisenberg exchange interaction and
quantum inductive coupling - and discuss the relevance of our results for
solid-state qubits.
