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で行ってください。