qat.synthopline.initial_mapping.frequency_mapping

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

Uses a greedy qubit positioning by looking at how often qubits interact in the circuit.

The algorithms starts by computing how many time each pair of qubit will need to interact and uses this information to perform a greedy allocation of the qubits.

If the graph is weighted, weights are interpreted as gate fidelity and will be used to sort 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, this 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