Skip to content

Clarify sparse pyQuil unitary errors#1291

Open
Sanjays2402 wants to merge 2 commits into
qBraid:mainfrom
Sanjays2402:fix/pyquil-sparse-unitary-error
Open

Clarify sparse pyQuil unitary errors#1291
Sanjays2402 wants to merge 2 commits into
qBraid:mainfrom
Sanjays2402:fix/pyquil-sparse-unitary-error

Conversation

@Sanjays2402

Copy link
Copy Markdown

Closes #1287

Summary of changes

Sparse pyQuil programs now fail before pyQuil's low-level permutation logic and explain both supported qubit-compaction options. The regression test fails with Permutation SWAP index not valid before the fix and passes with the actionable error; all 8 focused pyQuil program tests and Ruff checks pass.

Reject sparse qubit indices before pyQuil leaks a low-level permutation failure and point callers to the supported compaction paths. Add a regression test and changelog entry.

Signed-off-by: Sanjay Santhanam <51058514+Sanjays2402@users.noreply.github.com>
@Sanjays2402
Sanjays2402 requested a review from ryanhill1 as a code owner July 23, 2026 06:52
@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: d0937f09-5b8a-4260-9660-56648d2fc614

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Signed-off-by: Sanjay Santhanam <51058514+Sanjays2402@users.noreply.github.com>
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.

PyQuilProgram.unitary() fails with an opaque error on sparse qubit indices

1 participant