Skip to content

Reject NaN RZZ angles during primitive validation - #3069

Open
sankalpsthakur wants to merge 1 commit into
Qiskit:mainfrom
sankalpsthakur:fix-2452-reject-nan-rzz
Open

Reject NaN RZZ angles during primitive validation#3069
sankalpsthakur wants to merge 1 commit into
Qiskit:mainfrom
sankalpsthakur:fix-2452-reject-nan-rzz

Conversation

@sankalpsthakur

@sankalpsthakur sankalpsthakur commented Jul 21, 2026

Copy link
Copy Markdown

Summary

Reject fixed and parameterized RZZ angles whose evaluated value is NaN. This keeps invalid input inside the existing IBMInputValueError validation path instead of accepting a fixed NaN or leaking a raw Qiskit binding error.

Details and comments

  • evaluate parameter expressions with bind_all before validating the resulting angle
  • preserve valid expressions where a NaN-valued parameter is algebraically eliminated
  • extend fixed and parameterized RZZ regression coverage, including the eliminated-NaN case
  • add the required Towncrier bug-fix fragment

Validation:

  • python -m pytest -q test/unit/test_sampler.py: 43 passed, 3 subtests passed
  • ruff check on touched Python files: passed
  • ruff format --check on touched Python files: passed
  • mypy --no-incremental on touched Python files: passed
  • git diff --check: passed
  • additional automated code review: no findings after the eliminated-parameter revision

Why this matters

NaN gate angles should fail fast at validation time with a clear error, not propagate into backend execution or produce undefined results on real hardware.

Related

Fixes #2452

AI/LLM disclosure

  • I didn't use LLM tooling, or only used it privately.
  • I used OpenAI Codex to help write this PR description.
  • I used OpenAI Codex to generate or modify code and tests.

@CLAassistant

CLAassistant commented Jul 21, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@sankalpsthakur
sankalpsthakur force-pushed the fix-2452-reject-nan-rzz branch 3 times, most recently from 6cd785e to cbb89b5 Compare July 23, 2026 05:09
Evaluate parameter expressions before validating their effective RZZ angle so algebraically eliminated NaN inputs remain valid.
@sankalpsthakur
sankalpsthakur force-pushed the fix-2452-reject-nan-rzz branch from cbb89b5 to ea62061 Compare July 28, 2026 10:09
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.

rzz angle validation could check for nan

2 participants