-
Notifications
You must be signed in to change notification settings - Fork 605
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
Native mid-circuit measurements support composite measurements, etc. (phase 2) #5120
Conversation
… for many-shot iterative_qpe algo.
Co-authored-by: Mudit Pandey <mudit.pandey@xanadu.ai>
Co-authored-by: Mudit Pandey <mudit.pandey@xanadu.ai>
Co-authored-by: Mudit Pandey <mudit.pandey@xanadu.ai>
Co-authored-by: Christina Lee <christina@xanadu.ai>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @vincentmr ! This looks good to me. Very excited to get this in. I'm still a bit worried about the core test runners, but everyone seems okay with it so let's do it
Co-authored-by: Mudit Pandey <mudit.pandey@xanadu.ai>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one last concern, then I'd say this is good to go!
Before submitting
Please complete the following checklist when submitting a PR:
All new features must include a unit test.
If you've fixed a bug or added code that should be tested, add a test to the
test directory!
All new functions and code must be clearly commented and documented.
If you do make documentation changes, make sure that the docs build and
render correctly by running
make docs
.Ensure that the test suite passes, by running
make test
.Add a new entry to the
doc/releases/changelog-dev.md
file, summarizing thechange, and including a link back to the PR.
The PennyLane source code conforms to
PEP8 standards.
We check all of our code against Pylint.
To lint modified files, simply
pip install pylint
, and thenrun
pylint pennylane/path/to/file.py
.When all the above are checked, delete everything above the dashed
line and fill in the pull request template.
Context:
This PR is a follow-up on #5088 .
Epic 50811 states:
The current PR tackles the requirements above as indicated by the task list.
Description of the Change:
apply_mid_measure
handles post-selection returning a zero state and sample when the state isn't properly normalized (which happens when the state cannot be normalized).concretize
method is added to MeasurementValue object to obtain a concrete value from a dictionary of measurement values. This allows handling composite measurements. Other modules likesimulate
are simplified accordingly.simulate
level, handling this exception. This means the final number of samples is lower or equal to the total number of shots.Benefits:
Mid-circuit measurements are natively supported.
Possible Drawbacks:
Slower in several cases (e.g. when few MCMs).
Missing features:
To do in follow-up PRs:
Related GitHub Issues:
[sc-54987]
[sc-55666]
[sc-55667]
[sc-55668]
[sc-55922]