This application concerns a computer-implemented method for compiling an input unitary acting on a set of logical qubits to an output
quantum circuit operable on a
quantum system comprising a plurality of output qubits (1), wherein the output qubits (1) of the
quantum system are arranged in accordance with a
connectivity mesh (11), wherein nodes (111) of the
connectivity mesh (11) represent possible sites for the output qubits (1) of the
quantum system and each edge (112) of the
connectivity mesh (11) indicates that quantum interactions between the output qubits (1) of the
quantum system connected by one of the edges (112) are possible, comprising the following steps: providing the connectivity mesh (11) of the
quantum system; assigning an index to each of the logical qubits; extracting a set of target labels (2) from the input unitary, wherein the target labels (2) correspond to a set comprising at least one of the indices of the logical qubits; compiling circuit building blocks (4) implementing a subset of the target labels (2), wherein the circuit building blocks (4) comprise body path gates (41) and / or leg gates (42) acting on the output qubits (1), wherein compiling the circuit building blocks (4) comprises: defining a tree (3) comprising a subset of edges (112) and a subset of nodes (111) of the connectivity mesh (11), wherein the tree (3) comprises a body (31) with at least one body node (1111) representing
a site for an output
qubit (1), wherein the body (31) comprises at least two output qubits (1) at two body nodes (1111) and at least one path (6) connecting all body nodes (1111) of the body (31) and / or at least one leg (32) with at least one leg node (1112) representing
a site for an output
qubit (1), wherein the at least one leg node (1112) is connected by an edge (112) with at least one body node (1111); adding a body path gate (41) to the output
quantum circuit for each body node (1111) along the at least one path (6) and / or adding a leg path gate (42) to the output
quantum circuit for each leg node (1112); adding a single-
qubit gate (43) to the output
quantum circuit for at least one of the target labels (2) of the input unitary, wherein the single-qubit gate acts on the output qubit (1) and at the moment on which the target
label (2) is implemented due to the gates of the circuit building blocks (4).