Skip to content

Faster python shot conversion using numpy - #227

Open
david-pl wants to merge 1 commit into
mainfrom
david/sample-stim-numpy
Open

david-pl wants to merge 1 commit into
mainfrom
david/sample-stim-numpy

Conversation

@david-pl

Copy link
Copy Markdown
Collaborator

This conversion is taking up a significant part of runtime per shot for many qubits.

Copilot AI lite review requested due to automatic review settings September 25, 2026 07:55

Copilot AI 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.

Copilot review overview

🔵 Needs a closer look

Unresolved moderate findings affect sampling performance, native typing, and positional overload behavior.

Review effort: Lite
Findings: None

What changed in this PR

Adds optional NumPy-backed shot sampling to reduce Python conversion overhead.

Changes:

  • Adds NumPy as a runtime dependency.
  • Exposes flattened native results as writable int8 arrays.
  • Updates sampling types and tests.
File Summary
ppvm-python/​uv.lock Locks the NumPy runtime dependency.
ppvm-python/​test/​generalized_tableau/​test_stim.py Tests NumPy sampling behavior.
ppvm-python/​test/​generalized_tableau/​test_basics.py Updates type-checker suppression.
ppvm-python/​src/​ppvm/​generalized_tableau.py Adds as_numpy sampling support and overloads.
ppvm-python/​src/​ppvm/​_core.pyi Updates native sampling return typing.
ppvm-python/​pyproject.toml Declares NumPy as a runtime dependency.
crates/​ppvm-python-native/​src/​interface_tableau.rs Produces flattened bytearray sampling results.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@github-actions

Copy link
Copy Markdown
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://QuEraComputing.github.io/ppvm/pr-preview/pr-227/

Built to branch gh-pages at 2026-09-25 08:05 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@david-pl
david-pl requested a review from Roger-luo September 25, 2026 12:08

This branch has not been deployed

No deployments
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.

2 participants