Skip to main content
IBM Quantum Platform

samplomatic.utils

Utility functions.


Functions

Column 1
Column 2
count_unique_box_instructions(instructions)Return unique box instructions and their number of occurrences.
deprecate_arg(name, *, since[, ...])Return a decorator to indicate an argument has been deprecated in some way.
extend_annotations(circuit, *annotations)Return a new circuit with the given annotations appended to every box.
filter_annotations(circuit, keep)Return a new circuit keeping only annotations of the given type(s) on each box.
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).
map_annotations(circuit, fn)Return a new circuit where each box's annotations are replaced by fn(annotations).
replace_annotations(circuit, fn)Return a new circuit with annotations replaced according to a callable.
strip_annotations(circuit)Return a new circuit with all annotations removed from every box.
unbox(circuit)Return a circuit with all box operations inlined.
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

Column 1
Column 2
BoxKey(instruction)An immutable snapshot of an instruction that owns a box, suitable for comparison and hashing.
FrozenDict(*args, **kwargs)An immutable and hashable dictionary-like mapping.
Was this page helpful?
Report a bug, typo, or request content on GitHub.