-
Notifications
You must be signed in to change notification settings - Fork 632
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
Add support for multi-controlled zyz #6042
Conversation
Hello. You may have forgotten to update the changelog!
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #6042 +/- ##
==========================================
- Coverage 99.67% 99.65% -0.02%
==========================================
Files 432 432
Lines 41839 41704 -135
==========================================
- Hits 41702 41562 -140
- Misses 137 142 +5 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
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.
Thank you for this addition! Just left a couple of comments. I would say the most important one is regarding the warning when decomposing Global phase with more than one control wire. In any case, great work 🤩
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.
My main concern right now is the correctness for non-special unitary ops. If we are expecting qml.PauliZ(0)
and qml.S(0)
to decompose like special unitary ops, but they aren't actually special unitary, are we providing incorrect decompositions?
Co-authored-by: Cristian Emiliano Godinez Ramirez <57567043+EmilianoG-byte@users.noreply.github.com>
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.
Sorry about not getting back to this for so long. 👍 Looks good to me :)
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.
Just one minor correction on the tests! Sorry for being so nitpicky 🙏
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.
Thank you for the changes! Nice to have this new decomposition 🥳
### 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 [`tests`](../tests) 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`. - [x] Ensure that the test suite passes, by running `make test`. - [x] Add a new entry to the `.github/CHANGELOG.md` file, summarizing the change, and including a link back to the PR. - [x] Ensure that code is properly formatted by running `make format`. When all the above are checked, delete everything above the dashed line and fill in the pull request template. ------------------------------------------------------------------------------------------------------------ **Context:** PR PennyLaneAI/pennylane#6042 adds support for multi-controlled zyz. For Lightning, this means that custom decompositions to special zyz with multiple controlled wires will be supported. **Description of the Change:** - Add tests for adjoint jacobian of the controlled gate with multiple controlled_wires. **Benefits:** **Possible Drawbacks:** **Related GitHub Issues:** [sc-67711] --------- Co-authored-by: ringo-but-quantum <github-ringo-but-quantum@xanadu.ai>
### 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 [`tests`](../tests) 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`. - [x] Ensure that the test suite passes, by running `make test`. - [x] Add a new entry to the `.github/CHANGELOG.md` file, summarizing the change, and including a link back to the PR. - [x] Ensure that code is properly formatted by running `make format`. When all the above are checked, delete everything above the dashed line and fill in the pull request template. ------------------------------------------------------------------------------------------------------------ **Context:** PR PennyLaneAI/pennylane#6042 adds support for multi-controlled zyz. For Lightning, this means that custom decompositions to special zyz with multiple controlled wires will be supported. **Description of the Change:** - Add tests for adjoint jacobian of the controlled gate with multiple controlled_wires. **Benefits:** **Possible Drawbacks:** **Related GitHub Issues:** [sc-67711] --------- Co-authored-by: ringo-but-quantum <github-ringo-but-quantum@xanadu.ai>
### 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:** This PR implements the decomposition of zyz for special unitaries with multiple control wires defined in Lemma 7.9 of https://arxiv.org/pdf/quant-ph/9503016. **Benefits:** Support decomposition of zyz for special unitaries. **Possible Drawbacks:** **Related GitHub Issues:** [sc-68471] --------- Co-authored-by: albi3ro <chrissie.c.l@gmail.com> Co-authored-by: Cristian Emiliano Godinez Ramirez <57567043+EmilianoG-byte@users.noreply.github.com>
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 implements the decomposition of zyz for special unitaries with multiple control wires defined in Lemma 7.9 of https://arxiv.org/pdf/quant-ph/9503016.
Benefits:
Support decomposition of zyz for special unitaries.
Possible Drawbacks:
Related GitHub Issues:
[sc-68471]