You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A generalization of #7236: collect all blocks of gates consisting of CX and SWAP (and multi-controlled X). Then this n-qubit block can efficiently be represented by an nxn matrix, which encodes a "linear function". There are then known ways of synthesizing this linear function (one of them is in qiskit under the patel-markov-hayes algorithm).
(See fig 2 here and the matrix A above it for an example: https://web.eecs.umich.edu/~imarkov/pubs/jour/qic08-cnot.pdf)
We need:
a) a new class that represents such nxn linear functions and can be inserted into the circuit as an Operation (#7087 )
b) a compiler pass that can collect occurences of above gates and replace them by a LinearFunction
We will add a few different synthesis methods for the LinearFunctions later.