Skip to content

Add some macro helpers for ProgramOp - #16923

Open
Ian Hincks (ihincks) wants to merge 1 commit into
ihincks/qp-04-quantum-functionfrom
ihincks/qp-05-arity-macro
Open

Add some macro helpers for ProgramOp#16923
Ian Hincks (ihincks) wants to merge 1 commit into
ihincks/qp-04-quantum-functionfrom
ihincks/qp-05-arity-macro

Conversation

@ihincks

Copy link
Copy Markdown
Contributor

This PR adds a macro for unpacking operands that is generic enough for a bunch of
nodes to use. It also adds a macro to help implement op nodes that perform reduction
along an axis, like Mean.

AI/LLM disclosure

  • No part of this submission is LLM generated.
  • Some written text was generated by:
  • Some submitted code was generated by: claude opus 5

Stack created with GitHub Stacks CLIGive Feedback 💬

@coveralls

Coveralls (coveralls) commented Sep 3, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 34398811426

Warning

No base build found for commit 6ebcde5 on ihincks/qp-04-quantum-function.
Coverage changes can't be calculated without a base build.
If a base build is processing, this comment will update automatically when it completes.

Coverage: 88.028%

Details

  • Patch coverage: 39 of 39 lines across 4 files are fully covered (100%).

Uncovered Changes

No uncovered changes found.

Coverage Regressions

Requires a base build to compare against. How to fix this →


Coverage Stats

Coverage Status
Relevant Lines: 134777
Covered Lines: 118641
Line Coverage: 88.03%
Coverage Strength: 970850.6 hits per line

💛 - Coveralls

@ihincks Ian Hincks (ihincks) added the mod: providers Related to the backend and job abstractions label Sep 3, 2026
@ihincks Ian Hincks (ihincks) added this to the 2.6.0 milestone Sep 3, 2026
@github-project-automation github-project-automation Bot moved this to Ready in Qiskit 2.6 Sep 3, 2026
@ihincks
Ian Hincks (ihincks) marked this pull request as ready for review September 3, 2026 23:27
@ihincks
Ian Hincks (ihincks) requested a review from a team as a code owner September 3, 2026 23:27
@qiskit-bot

Copy link
Copy Markdown
Collaborator

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

  • @Qiskit/terra-core

@ihincks Ian Hincks (ihincks) changed the title Add some macro helpers for OpNodeType Add some macro helpers for ProgramOp Sep 9, 2026
Every op in the catalogue destructured its operand slice against a pattern
and panicked otherwise, which wrote the arity a second time in the panic
message. `unpack_operands!` takes the count from `arity()` instead. It is
exported because an op defined outside the crate writes the same block.

The three reductions differed only in the dtype they produce and in the fold
itself, so `reduction_op!` generates what they share and each op supplies
`reduce_axis`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod: providers Related to the backend and job abstractions

Projects

Status: Ready

Development

Successfully merging this pull request may close these issues.

4 participants