ToffoliDecomposer

class guppyft.decompose.ToffoliDecomposer[source]

Decomposes Toffoli gates into Clifford+T gates. Each Toffoli uses 7 T gates.

__eq__(other)

Return self==value.

__init__() → None
__repr__()

Return repr(self).

run(hugr: Hugr[Any], *, inplace: bool = True) → PassResult[source]

Run the pass to transform a HUGR, returning a PassResult.

See implement_pass_run() for a helper function to implement this method.

with_scope(scope: LocalScope | GlobalScope) → ComposablePass[source]

Set the scope configuration for the pass.

As of hugr 0.14.*, this configuration is only guidance, and may be ignored by the pass.

In the future, passes will be required to respect the scope configuration.