Patent attributes
Embodiments are provided for compilation of a quantum program. In some embodiments, a system can include a processor that executes computer-executable components stored in memory. The computer-executable components can include an identification component that selects a subgraph that is common among a first commutation directed acyclic graph (DAG) and a second commutation DAG. The subgraph has an upper-bound size that is greater than a threshold size. The first commutation DAG represents a first quantum circuit of a set of quantum circuits and the second commutation DAG represents a second quantum circuit of the set of quantum circuits. The computer-executable components also include a compilation component that compiles a quantum subcircuit corresponding to the subgraph. The computer-executable components further include a configuration component that replaces the quantum subcircuit in the first quantum circuit with the compiled quantum subcircuit.