iqm.qrisp_iqm.passes.routing.core.sabre_metric.compute_sabre_cost

iqm.qrisp_iqm.passes.routing.core.sabre_metric.compute_sabre_cost#

iqm.qrisp_iqm.passes.routing.core.sabre_metric.compute_sabre_cost(topology: QPUTopology, front_layer_indices: list[int], extended_set: list[int], instruction_data: np.ndarray, citizen_to_address: np.ndarray) → float#

Computes the SABRE metric with the modifications mentioned in the preamble.

Parameters:
  • topology (QPUTopology) – QPU topology.

  • front_layer_indices (list[int]) – The list of integer indices indicating which entries of the instruction data are currently at the front layer.

  • extended_set (list[int]) – The list of integer indices indicating which entries of the instruction data are currently in the extended set.

  • instruction_data (np.ndarray) – An array describing what instructions are available globally (see graph_processing_tools for more details).

  • citizen_to_address (np.ndarray) – An array indicating the current permutation of qubits.

Returns:

The cost of the modified SABRE metric.

Return type:

float