BasicSwap

class BasicSwap(*args, **kwargs)[source]

Map (with minimum effort) a DAGCircuit onto a coupling_map adding swap gates.

The basic mapper is a minimum effort to insert swap gates to map the DAG onto a coupling map. When a cx is not in the coupling map possibilities, it inserts one or more swaps in front to make it compatible.

BasicSwap initializer.

Parameters

coupling_map (CouplingMap) – Directed graph represented a coupling map.

Attributes

BasicSwap.is_analysis_pass

Check if the pass is an analysis pass.

BasicSwap.is_transformation_pass

Check if the pass is a transformation pass.

Methods

BasicSwap.name()

Return the name of the pass.

BasicSwap.run(dag)

Run the BasicSwap pass on dag.