Skip to main content
IBM Quantum Platform
Informations sur la traduction

D'autres traductions de cette page seront bientôt disponibles.

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

Chronique « 1 »
Chronique « 2 »
hexdigestCross-platform, process independent hex digest of this box.

Attributes Documentation

hexdigest

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

Cette page a-t-elle été utile ?
Signaler un bogue, une coquille ou proposer du contenu sur GitHub.