Skip to content

feat: drop Python 3.9 support, add rigetti-quax (1/5) (#1852) - #1858

Merged
asaites merged 1 commit into
masterfrom
1852-drop-python-39
Jul 16, 2026
Merged

asaites merged 1 commit into
masterfrom
1852-drop-python-39

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 1 of 5; the remaining PRs stack on top of this branch and should be reviewed/merged in order. Closes #1852.

This PR raises the minimum supported Python to 3.11 (dropping 3.9/3.10), adds rigetti-quax as a dependency (the foundation the later noise-model and simulator PRs build on), and refreshes poetry.lock, the Dockerfiles, and the GitHub Actions workflows accordingly.

The bulk of the diff is mechanical typing modernization enabled by 3.11 — Optional[X]/Union[...] → X | None, collections.abc.Callable, explicit zip(..., strict=...) — plus a couple of doctest/snapshot CI stabilizations (the QASM transpile snapshot is replaced with explicit line assertions). There is no functional behavior change in this PR.

Stack

  1. Drop Python 3.9 #1852 — Drop Python 3.9 (this PR)
  2. Qudit Noise model #1854 — Qudit noise model
  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.

@github-actions

github-actions Bot commented Jul 4, 2026 •

Copy link
Copy Markdown

🐰 Bencher Report

Branch1852-drop-python-39
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.87 s
test/benchmarks/test_program.py::test_instructions📈 view plot
⚠️ NO THRESHOLD
3.45 s
test/benchmarks/test_program.py::test_iteration📈 view plot
⚠️ NO THRESHOLD
3.50 s
🐰 View full continuous benchmarking report in Bencher

@github-actions

github-actions Bot commented Jul 4, 2026 •

Copy link
Copy Markdown

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
7294 6413 88% 87% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
pyquil/api/_abstract_compiler.py 92% 🟢
pyquil/api/_benchmark.py 92% 🟢
pyquil/api/_compiler.py 61% 🟢
pyquil/api/_compiler_client.py 95% 🟢
pyquil/api/_qam.py 92% 🟢
pyquil/api/_qpu.py 65% 🟢
pyquil/api/_quantum_computer.py 82% 🟢
pyquil/api/_qvm.py 86% 🟢
pyquil/api/_wavefunction_simulator.py 81% 🟢
pyquil/control_flow_graph.py 100% 🟢
pyquil/experiment/_group.py 92% 🟢
pyquil/experiment/_main.py 81% 🟢
pyquil/experiment/_result.py 87% 🟢
pyquil/experiment/_setting.py 94% 🟢
pyquil/gates.py 87% 🟢
pyquil/latex/_diagram.py 92% 🟢
pyquil/latex/_ipython.py 29% 🟢
pyquil/latex/_main.py 100% 🟢
pyquil/latex/latex_generation.py 0% 🟢
pyquil/noise.py 94% 🟢
pyquil/noise_gates.py 86% 🟢
pyquil/operator_estimation.py 89% 🟢
pyquil/paulis.py 95% 🟢
pyquil/pyqvm.py 74% 🟢
pyquil/quantum_processor/graph.py 94% 🟢
pyquil/quantum_processor/qcs.py 79% 🟢
pyquil/quantum_processor/transformers/graph_to_compiler_isa.py 84% 🟢
pyquil/quantum_processor/transformers/qcs_isa_to_compiler_isa.py 76% 🟢
pyquil/quil.py 84% 🟢
pyquil/quilatom.py 83% 🟢
pyquil/quilbase.py 94% 🟢
pyquil/quiltcalibrations.py 98% 🟢
pyquil/quiltwaveforms.py 100% 🟢
pyquil/simulation/_numpy.py 94% 🟢
pyquil/simulation/_reference.py 76% 🟢
pyquil/simulation/tools.py 93% 🟢
pyquil/wavefunction.py 79% 🟢
TOTAL 83% 🟢

updated for commit: 414f175 by action🐍

@bramathon
bramathon marked this pull request as ready for review July 4, 2026 16:22
@bramathon
bramathon requested a review from a team as a code owner July 4, 2026 16:22
@windsurf-bot

windsurf-bot Bot commented Jul 4, 2026

Copy link
Copy Markdown

This PR has too many files to review (>50 files).

@asaites asaites left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This looks great. Thank you for the hard work.

I think there's a mistake in the new help Makefile target, but other than that, I only had some questions/comments on some versions used in the workflows. I don't think they need to be block the PR, though.

Comment thread Makefile
Comment thread .github/workflows/publish.yml Outdated
Comment thread .github/workflows/test.yml
@bramathon

Copy link
Copy Markdown
Collaborator Author

Updated rigetti-quax lower bound to 0.7.0

@bramathon

Copy link
Copy Markdown
Collaborator Author

I don't understand the OSV check failure

@asaites

asaites commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

I don't understand the OSV check failure

Looks like we should update setuptools to >=v83.0.0 to avoid this specific bug, though in our case, MANIFEST.in has no exclude rules, so it doesn't have a real impact on us.

@bramathon

Copy link
Copy Markdown
Collaborator Author

Updates setuptools to >83.0 and the checkout workflow to v7 in all locations

@bramathon

Copy link
Copy Markdown
Collaborator Author

@asaites What should the version be set to before merge?

@asaites

asaites commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

What should the version be set to before merge?

In a certain sense, it doesn't matter, because the Release workflow will run once merged, and knope will bump the version and commit the updated file. If you'd like, you can set it to v4.21.0, which is what the most recent dry-run says it would become.

Comment thread .github/workflows/release.yml
@bramathon

Copy link
Copy Markdown
Collaborator Author

What should the version be set to before merge?

In a certain sense, it doesn't matter, because the Release workflow will run once merged, and knope will bump the version and commit the updated file. If you'd like, you can set it to v4.21.0, which is what the most recent dry-run says it would become.

The latest pyquil release on pypi is 4.17 so I thought this would be 4.18 if we increment

@asaites

asaites commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

The latest pyquil release on pypi is 4.17 so I thought this would be 4.18 if we increment

Oh interesting. knope does use the pyproject.toml's version number as well as the current tag values; I was under the mistaken impression it just used the tags themselves. In that case, you should set it back to 4.17.0, and knope should set it to 4.18.0.

@bramathon
bramathon force-pushed the 1852-drop-python-39 branch from f1884bc to 414f175 Compare July 15, 2026 18:08
@bramathon

Copy link
Copy Markdown
Collaborator Author

Squashed

@asaites
asaites merged commit 9a4fff4 into master Jul 16, 2026
14 checks passed
@asaites
asaites deleted the 1852-drop-python-39 branch July 16, 2026 19:06
@asaites asaites self-assigned this Jul 17, 2026
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.

Drop Python 3.9

2 participants