Skip to content

Support InjectNoise annotations with site='before' #33

Description

@aeddins-ibm

site was added recently in Samplomatic: https://github.com/Qiskit/samplomatic/releases/tag/0.16.0

We can probably just xor the site attribute of each Box with the backwards argument of compute_bounds used here

if backwards:
# NOTE: we unroll the BoxOp immediately to allow gates contained within the box be
# pruned by the LightCone pass
for inst in circ_inst.operation.body[::-1]:
_handle_circuit_instruction(inst)

and here
if not backwards:
# NOTE: we unroll the BoxOp immediately to allow gates contained within the box be
# pruned by the LightCone pass
for inst in circ_inst.operation.body[::-1]:
_handle_circuit_instruction(inst)

We might be able to get rid of the backwards argument in favor of updating (or monkeypatching) the behavior of inverse() to toggle site between "before" and "after".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions