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

Restless measurements data processing nodes #678

Merged
merged 22 commits into from
Feb 28, 2022

Conversation

catornow
Copy link
Contributor

Summary

This PR implements the new data processing nodes RestlessNode and RestlessToCounts. These allow users to perform and analyze experiments based on restless measurements (without qubit reset) to significantly speed-up calibration experiments compared to standard experiments based on active reset, see https://arxiv.org/pdf/2202.06981.pdf.

Details and comments

See code. This PR implements the core part of PR #675.

Copy link
Collaborator

@nkanazawa1989 nkanazawa1989 left a comment

Choose a reason for hiding this comment

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

Thanks for splitting PRs. This is much easier to review. I added several comments.

qiskit_experiments/data_processing/nodes.py Outdated Show resolved Hide resolved
qiskit_experiments/data_processing/nodes.py Outdated Show resolved Hide resolved
qiskit_experiments/data_processing/nodes.py Outdated Show resolved Hide resolved
qiskit_experiments/data_processing/nodes.py Outdated Show resolved Hide resolved
qiskit_experiments/data_processing/nodes.py Outdated Show resolved Hide resolved
qiskit_experiments/data_processing/nodes.py Outdated Show resolved Hide resolved
qiskit_experiments/data_processing/nodes.py Show resolved Hide resolved
Copy link
Contributor

@eggerdj eggerdj left a comment

Choose a reason for hiding this comment

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

This looks good to me a few minor comments on docs and tests.

qiskit_experiments/data_processing/nodes.py Outdated Show resolved Hide resolved
qiskit_experiments/data_processing/nodes.py Show resolved Hide resolved
qiskit_experiments/data_processing/nodes.py Outdated Show resolved Hide resolved
qiskit_experiments/data_processing/nodes.py Outdated Show resolved Hide resolved
test/data_processing/test_nodes.py Outdated Show resolved Hide resolved
test/data_processing/test_nodes.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@nkanazawa1989 nkanazawa1989 left a comment

Choose a reason for hiding this comment

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

I added minor comment but rest of code looks good. Thanks @catornow

qiskit_experiments/data_processing/nodes.py Show resolved Hide resolved
Once the shots have been ordered in this fashion the data can be post-processed.
"""

def __init__(self, validate: bool = True, circuits_first: bool = True):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we rename circuit_first to memory_allocation taking value "C" (circuit-first), "S" (shot-first) and show a both data structures in class documentation with these labels? Currently only circuit first is shown and user may get wrong impression that the node only supports circuit-first. This memory representation convention would be useful when we implement another type of data processor, i.e. such label can be attached to metadata.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds good. We could make this convention more explicit with an Enum to add proper documentation. Perhaps:

from enum import Enum

class ShotOrder(Enum):
    """Description ..."""
    circuit_first = "c"
    shot_first = "s"

and then

    def __init__(self, validate: bool = True, memory_allocation: ShotOrder = ShotOrder.circuit_first):

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, I implemented the code here: 07e777f.

Copy link
Collaborator

@nkanazawa1989 nkanazawa1989 left a comment

Choose a reason for hiding this comment

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

Looks good to me. Thanks @catornow! It would be great if you could write documentation for shot-first, but this doesn't block merging.

Copy link
Contributor

@eggerdj eggerdj left a comment

Choose a reason for hiding this comment

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

LGTM!

@eggerdj eggerdj merged commit fcd182d into qiskit-community:main Feb 28, 2022
@chriseclectic chriseclectic added the Changelog: New Feature Include in the "Added" section of the changelog label Apr 25, 2022
paco-ri pushed a commit to paco-ri/qiskit-experiments that referenced this pull request Jul 11, 2022
* Added restless nodes and tests.

Co-authored-by: Daniel J. Egger <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: New Feature Include in the "Added" section of the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants