Skip to content

Include time_of_flight in Readout duration - #1433

Merged
RoyStegeman merged 7 commits into
mainfrom
fix_tof_handling
Apr 17, 2026
Merged

Include time_of_flight in Readout duration #1433
RoyStegeman merged 7 commits into
mainfrom
fix_tof_handling

Conversation

@RoyStegeman

Copy link
Copy Markdown
Member

When piping multiple sequences, the pipe operation considers the durations of the pulses played on each channel, and if they are not all the same, it appends delays to the shorter channels to ensure they all have an equal length. However, the time of flight was neglected in the determination of the duration of Readout. This means that the timings would be miscalculated and the mismatch would accumulate for each additional sequence.

In this PR we include a time_of_flight attribute in Readout and sum it to the duration of the acquisition pulse to obtain the total duration of the readout.

Because we may still wish to define a sequence before knowing the time of flight, we change the pipe operation |= of PulseSequence to use the symbolic Align as opposed to calculating an exact delay at the time of constructing the sequences. This way the time of flight can be updated later (the default value is 0.0), and the exact delays can be calculated by calling the align_to_delays() method.

Finally, we introduce a test to test the new pipe behavior.

@RoyStegeman
RoyStegeman requested a review from alecandido April 16, 2026 12:27
@RoyStegeman RoyStegeman added the bug Something isn't working label Apr 16, 2026
@codecov

codecov Bot commented Apr 16, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 45.00000% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 37.39%. Comparing base (abfde1b) to head (801b909).
⚠️ Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
src/qibolab/_core/instruments/qblox/cluster.py 0.00% 10 Missing ⚠️
src/qibolab/_core/instruments/qblox/results.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1433      +/-   ##
==========================================
+ Coverage   37.36%   37.39%   +0.02%     
==========================================
  Files         114      114              
  Lines        5724     5731       +7     
==========================================
+ Hits         2139     2143       +4     
- Misses       3585     3588       +3     
Flag Coverage Δ
unittests 37.39% <45.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@alecandido alecandido left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this PR so much that I reviewed even the tests :P

Just a minor comment, but practically good to go!

Comment thread src/qibolab/_core/instruments/emulator/results.py Outdated
Comment thread tests/test_sequence.py Outdated
without including other_channels in self.align(self.channels | other_channels), pulses on different channels would be played simultaneously despite the pipe operation, e.g. q0.RX90() | q0.MZ() would play MZ and RX90 simultaneously.

This commit also introuduces a test for the pipe operation
@RoyStegeman
RoyStegeman marked this pull request as ready for review April 17, 2026 06:51
@RoyStegeman
RoyStegeman requested review from a team and scarrazza April 17, 2026 06:51
@RoyStegeman RoyStegeman linked an issue Apr 17, 2026 that may be closed by this pull request
@RoyStegeman
RoyStegeman added this pull request to the merge queue Apr 17, 2026
Merged via the queue into main with commit da95798 Apr 17, 2026
39 checks passed
@RoyStegeman
RoyStegeman deleted the fix_tof_handling branch April 17, 2026 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working qblox

Projects

None yet

Development

Successfully merging this pull request may close these issues.

time_of_flight is not included in Readout duration

3 participants