StochasticSwap¶
- class StochasticSwap(*args, **kwargs)[source]¶
Map a DAGCircuit onto a coupling_map adding swap gates.
Uses a randomized algorithm.
Notes
Measurements may occur and be followed by swaps that result in repeated measurement of the same qubit. Near-term experiments cannot implement these circuits, so some care is required when using this mapper with experimental backend targets.
We do not use the fact that the input state is zero to simplify the circuit.
StochasticSwap initializer.
The coupling map is a connected graph
If these are not satisfied, the behavior is undefined.
- Parameters
coupling_map (CouplingMap) – Directed graph representing a coupling map.
trials (int) – maximum number of iterations to attempt
seed (int) – seed for random number generator
Attributes
Check if the pass is an analysis pass.
Check if the pass is a transformation pass.
Methods
Return the name of the pass.
StochasticSwap.run
(dag)Run the StochasticSwap pass on dag.