samplomatic.utils

Utility functions.

Functions

deprecate_arg(name, *, since[, ...])

Return a decorator to indicate an argument has been deprecated in some way.

find_unique_box_instructions(instructions[, ...])

Return instructions that contains unique boxes.

get_annotation(box, annotation_type)

Return a box's first annotation of the given type(s).

undress_box(box)

Return a box equivalent to box, stripped of the single-qubit gates on the dressing side.

validate_literals(*arg_names)

Return a decorator to validate function arguments against literal type annotations.

Classes

BoxKey(instruction)

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