CNOT-Patel Synthesis for linear reversible functions

Header: tweedledum/algorithms/synthesis/cnot_patel.hpp

Parameters

struct cnot_patel_params

Parameters for cnot_patel.

Public Members

bool allow_rewiring = false

Allow rewiring.

bool best_partition_size = false

Search for the best parition size.

uint32_t partition_size = 1u

Partition size.

Algorithm

template<class Network, class Matrix>
Network tweedledum::cnot_patel(Matrix const &matrix, cnot_patel_params params = {})

CNOT Patel synthesis for linear circuits.

This algorithm is based on the work in [PMH08].

The following code shows how to apply the algorithm to the example in the original paper.

std::vector<uint32_t> rows = {0b000011,
                              0b011001,
                         0b010010,
                         0b111111,
                         0b111011,
                         0b011100};
bit_matrix_rm matrix(6, rows);
cnot_patel_params parameters;
parameters.allow_rewiring = false;
parameters.best_partition_size = false;
parameters.partition_size = 2u;
auto network = cnot_patel<netlist<io3_gate>>(matrix, parameters);

Parameters
  • matrix: The square matrix representing a linear reversible circuit.

  • params: The parameters that configure the synthesis process. See cnot_patel_params for details.

template<class Network, class Matrix>
void tweedledum::cnot_patel(Network &network, std::vector<io_id> const &qubits, Matrix const &matrix, cnot_patel_params params = {})

CNOT Patel synthesis for linear circuits.

This is the in-place variant of cnot_patel, in which the network is passed as a parameter and can potentially already contain some gates. The parameter qubits provides a qubit mapping to the existing qubits in the network.

Parameters
  • network: A quantum network

  • qubits: The subset of qubits the linear reversible circuit acts upon.

  • matrix: The square matrix representing a linear reversible circuit.

  • params: The parameters that configure the synthesis process. See cnot_patel_params for details.