cirq_google.transformers.target_gatesets.sycamore_gateset.merge_swap_rzz_and_2q_unitaries

Merges 2-qubit connected components and adjacent cirq.SWAP and cirq.ZZPowGate gates.

Does the following two transformations, in that order:

  1. Merges adjacent occurrences of cirq.SWAP and cirq.ZZPowGate into a cirq.CircuitOperation tagged with merged_swap_rzz_tag.
  2. Merges connected components of 1 and 2 qubit unitaries in the circuit into a cirq.CircuitOperation tagged with merged_2q_component_tag, ignoring the newly introduced tagged circuit operations added in Step-1.

circuit Input circuit to transform. It will not be modified.
context cirq.TransformerContext storing common configurable options for transformers.
merged_swap_rzz_tag Tag to apply on newly introduced circuit operations wrapping adjacent cirq.SWAP and cirq.ZZPowGates.
merged_2q_component_tag Tag to apply on newly introduced circuit operations wrapping connected components of 1 and 2 qubit unitaries.
intermediate_result_tag If specified, the tag is added to newly introduced both the newly introduced circuit operations encapsulating swap_rzz or 2q connected component.

Copy of the transformed input circuit.

ValueError If merged_2q_component_tag and merged_swap_rzz_tag are equal.