You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@doichanj I am happy to work on this if you would like me to.
Workaround for backends derived from BackendV2
# Works for IBMProvider() backends # Since configuration.description is set to the value of backend.description # setting the value of backend.description avoids the exception
from qiskit.providers.backend import BackendV1, BackendV2 provider=IBMProvider() backend=provider.get_backend("ibm_nairobi") if isinstance(backend,BackendV2): if hasattr(backend.configuration(),'description'): # use an existing description backend.description = backend.configuration().description else: backend.description = 'My Description'
Backends derived from BackendV1
I do not see a consistent workaround for these backends. If the backend does not set and copy a description in the backend.configuration() method (e.g. any derived from ConfigurableFakeBackend), there is no workaround .
A few lines of code in the AerSimulator.from_backend would correct the exception for all backends.
Adding description = None, to the declaration for user definition
And adding an explicit check for the existence of the attribute if description is not None or not hasattr(configuration,'description'): configuration.description = description
Informations
What is the current behavior?
When the next code is executed:
The next error appears:
Steps to reproduce the problem
This only happens with qiskit_aer 0.13.0, with qiskit_aer 0.12.2 it works
The text was updated successfully, but these errors were encountered: