qat.synthopline.initial_mapping.greedy_mapping

qat.synthopline.initial_mapping.greedy_mapping(circuit, graph, remap_circuit=False, inplace=False)

Uses a first-serve approach to allocate positions to the qubits. This this done by looking at the first entangling gates of the circuit and trying to align them with the interaction graph’s edges.

If the graph is weighted, weights are interpreted as gate fidelity and will be used to order the edges.

Parameters
  • circuit (Circuit) – a qlm circuit

  • graph (nx.Graph) – a networkx graph

  • remap_circuit (optional, bool) – if set to True, remaps the circuit. Default to True.

  • inplace (optional, bool) – if set to True, the circuit is remapped in place, thus modifying it. Default to True.

Returns

a mapping of the logical qubits to the physical qubits and a remapped circuit. If remap_circuit is set to False, the returned circuit will be the input circuit.

Return type

dict, Circuit