  We study the problem of finding the best approximate circuit that is the
closest (in some pertinent metric) to a target circuit, and which satisfies a
number of hardware constraints, like gate alphabet and connectivity. We look at
the problem in the CNOT+rotation gate set from a mathematical programming
standpoint, offering contributions both in terms of understanding the
mathematics of the problem and its efficient solution. Among the results that
we present, we are able to derive a 14-CNOT 4-qubit Toffoli decomposition from
scratch, and show that the Quantum Shannon Decomposition can be compressed by a
factor of two without practical loss of fidelity.
