avoid users to use backend_options with IBMQ provider
# =============================================================================
import logging
+
from qiskit import __version__ as terra_version
+from qiskit.providers.ibmq import IBMQProvider
try:
from qiskit.providers.aer import AerProvider
HAS_AER = True
@@ -117,6 +119,9 @@ class QuantumInstance:
self._qjob_config = {'timeout': timeout} if self.is_local \
else {'timeout': timeout, 'wait': wait}
+ if isinstance(self._backend.provider(), IBMQProvider):
+ logger.info("backend_options can not used with the backends in IBMQ provider.")
+ else:
self._backend_options = {} if backend_options is None \
else {'backend_options': backend_options}
@@ -171,6 +176,9 @@ class QuantumInstance:
elif k in QuantumInstance.BACKEND_CONFIG:
self._backend_config[k] = v
elif k in QuantumInstance.BACKEND_OPTIONS:
+ if isinstance(self._backend.provider(), IBMQProvider):
+ logger.info("backend_options can not used with the backends in IBMQ provider.")
+ else:
if k in QuantumInstance.BACKEND_OPTIONS_QASM_ONLY and self.is_statevector:
logger.info("'{}' is only applicable for qasm simulator but "
"statevector simulator is used. Skip the setting.")
