LineRoutingPTN#
Module: iqm.qaoa.transpiler.ptn.ptn
- class iqm.qaoa.transpiler.ptn.ptn.LineRoutingPTN(problem_bqm, qpu, initial_mapping=None)[source]#
Bases:
BaseRoutingPTNSubclass implementing the PTN line strategy.
Attributes
Methods
Build the QAOA circuit from the routing (
self) inqiskit.- Parameters:
problem_bqm (BinaryQuadraticModel)
qpu (QPU)
initial_mapping (LineMappingPTN | None)
- build_qiskit(betas, gammas, measurement=True)[source]#
Build the QAOA circuit from the routing (
self) inqiskit.The
LineRoutingPTN(self) contains all the information needed to create the phase separator part of the QAOA circuit. This method builds the rest of the circuit from it, i.e.:It initializes the qubits in the \(| + >\) state by applying the Hadamard gate to all of them.
It applies local fields (RZ gates).
It applies the PTN layers of DCNOT, mapping the qubit parities to the line qubits, applying interactions (RZ gates) in between the layers.
It applies the driver.
It repeats steps 2-5 until it uses up all
betasandgammas.It applies the measurements and barrier before them.
- Parameters:
- Returns:
A complete QAOA
QuantumCircuit.- Raises:
ValueError – If lengths of
gammasandbetasare not the same.- Return type:
Inheritance
