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.
Description
Updating how the memory regions are adapted to support repeated measurements on the same qubit.
When the same qubit is measured multiple times, the received buffer is of the length
num_shots*n_mmts
where sequential measurements are done in blocks ofn_mmts
. The returnedro_sources
then contain multipleMemoryReference
with the same name and key, but different offset.What I do in this PR is first construct the list of all relevant
sources
. Which filters out the unrequestedro_sources
as well as lists allMemoryReference
objects that refer to the same key.This then lets me deduce the correct
num_shots
(length of the buffer divided by the number ofMemoryReference
referring to that buffer). Also, to get the correct ordering of the entries in the buffer, I needed to sort theMemoryReference
by their offset (I am less sure if this is the correct thing to do, but it seems to work).I am unsure about how to test this for the complex buffers, but it might work as is.
Checklist
master
branch