Skip to content

define LinearFunction class and collect blocks of gates that make a LinearFunction #7238

@ajavadia

Description

@ajavadia

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.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions