Skip to content

Add safe shape checking to synth_cz_depth_line_mr#16154

Merged
alexanderivrii merged 2 commits intoQiskit:mainfrom
jakelishman:synth-bounds-check
May 7, 2026
Merged

Add safe shape checking to synth_cz_depth_line_mr#16154
alexanderivrii merged 2 commits intoQiskit:mainfrom
jakelishman:synth-bounds-check

Conversation

@jakelishman
Copy link
Copy Markdown
Member

This was previously unverified, which could lead to Rust panicking if the matrix was taller than it was wide.

Fix #16152

AI/LLM disclosure

  • I didn't use LLM tooling, or only used it privately.
  • I used the following tool to help write this PR description:
  • I used the following tool to generate or modify code:

This was previously unverified, which could lead to Rust panicking if
the matrix was taller than it was wide.
@jakelishman jakelishman added this to the 2.4.2 milestone May 7, 2026
@jakelishman jakelishman requested a review from a team as a code owner May 7, 2026 12:52
@jakelishman jakelishman requested a review from alexanderivrii May 7, 2026 12:52
@jakelishman jakelishman added stable backport potential Make Mergify open a backport PR to the most recent stable branch on merge. Changelog: Fixed Add a "Fixed" entry in the GitHub Release changelog. labels May 7, 2026
@qiskit-bot
Copy link
Copy Markdown
Collaborator

One or more of the following people are relevant to this code:

  • @Qiskit/terra-core

@coveralls
Copy link
Copy Markdown

coveralls commented May 7, 2026

Coverage Report for CI Build 25499096380

Coverage decreased (-0.03%) to 87.602%

Details

  • Coverage decreased (-0.03%) from the base build.
  • Patch coverage: 7 of 7 lines across 1 file are fully covered (100%).
  • 39 coverage regressions across 5 files.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

39 previously-covered lines in 5 files lost coverage.

File Lines Losing Coverage Coverage
crates/qasm2/src/parse.rs 24 96.21%
crates/qasm2/src/lex.rs 9 91.26%
crates/circuit/src/parameter/symbol_expr.rs 4 74.09%
crates/circuit/src/parameter/parameter_expression.rs 1 91.04%
crates/transpiler/src/passes/unitary_synthesis/decomposers.rs 1 94.71%

Coverage Stats

Coverage Status
Relevant Lines: 122069
Covered Lines: 106935
Line Coverage: 87.6%
Coverage Strength: 962102.32 hits per line

💛 - Coveralls

Comment thread qiskit/synthesis/linear_phase/cz_depth_lnn.py Outdated
Co-authored-by: Shelly Garion <46566946+ShellyGarion@users.noreply.github.com>
Copy link
Copy Markdown
Member

@ShellyGarion ShellyGarion left a comment

Choose a reason for hiding this comment

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

LGTM. thanks for fixing this so quickly!
@alexanderivrii - would you like to review it too?

Copy link
Copy Markdown
Member

@alexanderivrii alexanderivrii left a comment

Choose a reason for hiding this comment

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

LGTM!

@alexanderivrii alexanderivrii added this pull request to the merge queue May 7, 2026
Merged via the queue into Qiskit:main with commit a8e043f May 7, 2026
26 checks passed
@jakelishman jakelishman deleted the synth-bounds-check branch May 7, 2026 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Changelog: Fixed Add a "Fixed" entry in the GitHub Release changelog. stable backport potential Make Mergify open a backport PR to the most recent stable branch on merge.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pyo3_runtime.PanicException numpy error on badly shaped matrix passed to synth_cz_depth_line_mr

5 participants