Direct Toffoli (DT) decomposition¶
Header: tweedledum/algorithms/decomposition/dt.hpp
Algorithm¶
-
template <typename Network>
Networktweedledum
::
dt_decomposition
(Network const &src)¶ Direct Toffoli (DT) decomposition.
Decomposes all Multiple-controlled Toffoli gates with 2, 3 or 4 controls into Clifford+T. Also decompose all Multiple-controlled Z gates with 2 controls into Clifford+T. This may introduce one additional helper qubit called ancilla.
These Clifford+T represetations were obtained using techniques inspired by [Mas16] and given in [AMMR13]
Required gate functions:
foreach_control
foreach_target
num_controls
Required network functions:
add_gate
foreach_cqubit
foreach_cgate
rewire
rewire_map