-
Notifications
You must be signed in to change notification settings - Fork 97
Open
Description
If running the VQE sample and it fails to run on a quantum_instance (for instance, if Quantinuum is out of credits), then instead of printing the error code and message, it prints that an attribute "status" could not be found.
It looks like this is throwing from when it tries to read result.status from run_circuits.py.
Looking at the latest definition of Result object in qiskit, it looks like for the error_data message to be shown, we should encode the error_data into status field as well.
This is where we encode job result into Qiskit result as part of azure-quantum: https://github.com/microsoft/qdk-python/blob/944fac0ee64e962b65b73f29635a2c65abf332d7/azure-quantum/azure/quantum/qiskit/job.py#L93
Current:
result_dict = {
"results" : [results],
"job_id" : self._azure_job.details.id,
"backend_name" : self._backend.name(),
"backend_version" : self._backend.version,
"qobj_id" : self._azure_job.details.name,
"success" : success,
"error_data" : None if self._azure_job.details.error_data is None else self._azure_job.details.error_data.as_dict()
}
Proposed change:
error_msg = None if self._azure_job.details.error_data is None else self._azure_job.details.error_data.as_dict()
result_dict = {
"results" : [results],
"job_id" : self._azure_job.details.id,
"backend_name" : self._backend.name(),
"backend_version" : self._backend.version,
"qobj_id" : self._azure_job.details.name,
"success" : success,
"error_data" : error_msg,
"status": error_msg,
}
We may optionally want to add the other missing attributes on Qiskit result that are currently not populated, such as date, header, in case they also cause errors down the road.
Metadata
Metadata
Assignees
Labels
No labels