-
Notifications
You must be signed in to change notification settings - Fork 604
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
Fix expand_tape_state_prep. #4564
Conversation
Codecov ReportPatch and project coverage have no change.
Additional details and impacted files@@ Coverage Diff @@
## master #4564 +/- ##
=======================================
Coverage 99.64% 99.64%
=======================================
Files 376 376
Lines 33076 33076
=======================================
Hits 32960 32960
Misses 116 116
☔ View full report in Codecov by Sentry. |
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.
nice find on that bug!
As for the template support - I'm worried that this helper function is getting too big for its own good with all these custom kwargs and overriden behaviours. What is the intention of this function? Should this decomposition apply to all qubit devices? I think we're only doing this because the old way of pre-processing was a little all over the place and because StatePrepBase decompositions haven't really been looked at in a while. I think this logic makes sense, but I don't think it belongs in _qubit_device.py
This PR comes about because of SC-43708. I wanted to add the following test in Lightning, but I couldn't run the circuit or tape with |
Co-authored-by: Matthew Silverman <[email protected]>
Co-authored-by: Matthew Silverman <[email protected]>
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 for separating out the bug!
Turns out I was misusing |
Clean 👍🏼 |
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 for finding and fixing this 👍🏼
### Before submitting Please complete the following checklist when submitting a PR: - [x] 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! - [x] 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`. - [x] Ensure that the test suite passes, by running `make test`. - [x] Add a new entry to the `doc/releases/changelog-dev.md` file, summarizing the change, and including a link back to the PR. - [x] The PennyLane source code conforms to [PEP8 standards](https://www.python.org/dev/peps/pep-0008/). We check all of our code against [Pylint](https://www.pylint.org/). To lint modified files, simply `pip install pylint`, and then run `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:** [43708](https://app.shortcut.com/xanaduai/story/43708/lightning-ecosystem-devices-allow-stateprepbase-ops-to-be-used-mid-circuit) demands mid-circuit `StatePrep` support in Lightning. This PR fixes a small bug in `expand_tape_state_prep`. **Description of the Change:** `first_op`-bugfix **Benefits:** **Possible Drawbacks:** **Related GitHub Issues:** --------- Co-authored-by: Matthew Silverman <[email protected]> Co-authored-by: Jay Soni <[email protected]>
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:
43708 demands mid-circuit
StatePrep
support in Lightning. This PR fixes a small bug inexpand_tape_state_prep
.Description of the Change:
first_op
-bugfixBenefits:
Possible Drawbacks:
Related GitHub Issues: