Skip to content

feat: qudit noise model (2/5) (#1854)#1859

Draft
bramathon wants to merge 1 commit into
1852-drop-python-39from
1854-qudit-noise-model
Draft

feat: qudit noise model (2/5) (#1854)#1859
bramathon wants to merge 1 commit into
1852-drop-python-39from
1854-qudit-noise-model

Conversation

@bramathon

@bramathon bramathon commented Jul 4, 2026

Copy link
Copy Markdown
Collaborator

Part of the effort to land the experimental noise model and simulation module (originally PR #1848, branch nonbreaking-noise-model) as a reviewable stack. This is PR 2 of 5, stacked on #1858 — review/merge in order. Closes #1854.

This PR introduces the new quax-backed qudit noise model under pyquil/noise/:

  • Channel, MeasurementChannel, ResetChannel, and CycleChannel (_channels.py), and the new NoiseModel container plus DepolarizingNoiseModel / CompositeNoiseModel and fidelity estimators (_noise_model.py).
  • The historical pyquil.noise public API is preserved: pyquil/noise.py is moved to pyquil/noise/_legacy_noise.py and re-exported from pyquil/noise/__init__.py, with the legacy NoiseModel/KrausModel now marked deprecated in favor of the quax-based model.

It also adds qudit DefGate support in quilbase.py (matrix dimensions may now be any perfect power, e.g. 3, 9, …, not just powers of two), which the qutrit noise channels and later simulators rely on, and enables float64 (jax_enable_x64) for the test suite.

A handful of ResetChannel tests verify behavior end-to-end through the density-matrix simulator; since that simulator lands in the next PR, those specific assertions are deferred to #1855 (they are restored there). Everything else in the noise module is fully tested here (test_noise_model.py).

Stack

  1. Drop Python 3.9 #1852 — Drop Python 3.9
  2. Qudit Noise model #1854 — Qudit noise model (this PR)
  3. Experimental exact simulators #1855 — Experimental exact simulators
  4. Trajectory simulator #1856 — Trajectory simulator
  5. Dynamic shape trajectory simulator #1857 — Dynamic-shape trajectory simulator

Tracked in #1863.

Introduce the new noise model under pyquil/noise/ (Channel, MeasurementChannel,
ResetChannel, CycleChannel and the quax-based NoiseModel), preserving the legacy
pyquil.noise API via _legacy_noise.py. Add qudit DefGate support in quilbase and
enable float64 for tests. Part of splitting PR #1848 into a reviewable stack.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jul 4, 2026

Copy link
Copy Markdown

🐰 Bencher Report

Branch1854-qudit-noise-model
Testbedci-runner-linux

⚠️ WARNING: No Threshold found!

Without a Threshold, no Alerts will ever be generated.

Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the --ci-only-thresholds flag.

Click to view all benchmark results
BenchmarkLatencyseconds (s)
test/benchmarks/test_program.py::test_copy_everything_except_instructions📈 view plot
⚠️ NO THRESHOLD
9.77 s
test/benchmarks/test_program.py::test_instructions📈 view plot
⚠️ NO THRESHOLD
3.22 s
test/benchmarks/test_program.py::test_iteration📈 view plot
⚠️ NO THRESHOLD
3.28 s
🐰 View full continuous benchmarking report in Bencher

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant