  We present the Quantum Virtual Machine (QVM), an end-to-end generic system
for scalable execution of large quantum circuits with high fidelity on noisy
and small quantum processors (QPUs) by leveraging gate virtualization. QVM
exposes a virtual circuit intermediate representation (IR) that extends the
notion of quantum circuits to incorporate gate virtualization. Based on the
virtual circuit as our IR, we propose the QVM compiler - an extensible compiler
infrastructure to transpile a virtual circuit through a series of modular
optimization passes to produce a set of optimized circuit fragments. Lastly,
these transpiled circuit fragments are executed on QPUs using our QVM runtime -
a scalable and distributed infrastructure to virtualize and execute circuit
fragments on a set of distributed QPUs. We evaluate QVM on IBM's 7- and
27-qubit QPUs. Our evaluation shows that using our system, we can scale the
circuit sizes executable on QPUs up to double the size of the QPU while
improving fidelity by 4.7$\times$ on average compared to larger QPUs and that
we can effectively reduce circuit depths to only 40\% of the original circuit
depths.
