Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Qiskit job result missing attributes cause wrong exception when job fails in VQE

Aperta
#415 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
azure, python

Direzione di ricerca

Inizia in azure/quantum/qiskit/job.py, intorno alla costruzione di result_dict a cui si fa riferimento nell’issue, e confronta il suo output con le aspettative di Qiskit Result. Riproduci lo scenario di un job VQE fallito, quindi verifica che le informazioni sull’errore risultanti siano disponibili tramite gli attributi del risultato previsti senza compromettere i job completati con successo.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

image

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.
Lingua principale
Python
Stelle
160
Fork
113
Merge medio
6g 23h
PR unite (30g)
1

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di microsoft/azure-quantum-python

Tutte le issue di microsoft/azure-quantum-python

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.