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".
sitewas added recently in Samplomatic: https://github.com/Qiskit/samplomatic/releases/tag/0.16.0We can probably just xor the
siteattribute of each Box with thebackwardsargument ofcompute_boundsused hereqiskit-addon-slc/qiskit_addon_slc/bounds/commutator_bounds.py
Lines 186 to 190 in 65a35d6
and here
qiskit-addon-slc/qiskit_addon_slc/bounds/commutator_bounds.py
Lines 222 to 226 in 65a35d6
We might be able to get rid of the
backwardsargument in favor of updating (or monkeypatching) the behavior ofinverse()to togglesitebetween "before" and "after".