iqm.qrisp_iqm.passes.routing.core.sabre_metric.compute_sabre_cost_from_dag

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

iqm.qrisp_iqm.passes.routing.core.sabre_metric.compute_sabre_cost_from_dag(topology: QPUTopology, instruction_dag: CircuitDAG, c2a: np.ndarray) → float#

Compute the SABRE cost from a given instruction DAG.

Evaluates under a given initial layout for a given topology.

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

  • instruction_dag (tuple) – An instruction DAG tuple (see graph_processing_tools for more details).

  • c2a (np.ndarray) – An array describing the initial layout permutation.

Returns:

The SABRE metric.

Return type:

float