Skip to content

feat: experimental exact simulators (3/5) (#1855)#1860

Draft
bramathon wants to merge 1 commit into
1854-qudit-noise-modelfrom
1855-experimental-exact-simulators
Draft

feat: experimental exact simulators (3/5) (#1855)#1860
bramathon wants to merge 1 commit into
1854-qudit-noise-modelfrom
1855-experimental-exact-simulators

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 3 of 5, stacked on #1859 — review/merge in order. Closes #1855.

This PR adds the new pyquil.simulation core and the two exact simulators:

  • PureStateVectorSimulator — jit/grad-friendly evolution for gate-only programs.
  • DensityMatrixSimulator — jit/grad-friendly density-matrix evolution for any program, optionally with a NoiseModel.

Both are backed by quax, support qutrit/qudit registers, and share the new _resolver.py pipeline (program expansion, qubit remapping, DAG construction, and greedy operator compression) plus a vectorized gate constructor that keeps compile time proportional to the number of distinct gate kinds rather than gate count. The architecture is documented in the new simulation_architecture.rst.

The trajectory simulators that build on this same base (TrajectorySimulator, DynamicTrajectorySimulator) land in the following PRs, so _simulator.py here contains only the grad-able family. This PR also restores the density-matrix-based ResetChannel verification tests that were deferred from #1854.

Stack

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

Tracked in #1863.

#1855)

Add the pyquil.simulation core (_resolver pipeline + vectorized gate constructor)
and the grad-able PureStateVectorSimulator and DensityMatrixSimulator, with qutrit
support and noise-model integration. Restore the density-matrix ResetChannel tests
deferred from #1854. 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

Branch1855-experimental-exact-simulators
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
10.53 s
test/benchmarks/test_program.py::test_instructions📈 view plot
⚠️ NO THRESHOLD
3.34 s
test/benchmarks/test_program.py::test_iteration📈 view plot
⚠️ NO THRESHOLD
3.30 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