mqt.qmap.plugins.qiskit.sc.compile

Compile a circuit.

Functions

compile_(→ tuple[qiskit.circuit.QuantumCircuit, ...)

Interface to the MQT QMAP tool for mapping quantum circuits.

Module Contents

compile_(circ: mqt.qmap.types.CircuitInputType, arch: str | mqt.qmap.sc.Arch | mqt.qmap.sc.Architecture | BackendV2 | None, calibration: str | Target | None = None, method: mqt.qmap.sc.Method = Method.heuristic, heuristic: mqt.qmap.sc.Heuristic = Heuristic.gate_count_max_distance, initial_layout: mqt.qmap.sc.InitialLayout = InitialLayout.dynamic, iterative_bidirectional_routing_passes: int | None = None, layering: mqt.qmap.sc.Layering = Layering.individual_gates, automatic_layer_splits_node_limit: int | None = 5000, early_termination: mqt.qmap.sc.EarlyTermination = EarlyTermination.none, early_termination_limit: int = 0, lookahead_heuristic: mqt.qmap.sc.LookaheadHeuristic | None = LookaheadHeuristic.gate_count_max_distance, lookaheads: int = 15, lookahead_factor: float = 0.5, encoding: mqt.qmap.sc.Encoding = Encoding.commander, commander_grouping: mqt.qmap.sc.CommanderGrouping = CommanderGrouping.fixed3, swap_reduction: mqt.qmap.sc.SwapReduction = SwapReduction.coupling_limit, swap_limit: int = 0, include_wcnf: bool = False, use_subsets: bool = True, subgraph: set[int] | None = None, pre_mapping_optimizations: bool = True, post_mapping_optimizations: bool = True, add_measurements_to_mapped_circuit: bool = True, add_barriers_between_layers: bool = False, verbose: bool = False, debug: bool = False, visualizer: mqt.qmap.visualization.SearchVisualizer | None = None) tuple[QuantumCircuit, mqt.qmap.sc.MappingResults][source]

Interface to the MQT QMAP tool for mapping quantum circuits.

Parameters:
  • circ – The circuit to map.

  • arch – The architecture to map to.

  • calibration – The calibration to use.

  • method – The mapping method to use. Defaults to heuristic.

  • heuristic – The heuristic function to use for the routing search. Defaults to gate_count_max_distance.

  • initial_layout – The initial layout to use. Defaults to dynamic.

  • iterative_bidirectional_routing_passes – Number of iterative bidirectional routing passes to perform or None to disable. Defaults to None.

  • layering – The layering strategy to use. Defaults to individual_gates.

  • automatic_layer_splits_node_limit – The number of expanded nodes after which to split a layer or None to disable automatic layer splitting. Defaults to 5000.

  • early_termination – The early termination strategy to use, i.e. terminating the search after a goal node has been found, but before it is guaranteed to be optimal. Defaults to none.

  • early_termination_limit – The number of nodes (counted according to the early termination strategy) after which to terminate the search early. Defaults to 0.

  • lookahead_heuristic – The heuristic function to use as a lookahead penalty during search or None to disable lookahead. Defaults to gate_count_max_distance.

  • lookaheads – The number of lookaheads to be used or None if no lookahead should be used. Defaults to 15.

  • lookahead_factor – The rate at which the contribution of future layers to the lookahead decreases. Defaults to 0.5.

  • encoding – The encoding to use for the AMO and exactly one constraints. Defaults to naive.

  • commander_grouping – The grouping strategy to use for the commander and bimander encoding. Defaults to halves.

  • swap_reduction – The swap reduction strategy to use. Defaults to coupling_limit.

  • swap_limit – Set a custom limit for max swaps per layer, for the increasing reduction strategy it sets the max swaps per layer. Defaults to 0.

  • include_wcnf – Include WCNF file in the results. Defaults to False.

  • use_subsets – Use qubit subsets, or consider all available physical qubits at once. Defaults to True.

  • subgraph – List of qubits to consider for mapping (in exact mapper), if None all qubits are considered. Defaults to None.

  • pre_mapping_optimizations – Run pre-mapping optimizations. Defaults to True.

  • post_mapping_optimizations – Run post-mapping optimizations. Defaults to True.

  • add_measurements_to_mapped_circuit – Whether to add measurements at the end of the mapped circuit. Defaults to True.

  • add_barriers_between_layers – Whether to add barriers between layers to make them apparent after mapping. Defaults to False.

  • verbose – Print more detailed information during the mapping process. Defaults to False.

  • debug – Gather additional information during the mapping process (e.g. number of generated nodes, branching factors, …). Defaults to False.

  • visualizer – A SearchVisualizer object to log the search process to. Defaults to None.

Returns:

The mapped circuit and the mapping results.