Avoid stacking unused emulator coefficients - #1514
Closed
DennisWayo wants to merge 1 commit into
Closed
Conversation
Contributor
|
Hi @DennisWayo, thanks for pointing this out. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes an emulator execution failure for swept-duration workflows where the pulse sequence length changes between sweep points.
The issue appeared while validating Qibocal T1 workflows on the emulator after the recent result-handling fixes. A T1 delay sweep changes the duration of the sequence, so the pulse-Hamiltonian coefficient arrays can have different lengths for each sweep value. The emulator was stacking those coefficient arrays unconditionally:
That raises:
For normal execution, these coefficients are not used. They are only needed when
EmulatorController.save_diris enabled for dumping the simulated evolution. This PR therefore keeps stacking the states as before, but only collects/stacks coefficient arrays whensave_diris set.Change
The sweep code now treats coefficient stacking as part of the simulation-dump path:
This keeps ordinary emulator execution from failing on variable-duration sweeps while preserving the existing behavior for saved simulations.
Test
I added a regression test that sweeps a
Delay.durationbefore measurement. This reproduces the variable sequence-length case that triggered the Qibocal T1 failure.Validation
Focused checks:
All passed locally.
Qibocal T1 smoke after this patch:
t1onqubitt1onqubitThe Dynamiqs and QuTiP fitted T1 values agree closely for this smoke workflow.
Scope
This is intentionally limited to ordinary emulator execution with swept sequence durations. It does not attempt to redesign the saved-evolution dump format for variable-length coefficient arrays.