qiskit-community / qiskit-aqua

Quantum Algorithms & Applications (**DEPRECATED** since April 2021 - see readme for more info)
https://qiskit.org/aqua
Apache License 2.0
574 stars 376 forks source link

TypeError: result() got an unexpected keyword argument 'wait' - bug in `QuantumInstance` #1551

Closed Siheon-Park closed 3 years ago

Siheon-Park commented 3 years ago

Information

What is the current behavior?

QuantumInstance is created to mimic the real backend by using QasmSimulator.from_backend method. It, however, raise "TypeError: result() got an unexpected keyword argument 'wait'" when executed.

Steps to reproduce the problem

from qiskit.aqua.quantum_instance import QuantumInstance
from qiskit.providers.aer import QasmSimulator
from qiskit.circuit import QuantumCircuit
from qiskit import IBMQ

IBMQ.load_account()
provider = IBMQ.providers()[0]
backend = provider.get_backend('ibmq_santiago')
quantum_instance = QuantumInstance(backend=QasmSimulator.from_backend(backend), shots=2**10, seed_simulator=None, seed_transpiler=0, optimization_level=3)
qc = QuantumCircuit(5)
qc.h(0)
qc.cx(0,1)
qc.cx(1,2)
qc.measure_active()
quantum_instance.execute(qc)

Stderr:

TypeError: result() got an unexpected keyword argument 'wait'

What is the expected behavior?

It should return Qobj

Suggested solutions

Temporally,

del quantum_instance.qjob_config['wait']

But please fix this problem on the master branch.

woodsp-ibm commented 3 years ago

This is now fixed in Aer by Qiskit/qiskit-aer#1187

woodsp-ibm commented 3 years ago

This has been confirmed as fixed using the latest Aer code off master so closing this.