Tags: PennyLaneAI/pennylane
Tags
Raising a warning if latest JAX is installed (#7369) **Context:** We need a bugfix release for `PennyLane 0.41`. The reason is that if a user installs PennyLane, then latext JAX, and then imports PennyLane (in this sequence), the following error is raised: ``` AttributeError: jax.core.Primitive was removed in JAX v0.6.0. Use jax.extend.core.Primitive instead, and see https://docs.jax.dev/en/latest/jax.extend.html for details.. ``` and there are no further details. Therefore, we need to raise an informative warning at some point that tells the user that PL is not yet compatible with the latest JAX version. Notice that this branch was created from the [tag](https://github.com/PennyLaneAI/pennylane/releases/tag/v0.41.0) of the latest PennyLane release, as the PL release guidance recommends. **Description of the Change:** - This is not a change implemented in this PR, but notice that `__version__` is set to `"0.41.1"` on this branch. This change was implemented before pushing this branch to GitHub, as the PL release guidance recommends. - We need to install the stable version of `pennylane-lightning` and `pennylane-catalyst` instead of the latest, because the latest version of these packages is now incompatible with this branch (they are using the `pennylane.exceptions` module, which was introduced after the 0.41 release). Obviously, this change will not be merged into master. - The actual warning message. This triggered `pylint` failures in the entire file, and I had to stick: ``` # pylint: disable=wrong-import-position, wrong-import-order, import-outside-toplevel ``` at the very top of the file. This is certainly not ideal, but this is only temporary before PL is compatible with the latest JAX version (WIP to be completed before the next release). Notice that we might also raise this warning somewhere else, catching the first `import jax` inside the capture folder that causes the issue, instead of the `init` file in PennyLane. There was a brief discussion about this with @mlxd. Happy to change if needed, so please let me know what you think. - Downgraded `sphinx`. The reason is that I was getting so many [`sphinx` failures](https://github.com/PennyLaneAI/pennylane/actions/runs/14785640011/job/41513452178?pr=7369). I noticed that `sphinx` was updated recently in [this PR](#7212) (@rashidnhm or @runora95), in which `PennyLaneAI/[email protected]` has been replaced with `PennyLaneAI/sphinx-action@master` in `.github/workflows/docs.yml`. This branch was using `PennyLaneAI/sphinx-action@master`, and it was created from the 0.41 tag, which therefore was also using `PennyLaneAI/sphinx-action@master` (you can check by downloading the source code from GitHub). Therefore, in between the 0.41 release and [this PR](#7212), we must have changed `PennyLaneAI/sphinx-action@master` to `PennyLaneAI/[email protected]` at some point. Maybe @rashidnhm or @runora95 have some insight about what and why this happened. Thanks! Obviously, this change (that is, downgrading `sphinx`) will not be merged into master. - Replaced an outdated link in `qnn/__init__.py`. The reason is that I was getting an annoying `sphinx` failure: ``` /github/workspace/pennylane/qnn/__init__.py:docstring of pennylane.qnn:6: WARNING: unknown document: demos/tutorial_qnn_module_tf ``` And I noticed that the link to this demo in the [stable doc version](https://docs.pennylane.ai/en/stable/code/qml_qnn.html) is broken (most probably because the demo has been moved/renamed on March 20th, after the 0.41 release). I replaced the link with a working one in the only way I know. **Benefits:** An informative warning is raised when importing pennylane with the latest JAX installed. **Possible Drawbacks:** Strictly speaking, none as this is a bugfix release. **Related GitHub Issues:** None. **Related Shortcut Story:** [sc-90355] **Further details:** I tested this in a virtual conda environment. If `JAX` is installed with version <= 0.4.28 or if it is not installed at all, we get the following output when importing pennylane: ``` ~/Desktop/repos/pennylane warning_latest_jax > python -c "import pennylane" py PLPostRelease 19:15:18 ~/Desktop/repos/pennylane warning_latest_jax > py PLPostRelease 19:15:31 ``` If `JAX` is installed with version > 0.4.28, we get the following output when importing pennylane: ``` ~/Desktop/repos/pennylane warning_latest_jax > python -c "import pennylane" 6s py PLPostRelease 19:08:26 /home/pietropaolo.frisoni/Desktop/repos/pennylane/pennylane/__init__.py:35: RuntimeWarning: PennyLane is not yet compatible with JAX versions > 0.4.28. You have JAX 0.6.0 installed. Please downgrade JAX to <=0.4.28 to avoid runtime errors. warnings.warn( Traceback (most recent call last): (...) ``` I encourage you to try as well : )
Bump minimum Lightning and Catalyst versions (#7257) Don't merge until Lightning and Catalyst are released.
Bump minimum Lightning and Catalyst versions (#6813) Don't merge until Lightning and Catalyst are released.
Final merge from RC branch to master (#6526) Co-authored-by: lillian542 <[email protected]> Co-authored-by: David Wierichs <[email protected]> Co-authored-by: Pietropaolo Frisoni <[email protected]> Co-authored-by: Astral Cai <[email protected]> Co-authored-by: JerryChen97 <[email protected]> Co-authored-by: Christina Lee <[email protected]> Co-authored-by: Guillermo Alonso-Linaje <[email protected]> Co-authored-by: Andrija Paurevic <[email protected]> Co-authored-by: Alex Preciado <[email protected]> Co-authored-by: Justin Pickering <[email protected]> Co-authored-by: Isaac De Vlugt <[email protected]> Co-authored-by: ANTH0NY <[email protected]>
Remove useless sections from changelog (#6261) ### 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](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:** **Description of the Change:** **Benefits:** **Possible Drawbacks:** **Related GitHub Issues:**
Final RC sync for v0.38 (#6205) As name says --------- Co-authored-by: Astral Cai <[email protected]> Co-authored-by: Christina Lee <[email protected]> Co-authored-by: Utkarsh <[email protected]> Co-authored-by: Pietropaolo Frisoni <[email protected]> Co-authored-by: Guillermo Alonso-Linaje <[email protected]> Co-authored-by: Justin Pickering <[email protected]> Co-authored-by: lillian542 <[email protected]> Co-authored-by: Jack Brown <[email protected]> Co-authored-by: Diksha Dhawan <[email protected]> Co-authored-by: soranjh <[email protected]> Co-authored-by: soranjh <[email protected]> Co-authored-by: Cristian Emiliano Godinez Ramirez <[email protected]> Co-authored-by: Alex Preciado <[email protected]> Co-authored-by: Jorge J. Martínez de Lejarza <[email protected]> Co-authored-by: Isaac De Vlugt <[email protected]> Co-authored-by: Josh Izaac <[email protected]> Co-authored-by: Austin Huang <[email protected]>
PreviousNext