Closed andrea-pasquale closed 2 weeks ago
I am guessing that the error might be caused by the fact that
Custom
accepts arrays which qm doesn't seems to like arrays when playing with custom pulses.
Nope, it's just our fault, not really QM related...
We need to name pulses for the upload, almost in every driver (actually, in all of them, ttbomk). Naming automatically is not completely trivial, and there are two main options:
Number 1. is cumbersome, since you need to always have access to a unique container, and grow it. Moreover, the second option is coming with the additional benefit of automatically deduplicating what we are uploading to the instrument (since identical pulses will have identical hashes).
Unfortunately, NumPy arrays are unhashable by default, since they are mutable (thus unsuitable for places where hashes are typically used, e.g. dict
keys). But Custom
is the only envelope which is parametrized by an entire array. And that's where the problem is being generated.
What we can do is to manually define the __hash__
of the Custom
envelope, by hashing the data buffer of the NumPy array, instead of attempting to hash the entire Python object (which will correctly refuse to do it, generating the reported error).
Since there is already an indentier for pulses in id
, we could also just make qm use that instead of referring to its hash, no?
After discussing offline, we've decided to fix the issue in the following way #1101
What we can do is to manually define the
__hash__
of theCustom
envelope, by hashing the data buffer of the NumPy array, instead of attempting to hash the entire Python object (which will correctly refuse to do it, generating the reported error).
Using the pulse id doesn't work because it will duplicate the waveform for each pulse with the same waveform.
The following code is failing using
main
.Here is the error.
```py 2024-11-14 14:12:34,561 - qm - INFO - Starting session: 31c229f4-6d22-4c91-baec-345506575398 2024-11-14 14:12:36,796 - qm - INFO - Octave "octave5" Health check passed, current temperature 59 2024-11-14 14:12:37,530 - qm - INFO - Octave "octave6" Health check passed, current temperature 58 2024-11-14 14:12:37,530 - qm - INFO - Performing health check 2024-11-14 14:12:37,550 - qm - WARNING - Health check warning: Inter-OPX connectivity issues in OPX: con1. Missing ports are: 12, 11, 10, 9. See QM-App for more info. 2024-11-14 14:12:37,550 - qm - WARNING - Health check warning: Inter-OPX connectivity issues in OPX: con2. Missing ports are: 12, 11, 10, 9. See QM-App for more info. 2024-11-14 14:12:37,551 - qm - WARNING - Health check warning: Inter-OPX connectivity issues in OPX: con3. Missing ports are: 12, 11, 10, 9. See QM-App for more info. 2024-11-14 14:12:37,551 - qm - WARNING - Health check warning: Inter-OPX connectivity issues in OPX: con4. Missing ports are: 12, 11, 10, 9. See QM-App for more info. 2024-11-14 14:12:37,551 - qm - WARNING - Health check warning: Inter-OPX connectivity issues in OPX: con5. Missing ports are: 12, 11, 10, 9. See QM-App for more info. 2024-11-14 14:12:37,551 - qm - WARNING - Health check warning: Inter-OPX connectivity issues in OPX: con6. Missing ports are: 12, 11, 10, 9. See QM-App for more info. 2024-11-14 14:12:37,551 - qm - WARNING - Health check warning: Inter-OPX connectivity issues in OPX: con7. Missing ports are: 12, 11, 10, 9. See QM-App for more info. 2024-11-14 14:12:37,551 - qm - WARNING - Health check warning: Inter-OPX connectivity issues in OPX: con8. Missing ports are: 12, 11, 10, 9. See QM-App for more info. 2024-11-14 14:12:37,551 - qm - WARNING - Health check warning: Inter-OPX connectivity issues in OPX: con9. Missing ports are: 12, 11, 10, 9. See QM-App for more info. 2024-11-14 14:12:37,551 - qm - INFO - Health check passed Connected to: Rohde&Schwarz SGS100A (serial:1416.0505k02/114164, firmware:4.2.76.0-4.30.046.295) in 0.16s Traceback (most recent call last): File "/nfs/users/andrea.pasquale/qibocal/test_qm.py", line 17, in
I am guessing that the error might be caused by the fact that
Custom
accepts arrays which qm doesn't seems to like arrays when playing with custom pulses. Any ideas @alecandido @stavros11?