  Quantum circuit transformation aims to produce equivalent circuits while
optimizing for various aspects such as circuit depth, gate count, and
compatibility with modern Noisy Intermediate Scale Quantum (NISQ) devices.
There are two techniques for circuit transformation. The first is a rule-based
approach that greedily cancels out pairs of gates that equate to the identity
unitary operation. Rule-based approaches are used in quantum compilers such as
Qiskit, tket, and Quilc. The second is a search-based approach that tries to
find an equivalent quantum circuit by exploring the quantum circuits search
space. Search-based approaches typically rely on machine learning techniques
such as generative models and Reinforcement Learning (RL). In this work, we
propose AltGraph, a novel search-based circuit transformation approach that
generates equivalent quantum circuits using existing generative graph models.
We use three main graph models: DAG Variational Autoencoder (D-VAE) with two
variants: Gated Recurrent Unit (GRU) and Graph Convolutional Network (GCN), and
Deep Generative Model for Graphs (DeepGMG) that take a Direct Acyclic Graph
(DAG) of the quantum circuit as input and output a new DAG from which we
reconstruct the equivalent quantum circuit. Next, we perturb the latent space
to generate equivalent quantum circuits some of which may be more compatible
with the hardware coupling map and/or enable better optimization leading to
reduced gate count and circuit depth. AltGraph achieves on average a 37.55%
reduction in the number of gates and a 37.75% reduction in the circuit depth
post-transpiling compared to the original transpiled circuit with only 0.0074
Mean Squared Error (MSE) in the density matrix.
