qiskit_circuit#
- iqm.qaoa.circuits.qiskit_circuit(qaoa, measurements=True)[source]#
Constructs a
QuantumCircuit
from the QAOA angles, ignoring details of the QPU.Constructs a
QuantumCircuit
corresponding to the QAOA, assuming perfect connectivity of the qubits and complete set of available quantum gates. This circuit can be used for simulations or it can be transpiled to be run on a real QPU.- Parameters:
qaoa (QUBOQAOA) – A
QUBOQAOA
object whose angles and interaction strengths are used in the construction of theQuantumCircuit
.measurements (bool) – Should measurements be added at the end of the circuit? If the circuit is used for statevector simulation, there shouldn’t be measurements. If the circuit is used for sampling, there should be measurements.
- Returns:
A quantum circuit corresponding to the QAOA, excluding any measurements.
- Return type:
QuantumCircuit