1 Combining SWAPs and Remote CNOT Gates for Quantum Circuit Transformation Philipp Niemann *† , Luca Mueller * , and Rolf Drechsler *† * Department of Computer Science, University of Bremen, Bremen, Germany † Cyber-Physical Systems, DFKI GmbH, Bremen, Germany {pniemann,lucam,drechsler}@uni-bremen.de Abstract—Quantum computers offer enormous speed advan- tages over their classical counterparts. Still, optimization on quantum circuits is necessary to further increase their potential. Additionally, physical realizations of quantum computers place restrictions on quantum circuits, regarding the available quantum gates. In order to satisfy these restrictions, non-native gates need to be expressed as an equivalent cascade of natively available quantum gates which induces a mapping overhead. Two complementary approaches to this problem are to move around the qubits (using SWAP gates) or to apply so-called remote gates, i.e. pre-computed cascades of native gates which keep the qubit placement. In this paper, we explore how combinations of movements and remote gates can be employed to reduce the required overhead regarding the number of native gates as well as the circuit depth. We also discuss ways to find out which qubits to address with the movements in order to optimize these metrics. Our general evaluation is supplemented by evaluations on two IBM quantum computer architectures to show how quantum circuits can be optimized by the presented patterns. I. I NTRODUCTION Quantum computers [1] promise to have enormous com- putational power and, thus, to solve relevant problems sig- nificantly faster than their classical counterparts. In recent years, large efforts have been put on their development. While the mathematical foundations have been widely explored in the last decades and meaningful quantum algorithms have been proposed, the physical realization currently provides the biggest obstacle preventing the widespread use of quantum computers. Driven by big players like IBM, Google, and Intel, more and more powerful quantum computer architectures have been presented in recent years with increasing quantity and quality of the so-called qubits—the basic computational entities in quantum computing. While there are several different ap- proaches regarding the employed technology to realize qubits, one of the physical constraints that all proposed architectures have in common is the limited availability of quantum gates. Typically, multi-qubit gates are much harder to realize than single-qubit gates and in many cases there is only one multi- qubit gate natively available, namely the two-qubit controlled- NOT (CNOT) gate. This does not restrict the computational power of the architectures in general, since there are universal gate libraries consisting of the CNOT gate and single-qubit gates only, e.g. the Clifford+T library [2] which allow to realize arbitrary quantum computations. However, the CNOT is typically only available on a small subset of physically adjacent qubit pairs. Consequently, computations that require CNOT operations on distant qubits can become quite complex. Fortunately, there are ways to simulate these logical CNOTs at the physical level and transform a quantum circuit that contains non-native CNOTs to a quantum circuit containing only native gates and, thus, being ready for the execution on the targeted quantum architecture. Many approaches to find efficient CNOT implementations have been suggested, e.g. in [3]–[10]. The underlying idea of most of these solutions is to use so-called SWAP gates in order move distant qubits to adjacent positions where a native CNOT gate can be applied. Alternatively, there have been proposals to use remote CNOTs, i.e. realize non-native CNOTs using pre-computed, optimized sequences of native gates (sometimes also referred to as templates) [5]. Recently, there has been a proposal to combine SWAPs with remote gates in the mapping of high-level reversible circuits [11] which demonstrated that this approach can outperform state- of-the-art mapping approaches regarding the required gate overhead. In fact, most approaches focus on the gate overhead that is introduced, but also the resulting circuit depth shall be considered, since a smaller depth leads to a shorter execution time. Due to the short decoherence time of the qubits, this is also a rather limited resource. In this paper, we explore how a combination of SWAPs and remote gates can be adapted to the realization of non- native CNOT gates. More precisely, we explore combinations of qubit movements and remote CNOTs with a focus on reducing circuit depth without (substantially) increasing the gate overhead. We come up with patterns which combine the advantages of SWAPs (i.e., a smaller depth) and remote gates (i.e., less gate overhead). We determine cost- and depth- optimal patterns for two IBM quantum computer architectures and evaluate their impact on the transformation of entire quantum circuits. The main differences to [11] are: • This work does not treat SWAPs as atomic operations, but explicitly makes use of optimizations at the quantum circuit level that only become possible when SWAPs are considered as cascades of CNOT (and Hadamard) gates. • We restrict to the realization of non-native CNOT gates, while [11] is concerned with the realization of high-level gates (so-called Multiple-Controlled Toffoli gates) which are a generalization of CNOT gates. The patterns used in this paper can hardly be generalized to these gates.