ExhaustiveGateRemovalPass

class ExhaustiveGateRemovalPass(success_threshold=1e-08, cost=<bqskit.ir.opt.cost.functions.residuals.hilbertschmidt.HilbertSchmidtResidualsGenerator object>, instantiate_options={}, collection_filter=None, scoring_fn=None)[source]

Bases: BasePass

The ExhaustiveGateRemovalPass class.

Use instantiation to remove the most possible gates from the circuit.

__init__(success_threshold=1e-08, cost=<bqskit.ir.opt.cost.functions.residuals.hilbertschmidt.HilbertSchmidtResidualsGenerator object>, instantiate_options={}, collection_filter=None, scoring_fn=None)[source]

Construct a ExhaustiveGateRemovalPass.

Parameters:
  • success_threshold (float) – The distance threshold that determines successful termintation. Measured in cost described by the hilbert schmidt cost function. (Default: 1e-8)

  • cost (CostFunction | None) – The cost function that determines successful removal of a gate. (Default: HilbertSchmidtResidualsGenerator())

  • (dict[str (instantiate_options) – Any]): Options passed directly to circuit.instantiate when instantiating circuit templates. (Default: {})

  • collection_filter (Callable[[Operation], bool] | None) – A predicate that determines which operations should be attempted to be removed. Called with each operation in the circuit. If this returns true, this pass will attempt to remove that operation. Defaults to all operations.

  • scoring_fn (Callable[[Circuit], float]) – A scoring function for the circuits to determine which one to select. Defaults to gate counts weighted by their size.

Attributes

name

The name of the pass.

Methods

execute(*args, **kwargs)

Map a function over iterable arguments in parallel.

get_connectivity(_, data)

Retrieve the current connectivity of the circuit.

get_model(_, data)

Retrieve the machine model from the data dictionary.

get_placement(_, data)

Retrieve the logical to physical qubit map from the data dictionary.

get_target(_, data)

Retrieve the target from the data dictionary.

in_parallel(data)

Return true if pass is being executed in a parallel.

run(circuit, data)

Perform the pass's operation, see BasePass for more.