iqm.qrisp_iqm.passes.routing.core.sabre_metric.find_involvement

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

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

Determine involvement lists for SABRE cost-change computation.

Describes which instruction each qubit is involved in. This is required in order to call the compute_sabre_cost_change function with the corresponding relevant instructions.

Single-qubit gates are excluded from the involvement lists because they have distance 0 under any qubit placement and therefore contribute nothing to the SABRE cost metric.

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

  • front_layer_indices (list[int]) – A list of integers indicating which entries of instruction data constitute the front layer.

  • extended_set (list[int]) – A list of integers indicating which entries of instruction data constitute the extended_set.

  • topology (tuple) – A topology tuple (see graph_processing_tools for more details).

Returns:

  • front_layer_res (list[list[int]]) – A list of lists indicating which front layer instructions each qubit is involved in.

  • extended_set_res (list[list[int]]) – A list of lists indicating which extended set instructions each qubit is involved in.

Return type:

tuple[list[list[np.int16]], list[list[np.int16]]]