BaseRouting#

Module: iqm.qaoa.transpiler.routing

class iqm.qaoa.transpiler.routing.BaseRouting(problem_bqm, qpu)[source]#

Bases: ABC

The abstract base class for various routing sub-classes.

Generally speaking, routing refers to the process of ‘moving’ the problem qubits around the QPU to allow the execution of the interactions between the problem qubits. The standard way to do this is with swap gates, but there are special variations e.g., if using move gates on a computational resonator.

Attributes

layers

The list of layers of the routing object.

Methods

build_qiskit

The method to construct a qiskit circuit out of the routing, given a list of gammas and betas angles.

Parameters:
  • problem_bqm (BinaryQuadraticModel)

  • qpu (QPU)

abstract property layers: list[Any]#

The list of layers of the routing object.

Different subclasses of BaseRouting represent the individual layers differently, which is why the type of the layers here is the generic Any.

abstract build_qiskit(betas, gammas, measurement=True)[source]#

The method to construct a qiskit circuit out of the routing, given a list of gammas and betas angles.

Parameters:
  • betas (list[float]) – The QAOA parameters (angles) to be used in the mixer.

  • gammas (list[float]) – The QAOA parameters (angles) to be used in the phase separator.

  • measurement (bool) – Should the quantum circuit end with a measurement of all qubits?

Returns:

A qiskit circuit implementing the QAOA.

Return type:

QuantumCircuit

Inheritance

Inheritance diagram of iqm.qaoa.transpiler.routing.BaseRouting