Skip to main content
IBM Quantum Platform
번역 정보

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

BoxKey

class samplomatic.utils.BoxKey(instruction: CircuitInstruction)

GitHub

Bases: object

An immutable snapshot of an instruction that owns a box, suitable for comparison and hashing.

Instances of this class can be used, for example, as keys for a dictionary or as elements of a set. Mutating the original box does not mutate this class.

At construction time, this class computes a standardized, immutable form of the instruction, which is then used when comparing two instances of this class, or when hashing one. In particular, this form is chosen so that properties such as instruction order within topological layers of the box, or order of symmetric instructions like "cz" are not relevant; we do not want cz(0, 1) and cz(1, 0), for example, to result in inequality or distinct hashes.

Annotation comparison is unordered. It is assumed that all annotation types present are hashable (and consequently, immutable). Behavior is not defined when multiple equal annotations are present.

Parameters

instruction – The instruction to create an immutable snapshot of.

Raises

ValueError – If the instruction does not own a BoxOp.

Attributes Summary

칼럼 1
칼럼 2
hexdigestCross-platform, process independent hex digest of this box.

Attributes Documentation

hexdigest

Cross-platform, process independent hex digest of this box.

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