Closed marekgluza closed 1 month ago
probabilities
also catches that
Traceback (most recent call last):
File "/nfs/users/marek.gluza/h.py", line 26, in <module>
print(result.probabilities())
File "/nfs/tools/qibo/lib/python3.10/site-packages/qibo/result.py", line 288, in probabilities
probs[state] = freq / self.nshots
TypeError: list indices must be integers or slices, not complex
Thanks @marekgluza for reporting this. I could reproduce.
After a quick investigation it seems to be related to the latest release of qibo (0.2.10). If you create your own environment and force the previous release (pip install qibo==0.2.9
) the issue should not appear. I will check the list of PRs in the latest release to see if I can identify which change caused this and update if I find something.
Thanks @marekgluza for reporting, and @stavros11 for the investigation. I thought for a moment that this could be related to the Rust failures, but unless it's a problem in the dependencies, it should be unrelated (since execute_qasm()
should not pass through qibo
, unless for just this part:
https://github.com/qiboteam/qibolab/blob/4f1459444a88666bad3b360dd728b0b88fa9c366/src/qibolab/backends.py#L74-L75
and the MeasurementOutcome
object (which should be just a sterile container).
In any case, @stavros11, if you find anything new, please publish it here (in case of greater issues, I will also take a look at some point).
This bug was introduced in https://github.com/qiboteam/qibo/commit/6cc64b3bba26f325e0d8d19558bb11adce8f16fe. Btw, we should include some test to avoid this issue in the future.
I could not reproduce it, even though I installed qibo
from master
, tried samples
, frequencies
, and probabilities
, and tried every backend available.
@renatomello, you have to try this code with the qibolab backend. In this case we are using qw5q_platinum
.
We have been submitting jobs to qw5q_platinum using the latest qibolab release 0.1.8 (
module load qibo
)when we switch to frequencies it also fails because the results variables are complex