ptn_router

Contents

ptn_router#

iqm.qaoa.transpiler.ptn.ptn.ptn_router(problem_bqm, qpu, strategy='Line')[source]#

Construct a routing object for the ParityTwineNetwork (PTN).

Depending on the chosen strategy, this function returns an appropriate subclass of BaseRoutingPTN configured with the given problem BQM.

Parameters:
  • problem_bqm (BinaryQuadraticModel) – The binary quadratic model representing the optimization problem.

  • qpu (QPU) – QPU instance.

  • strategy (str) – The routing strategy to apply. Currently supported: “Line”.

Returns:

A BaseRoutingPTN subclass implementing the requested routing strategy.

Raises:

ValueError – If an unsupported strategy is provided.

Return type:

BaseRoutingPTN