dqcnac.compiler.local_manager module
Local compilation manager module.
- class dqcnac.compiler.local_manager.LocalManager(distributed_circuit: qiskit.dagcircuit.DAGCircuit, network: Network, partitions: dict[qiskit.circuit.Qubit, int], mapper: str = 'dense', router: str = 'basic')[source]
Bases:
objectA class to manage local mapping and routing.
- __init__(distributed_circuit: qiskit.dagcircuit.DAGCircuit, network: Network, partitions: dict[qiskit.circuit.Qubit, int], mapper: str = 'dense', router: str = 'basic')[source]
Initialize the local manager
- Parameters:
distributed_circuit – an already distributed circuit
network – the network over which the circuit has been distributed
partitions – a mapping from qubits to network nodes ids
mapper – the local mapper to be used
router – the local router to be used
- static add_edge(coupling_map: qiskit.transpiler.CouplingMap, src: int, dst: int, weight: float) None[source]
Add a directed weighted edge to the coupling_map between src and dst
- Parameters:
coupling_map – a coupling map
src – the source node
dst – the destination node
weight – the weight of the edge
- run() tuple[qiskit.dagcircuit.DAGCircuit, dict[int, qiskit.circuit.Qubit], dict[int, tuple[str, int]], dict][source]
Run the local manager
Returns: the compiled circuit, a mapping from the network physical qubits and circuit virtual qubits, a mapping from network physical qubits to physical qubits of each node coupling map