Revert "Remove the pennylane.noise module (#10214)" - #10256
Open
JerryChen97 wants to merge 4 commits into
Open
JerryChen97 wants to merge 4 commits into
JerryChen97 wants to merge 4 commits into
Conversation
This reverts commit 0012c52. Restores the `pennylane.noise` module and its re-exports (`qp.noise`, `qp.NoiseModel`, `qp.add_noise`, `qp.insert`, the ZNE mitigation transforms, and `qp.from_qiskit_noise`), along with the docs, tach module entry and tests that were removed alongside it. Conflict in `doc/development/deprecations.rst`: #10238 (pulse removal) added entries at the same location, so main's entries were kept and only the `pennylane.noise` bullet was dropped. Drafted with AI assistance (GitHub Copilot CLI), reviewed before committing. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The reverted tests predate the removal of TensorFlow interface support from main, so `test_exponential_extrapolation_tf`, `test_diffability_tf` and `test_diffability_tf_multi` can no longer run: `tf` is not a registered pytest marker, no CI job selects it, and a local run fails on `ModuleNotFoundError: No module named 'tensorflow'`. Equivalent autograd, torch and jax coverage is retained. Drafted with AI assistance (GitHub Copilot CLI), reviewed before committing. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
JerryChen97
marked this pull request as ready for review
October 2, 2026 18:29
andrijapau
approved these changes
Oct 2, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #10256 +/- ##
==========================================
+ Coverage 99.41% 99.43% +0.02%
==========================================
Files 603 609 +6
Lines 66975 67569 +594
==========================================
+ Hits 66580 67187 +607
+ Misses 395 382 -13 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Codecov flagged 7 uncovered lines on #10256. These are defensive paths that the restored test suite does not exercise: - `_check_position`: the two `except AttributeError` handlers, which are already guarded by `isinstance(..., type)` before the `issubclass` call. - the `stop_at` guard clauses in `insert` and `add_noise`, which bail out on non-`Operator` objects and operators without a decomposition. Excluded with `# pragma: no cover` rather than adding tests, as requested on the PR. Drafted with AI assistance (GitHub Copilot CLI), reviewed before committing. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
Drafted with AI assistance (GitHub Copilot CLI), reviewed before opening.
Context:
#10214 removed the
pennylane.noisemodule. This PR reverts that removal, to unblock Catalyst.Description of the Change:
Reverts 0012c52, restoring:
qp.noise,qp.NoiseModel,qp.add_noise,qp.insertmitigate_with_zne,fold_global,poly_extrapolate,richardson_extrapolate,exponential_extrapolateqp.from_qiskit_noisedoc/code/qp_noise.rstpage anddoc/index.rstentry, thepennylane.noisetach.tomlmodule entry (tertiary layer), and thetests/noise/suiteTwo deviations from a pure
git revert:doc/development/deprecations.rstconflict. Remove theqp.pulsemodule #10238 (pulse removal) added entries at the same location, so main's entries were kept and only thepennylane.noisebullet was dropped.tests/noise/test_mitigate.py(test_exponential_extrapolation_tf,test_diffability_tf,test_diffability_tf_multi). They predate the removal of TensorFlow interface support from main, sotfis no longer a registered pytest marker, no CI job selects it, and a local run fails onModuleNotFoundError: No module named 'tensorflow'. Equivalent autograd, torch and jax coverage is retained.The changelog entry for #10214 is removed rather than replaced with a "reverted" bullet, so the net changelog reads as if the removal never landed. Happy to add an explicit entry if reviewers prefer.
Benefits:
Restores the noise-model and ZNE mitigation API for callers that still depend on it.
Possible Drawbacks:
Re-adds the module surface that #10214 set out to drop. As noted in that PR,
_preprocess_deviceinpennylane/devices/device_api.pyreturns to being uncovered (the# pragma: no coveradded by #10214 is reverted along with it).Related GitHub Issues:
Reverts #10214