PauliGraphResynthesis

class tket.passes.PauliGraphResynthesis(window_size=None, pool_size=None, top_up_size=None, seed=None, parallel_mode=ParallelMode.Auto, _scope=GlobalScope.PRESERVE_PUBLIC, t_optimization=False, ancilla_budget=None)[source]

Bases: ComposablePass

An optimisation pass that resynthesizes a Clifford + Rz circuit by converting it to a Pauli Graph and applying various optimisation techniques such as: - phase folding - optional phase polynomial resynthesis for T count reduction - a synthesis algorithm from Pauli Graph to Clifford + Rz aimed at reducing the number of 2 qubit gates

Rotation angles must be numeric as symbolic angles are not supported currently.

Parameters: - window_size: Sets the size of the sliding window used for lookahead during synthesis. Must be positive. - pool_size: Sets the number of candidate gates to maintain in the pool. Must be positive. - top_up_size: Sets the number of candidate gates to add after each TQE gate. Must be positive. - seed: Sets the random seed used to sample candidate gates. Must be non-negative. - parallel_mode: A ParallelMode for candidate synthesis.

Defaults to ParallelMode.Auto.

  • t_optimization: Enable T count optimization. Defaults to False and requires a Clifford + T circuit when enabled.

  • ancilla_budget: Number of ancillas to allocate per outer circuit for T optimization. Must be non-negative. None uses the largest Hadamard count among the selected dataflow regions. Ignored when t_optimization is False.

__call__(hugr, *, inplace=True)

Call the pass to transform a HUGR, returning a Hugr.

Return type:

Hugr

__init__(window_size=None, pool_size=None, top_up_size=None, seed=None, parallel_mode=ParallelMode.Auto, _scope=GlobalScope.PRESERVE_PUBLIC, t_optimization=False, ancilla_budget=None)
ancilla_budget: int | None = None
property name: str

Returns the name of the pass.

parallel_mode: ParallelMode = 'Auto'
pool_size: int | None = None
run(hugr, *, inplace=True)[source]

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

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

Return type:

PassResult

seed: int | None = None
t_optimization: bool = False
then(other)

Perform another composable pass after this pass.

Return type:

ComposablePass

top_up_size: int | None = None
window_size: int | None = None
with_scope(scope)[source]

Set the scope of this pass and return self.

Return type:

PauliGraphResynthesis