MergeOneParameterGroupGates#

Module: iqm.cirq_iqm.optimizers

class iqm.cirq_iqm.optimizers.MergeOneParameterGroupGates(post_clean_up: Callable[[Sequence[cirq.Operation]], cirq.OP_TREE] = <function PointOptimizer.<lambda>>)#

Bases: PointOptimizer

Merges adjacent gates belonging to the same parametrized gate family.

The merged gates have to act on the same sequence of qubits. This optimizer only works with gate families that are known to be one-parameter groups.

For now, all the families are assumed to be periodic with a period of 4.

Attributes

GATE_MERGING_TOLERANCE

ONE_PARAMETER_FAMILIES

PERIOD

Methods

optimization_at

Describes how to change operations near the given location.

Parameters:

post_clean_up (Callable[[Sequence[cirq.Operation]], cirq.OP_TREE])

optimization_at(circuit: Circuit, index: int, op: Operation) PointOptimizationSummary | None#

Describes how to change operations near the given location.

Parameters:
  • circuit (Circuit) – The circuit to improve.

  • index (int) – The index of the moment with the operation to focus on.

  • op (Operation) – The operation to focus improvements upon.

Returns:

A description of the optimization to perform, or else None if no change should be made.

Return type:

PointOptimizationSummary | None

Inheritance

Inheritance diagram of iqm.cirq_iqm.optimizers.MergeOneParameterGroupGates