AC/DC: Automated Compilation for Dynamic Circuits
Dynamic quantum circuits incorporate mid-circuit measurements (MCMs) and feed-forward operations are crucial for manipulating quantum information. They have been broadly used in quantum error correction and quantum teleportation. Recently, they are utilized to prepare certain states and long-range entangling gates as well as reduce resource overhead in quantum algorithms. In this paper, we present AC/DC, a novel Automated Compilation framework for generating Dynamic quantum Circuits that prepare any unitary operators or states, leveraging numerical optimization-based circuit synthesis methods. The first contribution is introducing optimization objective functions incorporating MCMs and feed-forward operations. The second contribution is embedding these into a popular open-source quantum circuit synthesis framework. We demonstrate generating dynamic circuits for long range entangling gates, circuit optimization, lattice simulations, and state preparation, with validation through simulation and quantum hardware. Furthermore, we perform a noise analysis to assess the impact of MCM and gate errors, identifying scenarios where dynamic circuits provide significant benefits. The dynamic circuits generated by our framework show substantial improvements in reducing circuit depth and, in some cases, the number of gates. To our knowledge, this is the first practical procedure to generate dynamic quantum circuits, paving the way for enhanced circuit generation and optimization methods for near-term quantum computers.