CNOT-Patel Synthesis for linear reversible functions¶
Header: tweedledum/algorithms/synthesis/cnot_patel.hpp
Algorithm¶
-
template<class
Network
, classMatrix
>
Networktweedledum
::
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. Seecnot_patel_params
for details.
-
template<class
Network
, classMatrix
>
voidtweedledum
::
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 parameterqubits
provides a qubit mapping to the existing qubits in the network.- Parameters
network
: A quantum networkqubits
: 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. Seecnot_patel_params
for details.