Skip to content

Some more RNG Error fixes#270

Merged
ciaranra merged 3 commits intodevfrom
better-rng-error-codes
Mar 21, 2026
Merged

Some more RNG Error fixes#270
ciaranra merged 3 commits intodevfrom
better-rng-error-codes

Conversation

@Jonhas-qtm
Copy link
Copy Markdown
Collaborator

Better error messages for encountering errors using pcg rng that were missed in #267

@Jonhas-qtm Jonhas-qtm requested review from ciaranra and qartik March 18, 2026 06:12
@ciaranra
Copy link
Copy Markdown
Member

The changes look straight forward. You might want to run just lint-fix to deal with the linting issues

@qartik qartik requested a review from Copilot March 19, 2026 13:52
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR improves clarity of RNG-related error messages for PCG RNG platform functions across the Python CVM RNG model and the Rust QASM engine, addressing missed cases from PR #267.

Changes:

  • Updates Python RNGModel stringification and refines error handling/messages for invalid RNG index and unsupported RNG functions.
  • Improves Rust QASM evaluate_rng_models parse error messages for RNG* platform function calls (argument count/type and unknown function name).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
python/quantum-pecos/src/pecos/engines/cvm/rng_model.py Refines RNG model display string; changes exception/message for invalid RNGindex; updates unsupported RNG function error text.
crates/pecos-qasm/src/engine.rs Replaces non-interpolated string literals with format! and makes RNG platform-function parse errors more specific/consistent.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Collaborator

@qartik qartik left a comment

Choose a reason for hiding this comment

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

Also, see the unresolved comments from Copilot.

@ciaranra ciaranra merged commit 8736c84 into dev Mar 21, 2026
67 checks passed
@ciaranra ciaranra deleted the better-rng-error-codes branch March 21, 2026 18:40
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.

4 participants