-
Notifications
You must be signed in to change notification settings - Fork 714
New Select decomposition: unary iterator
#7623
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
Conversation
Co-authored-by: ANTH0NY <39093564+AntonNI8@users.noreply.github.com>
Co-authored-by: David Wierichs <david.wierichs@xanadu.ai>
AntonNI8
left a comment
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 @KetpuntoG! Left some comments.
AntonNI8
left a comment
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.
🚀
Co-authored-by: ANTH0NY <39093564+AntonNI8@users.noreply.github.com>
soranjh
left a comment
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 @KetpuntoG, left some comments on the docs.
…I/pennylane into unary_iterator_select
**Context:** #7623 added `work_wires` to `Select` but not to its docstring. **Description of the Change:** Add `work_wires` to docstring. **Benefits:** **Possible Drawbacks:** **Related GitHub Issues:**
…tion if `partial=True` (#7658) **Context:** `qml.Select` can be reduced if two conditions are met: 1. It is a *partial Select* operator, applying fewer operators ($K$) than would be maximally possible for the given control wires ($2^c$ for $c$ control wires) 2. the control wires state does not have overlap with computational basis states that are not used by `Select`. The first condition can be checked based on the inputs `ops` and `control` to `Select`. It is in general not possible to figure out on the fly whether the second condition is satisfied. Instead, a new keyword argument `partial` signals to the operator that it may assume this second condition, allowing the decomposition to reduce itself. The simplification rule is detailed in a [compilation page](https://pennylane.ai/compilation/partial-select). **Description of the Change:** - Add the new keyword argument `partial` that signals that the second condition above is met. - Adapt the multi-control decomposition of `Select` to make use of the reduction if the condition is met. (Condition 1 is checked based on the input operators). (If there are $K=2^{c}$ operators, there is no difference.) **Benefits:** Cheaper decomposition of `Select` **Possible Drawbacks:** new keyword argument **Related GitHub Issues:** This will be helpful to develop a systematic approach together with unary iterator decomposition in #7623 . [sc-94728] --------- Co-authored-by: albi3ro <chrissie.c.l@gmail.com> Co-authored-by: Christina Lee <christina@xanadu.ai> Co-authored-by: Astral Cai <astral.cai@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
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.mdfile, 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:
[sc-92683]
previous draft was here
Description of the Change:
Benefits:
Possible Drawbacks:
Related GitHub Issues: