TranspilerError: 'Number of qubits (40) in QAOA is greater than maximum (30) in the coupling_map'

14 Views Asked by At

Hi Ive been trying to solve a custom PO problem using QAOA and I ran into this particular error. As per my understanding,this is due to the limitation of the simulation hardware. But as per the documentation the new QAOA package does not support to inject a quantum instance (from qiskit_algorithms import QAOA) but the old implementation did. (from qiskit.algorithms import QAOA). Given below is my code implementation. Can someone help me fix this issue.

from qiskit_algorithms import  QAOA
from qiskit_optimization.algorithms import MinimumEigenOptimizer
from qiskit_algorithms.optimizers import COBYLA
from qiskit_aer.primitives import Sampler


qp = from_docplex_mp(mdl)
print(qp.export_as_lp_string())
cobyla = COBYLA()
cobyla.set_options(maxiter=250)
qaoa_mes = QAOA(sampler=Sampler(), optimizer=cobyla, reps=1)
qaoa = MinimumEigenOptimizer(qaoa_mes)
result = qaoa.solve(qp)

Ive tried getting the backend using

service = QiskitRuntimeService(channel="ibm_quantum",token="TOKEN")
backend = service.least_busy(operational=True, simulator=False)

but there isnt a specific method to provide that to the QAOA.

I want to solve my quadratic program with large number of qbits either by providing an alternative backend or through any other alternative

0

There are 0 best solutions below