qiboteam / qibolab

Quantum hardware module and drivers for Qibo.
https://qibo.science
Apache License 2.0
43 stars 14 forks source link

Sign of pulse parameters is not deserialized properly #826

Closed stavros11 closed 5 months ago

stavros11 commented 7 months ago
pulse = Pulse(0, 40, 0.3, int(4e9), 0.0, shape="Drag(5, -0.02)")
print(pulse)

gives

Pulse(0, 40, 0.3, 4_000_000_000, 0, Drag(5, 0.02), None, PulseType.DRIVE, 0)

so -0.02 is converted to 0.02. I am not sure if this has any practical consequence in this case.

I found this while working on #789 for 0.2, but then I realized that it also exists for 0.1. I am guessing it will be solved by #818 where the ugly eval will be dropped, so I would even postpone for 0.2. @alecandido if you agree, we can put this directly to the 0.2 milestone.

alecandido commented 7 months ago

I agreed and added to the milestone.

And indeed, by avoiding parsing the strings manually, these errors should become almost impossible.