Skip to main content
IBM Quantum Platform
번역 정보

이 페이지의 추가 언어 번역이 곧 제공될 예정입니다.

GroupGatesIntoBoxes

class samplomatic.transpiler.passes.GroupGatesIntoBoxes(*args, **kwargs)

GitHub

Bases: TransformationPass

Collect the two-qubit gates in a circuit inside left-dressed boxes.

This pass collects all 2-qubit gates in the input circuit into left-dressed boxes. To assign the gates to these boxes, it uses a greedy collection strategy. By default (strategy="asap") it places each gate in the earliest possible box. When strategy="alap" it places each gate in the latest possible box.

Note

Barriers and boxes that are present in the input circuit act as delimiters. This means that when the pass encounters one of these delimiters acting on a subset of qubits, it immediately terminates the collection for those qubits and flushes the collected gates into a left-dressed box. The delimiters themselves remain present in the output circuit, but are placed outside of any boxes.

Note

Measurements and resets also act as delimiters.

Note

The circuits returned by this pass may not be buildable. To make them buildable, one can either use AddTerminalRightDressedBoxes to add right-dressed “collector” boxes.

Methods Summary

칼럼 1
칼럼 2
run(dag)Collect the operations in the dag inside left-dressed boxes.

Methods Documentation

run

run(dag: DAGCircuit) → DAGCircuit

GitHub

Collect the operations in the dag inside left-dressed boxes.

The collection strategy undertakes the following steps:

  • Loop through the DAG’s op nodes in topological order (ASAP) or reverse topological order (ALAP).
  • Group together two-qubit gate nodes that need to be placed in the same box.
  • Whenever a node can be placed in more than one group, place it in the earliest possible group (ASAP) or the latest possible group (ALAP).
  • When looping is complete, replace each group with a box.
이 페이지가 도움이 되었습니까?
GitHub에서 버그, 오타를 보고하거나 컨텐츠를 요청하십시오.