hardwired_router

hardwired_router#

iqm.qaoa.transpiler.hardwired.hardwired.hardwired_router(problem_bqm, qpu)[source]#

The function that creates an optimal routing for all-to-all connected problems, designed by hand.

The original code was written for hand-picked qubits from the Apollo QPU. When this was expanded to be used on any QPU, the algorithm had to be adjusted. Here is how it works now:

  1. First, the BinaryQuadraticModel representation of the problem is padded with extra interactions (of strength 0), to make it trully all-to-all connected.

  2. Then, based on the number of variables of the problem, we construct a dummy graph underlying_graph which represents the part of the QPU on which the circuit acts.

  3. We find a suitable mapping between underlying_graph and the QPU graph hardware_graph. This mapping inverse_iso is used in the apply_int() and apply_swap() method calls.

  4. Using the apply_int() and apply_swap() methods, the hardwired routing is constructed.

Parameters:
Returns:

A Routing object containing the entire routing schedule.

Raises:

ValueError – If the number of variables of the problem is not between 4 and 15 (inclusive).

Return type:

Routing