Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mcm measurement buffers #1629

Open
wants to merge 3 commits into
base: v4
Choose a base branch
from

Conversation

Skoricius
Copy link

@Skoricius Skoricius commented Aug 7, 2023

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 of n_mmts. The returned ro_sources then contain multiple MemoryReference 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 unrequested ro_sources as well as lists all MemoryReference objects that refer to the same key.
This then lets me deduce the correct num_shots (length of the buffer divided by the number of MemoryReference referring to that buffer). Also, to get the correct ordering of the entries in the buffer, I needed to sort the MemoryReference 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

  • The PR targets the master branch
  • The above description motivates these changes.
  • The change is atomic and can be described by a single commit (your PR will be squashed on merge).
  • All changes to code are covered via unit tests.
  • Parameters and return values have type hints with PEP 484 syntax.
  • Functions and classes have useful Sphinx-style docstrings.
  • (Bugfix) The associated issue is referenced above using auto-close keywords.

@Skoricius Skoricius requested a review from a team as a code owner August 7, 2023 16:30
@Shadow53 Shadow53 mentioned this pull request Aug 9, 2023
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant