qhc 1073 add phase to iqpair drag and prepare for future improvements - #978
qhc 1073 add phase to iqpair drag and prepare for future improvements#978jordivallsq wants to merge 13 commits into
Conversation
|
Hello. You may have forgotten to update the changelog!
|
AI AnalysisPurpose of the changes:Add phase handling to IQPair class for improved waveform manipulation.
|
Codecov Report❌ Patch coverage is
❌ Your patch check has failed because the patch coverage (70.00%) is below the target coverage (100.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #978 +/- ##
==========================================
- Coverage 97.89% 97.87% -0.03%
==========================================
Files 239 239
Lines 10468 10476 +8
==========================================
+ Hits 10248 10253 +5
- Misses 220 223 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
fedonman
left a comment
There was a problem hiding this comment.
I completely disagree with adding a phase attribute in waveform level for many reasons.
-
Phase is not an intrinsic attribute of a waveform or an IQ pair, the physically relevant phase in experiments is a frame-level concept that composes across pulses and measurements rather than belonging to a single waveform object.
-
Phase is already handled at a higher level in our native Rmw/DRAG gates, where it is explicitly defined and can be realized either by an equivalent I/Q envelope rotation or, more commonly, by a Virtual-Z (frame) update, so duplicating it at the waveform level is unnecessary and semantically incorrect.
-
If we need to rotate an I/Q pair we can do so by creating a utility function that uses the common formula:
I′(t)Q′(t)=I(t)cosϕ−Q(t)sinϕ=I(t)sinϕ+Q(t)cosϕ -
The current code is buggy e.g.
self.I = deepcopy(self.Q)
self.Q = deepcopy(self.I)
After the first line, self.I is already overwritten, so the second line deepcopies the new self.I (which equals the old Q). Result: both I and Q become the same waveform.
|
This PR was created to add an extra variable to IQ Pair for the calibration file. As Fabio pointed out, to create a waveform inside Calibration we should allow the user to rotate the IQPair in a physical level without needing the user to perform complex functions. I agree that we might put this implementation somewhere else, but on the other hand, This makes the implementation inside the calibration file much simpler (in the yaml, instead of showing a huge arbitrary wf, it is a smaller text). Regarding your points:
Another important reason why this PR was blocked, is the new functions for IQPair ( |
|
|
I just saw it was created a long time ago, sorry I thought it was something urgent brought up. It's true that Rmw is digital-only. But pulse programming already supports IQ rotation: Either with the For the calibration file we can edit it to include rotation, I have no issues with that. But it should be a new data structure specifically for the calibration file and not change the IQWaveform. E.g. it could be or something similar. But again it would be more "correct" to implement with |
|
It seems like a good solution but I need to check the best way to implement something similar. I agree that the right way is to implement similar with set phase but my idea was to modify the envelope before reaching qblox compilation, this way we avoid unnecessary waveforms |



As Fabio suggested and to make measurements more straightforward iq pair needs to include a phase rotation. As this is a complex subject, for now we can implement simply a 90 degrees rotation and set a not implemented error for the rest.