Skip to main content
IBM Quantum Platform
번역 정보

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

find_unique_box_instructions

samplomatic.utils.find_unique_box_instructions(instructions: Iterable[CircuitInstruction], undress_boxes: bool = True, normalize_annotations: Callable[[Iterable[Annotation]], list[Annotation]] | None = None) → list[CircuitInstruction]

GitHub

Return instructions that contains unique boxes.

This function iterates through the given instructions, identifying those that contain a BoxOp operation and comparing them based on their content and annotations. It returns a list of instructions that contains unique boxes. Optionally, it allows undressing the boxes before comparison, as well as normalizing their annotations to ignore irrelevant fields.

Parameters

  • instructions – The instructions to iterate through.
  • undress_boxes – Whether to call the undress_box() method on each box before comparison.
  • normalize_annotations – A callable mapping annotations to annotations, which is applied to the annotations of each box before comparison. If None, it discards every annotation that is not of type Twirl and InjectNoise, and it resets the modifier_ref field of InjectNoise annotations to the default value.

Returns

A list of unique instructions.

이 페이지가 도움이 되었습니까?
GitHub에서 버그, 오타를 보고하거나 컨텐츠를 요청하십시오.