AddInjectNoise¶
- class samplomatic.transpiler.passes.AddInjectNoise(*args, **kwargs)[source]¶
Bases:
TransformationPassInserts
InjectNoiseannotations to all the unique boxes with twirling annotation.This pass finds boxes matching the conditions implied by
targets, adds inject noise to their annotations, and replaces them with new boxes with the updated annotations.- Parameters:
strategy – The noise injection strategy.
site – Whether to inject the noise before or after the associated hard content.
overwrite – Whether to overwrite the inject noise annotations that are already present in the circuit.
prefix_ref – A prefix to all the
refgenerated by this class.prefix_modifier_ref – A prefix to all the
modifier_refsgenerated by this class.targets –
The class of annotated boxes to target. The supported values are:
'none'to avoid annotating boxes of any kind.'gates'to target only the twirl-annotated boxes that contain entanglers.'measures'to target only the twirl-annotated boxes that own classicalregisters.
'all'to target all the twirl-annotated boxes that contain entanglersand/or own classical registers.
Note
The
BoxKey()toprefix_ref. This means this pass assigns boxes with the sameBoxKeythe samereffrom circuit to circuit.Note
When using the
'uniform_modification'strategy, theOn the other hand, the `()’individual_modification’` strategy appends the value of a counter tomodifier_refthat is incremented following DAG traversal order.Methods Summary
run(dag)Run a pass on the DAGCircuit.
Methods Documentation
- run(dag: DAGCircuit) DAGCircuit[source]¶
Run a pass on the DAGCircuit. This is implemented by the pass developer.
- Parameters:
dag – the dag on which the pass is run.
- Raises:
NotImplementedError – when this is left unimplemented for a pass.