Skip to content

Conversation

@KetpuntoG
Copy link
Contributor

@KetpuntoG KetpuntoG commented Jun 6, 2025

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 the
    change, 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 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:

[sc-92683]

previous draft was here

Description of the Change:

Benefits:

Possible Drawbacks:

Related GitHub Issues:

Copy link
Contributor

@AntonNI8 AntonNI8 left a 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.

KetpuntoG and others added 3 commits June 13, 2025 13:34
Co-authored-by: ANTH0NY <39093564+AntonNI8@users.noreply.github.com>
Copy link
Contributor

@AntonNI8 AntonNI8 left a comment

Choose a reason for hiding this comment

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

🚀

KetpuntoG and others added 2 commits June 13, 2025 15:59
Co-authored-by: ANTH0NY <39093564+AntonNI8@users.noreply.github.com>
Copy link
Contributor

@soranjh soranjh left a 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.

KetpuntoG and others added 2 commits June 13, 2025 17:52
[skip-ci]

Co-authored-by: Soran Jahangiri <40344468+soranjh@users.noreply.github.com>
KetpuntoG and others added 4 commits June 16, 2025 13:06
@KetpuntoG KetpuntoG added this pull request to the merge queue Jun 16, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jun 16, 2025
@dwierichs dwierichs enabled auto-merge June 16, 2025 19:14
@dwierichs dwierichs added this pull request to the merge queue Jun 16, 2025
Merged via the queue into master with commit 677619d Jun 16, 2025
53 checks passed
@dwierichs dwierichs deleted the unary_iterator_select branch June 16, 2025 20:14
github-merge-queue bot pushed a commit that referenced this pull request Jun 24, 2025
**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:**
github-merge-queue bot pushed a commit that referenced this pull request Aug 19, 2025
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

6 participants