Closed amitracal closed 3 years ago
@adekusar-drl This was running Aer backend but judging by the error message it seems more related to circuit parameterization circuits so perhaps I can ask @hhorii to take a look.
I was able to reproduce this issue with the following script:
from qiskit import Aer
from qiskit.aqua.algorithms import QAOA
from qiskit.optimization.algorithms import MinimumEigenOptimizer, RecursiveMinimumEigenOptimizer
from qiskit.optimization import QuadraticProgram
from qiskit.aqua.components.optimizers import SLSQP
from qiskit.aqua import QuantumInstance
from qiskit.aqua import aqua_globals
qubo = QuadraticProgram()
qubo.binary_var('x1')
qubo.binary_var('x2')
qubo.binary_var('x3')
qubo.binary_var('x4')
qubo.binary_var('x5')
qubo.binary_var('x6')
qubo.binary_var('x7')
qubo.binary_var('x8')
qubo.binary_var('x9')
qubo.binary_var('x10')
qubo.binary_var('x11')
qubo.binary_var('x12')
qubo.binary_var('x13')
qubo.minimize(linear=[1,-2,3,-6,-1,2,3,4,-5,-6,-1,-3,1],
quadratic={('x1', 'x2'): 1, ('x1', 'x3'): -1, ('x1', 'x4'): 2,
('x2' , 'x3'): 5, ('x2', 'x4'): 6, ('x3', 'x4'): 3,
('x4','x5'): 1, ('x2', 'x5'): 6, ('x3', 'x5'): 3, ('x1', 'x6'): 6,
('x5', 'x6'): 0.5,
('x3', 'x7'): 36, ('x5', 'x7'): 0.5, ('x1', 'x8'): 6, ('x7', 'x8'): 0.5,
('x8', 'x9'): 1, ('x9', 'x10'): 0.5, ('x1', 'x11'): 6, ('x2', 'x11'): 0.5,
('x7', 'x12'): 6, ('x5', 'x12'): 0.5, ('x12', 'x13'): 0.5
})
seed = 1
aqua_globals.random_seed = seed
backend = Aer.get_backend('qasm_simulator')
quantum_instance = QuantumInstance(backend, seed_simulator=seed, seed_transpiler=seed)
slsqp = SLSQP()
slsqp.set_options(maxiter=500)
qaoa_mes = QAOA(quantum_instance=quantum_instance,include_custom=True, optimizer = slsqp, p=10)
qaoa = MinimumEigenOptimizer(qaoa_mes)
rqaoa_qaoa = RecursiveMinimumEigenOptimizer(min_eigen_optimizer=qaoa, min_num_vars=1, min_num_vars_optimizer=qaoa)
rqaoa_result_q = rqaoa_qaoa.solve(qubo)
Let me take a look.
Information
Qiskit Aqua version: 'qiskit-terra': '0.16.0', 'qiskit-aer': '0.7.0', 'qiskit-ignis': '0.5.0', 'qiskit-ibmq-provider': '0.11.0', 'qiskit-aqua': '0.8.0', 'qiskit': '0.23.0'
Python version: 3.7.6
Operating system: Windows 10
What is the current behavior?
Recursive QAOA is erroring out
This is the code failing - rqaoa_result_q = rqaoa_qaoa.solve(qubo) print(rqaoa_result_q)
This is the bottom part of the error - AquaError: 'Circuit execution failed: ERROR: Failed to load qobj: Invalid parameterized qobj: instruction param position out of range
Steps to reproduce the problem
Run the notebook attached, pay special attention to the cells after the comment -# RecursiveMinimumEigenOptimizer
What is the expected behavior?
The code should run and produce the same optimized value was Cplex which is -20.5 (even qaoa is not producing it)
RQAOA small.zip
Suggested solutions