🐛 Import array-valued Qiskit gate parameters - #2550
Merged
Merged
Conversation
Read custom operations through Python to avoid the scalar C API panic. Lower permutation patterns to reusable native SWAP functions in Core and preserve whole-gate modifiers. Other custom operations use their supplied definitions. Assisted-by: GPT-6 via Codex
Assisted-by: GPT-6 via Codex
10 tasks
simon1hofmann
marked this pull request as ready for review
September 13, 2026 11:25
burgholzer
approved these changes
Sep 13, 2026
burgholzer
left a comment
Member
There was a problem hiding this comment.
This feels pretty reasonable. I just have a general observation on the changelog that may be worth thinking about. Let's resolve that and then get this merged.
🤖 *AI text below* 🤖 Remove the entry and its PR link as requested during the changelog-policy review. Release preparation will collect the user-facing changes. Assisted-by: GPT-6 via Codex
This was referenced Sep 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 AI text below 🤖
Description
Importing a
PermutationGateor a custom instruction with array-valued parameters currently reaches Qiskit's scalar C API and can abort Python. Read custom operation operands through the adapter, validate permutation patterns, and lower permutations to reusable SWAP functions in Core. Preserve modifiers on the complete permutation. Other custom operations use their supplied circuit definitions; unsupported opaque operations raise a Python exception.The implementation does not call Qiskit synthesis or transpilation. Qiskit is used only by the existing import/export adapter to read and construct SDK objects. Core owns permutation lowering and the compilation pipeline.
This removes an upstream cause of the compatibility normalization in munich-quantum-toolkit/bench#1027. Bench should retain its workaround until a Core release includes this fix.
Usage
Limitations
Changelog and upgrade-guide entries are deferred to release preparation under the policy proposed in #2556 and munich-quantum-toolkit/templates#449. This PR has no entries in either file.
Validation
uvx nox -s stubs.origin/main.Checklist
If PR contains AI-assisted content:
🤖 *AI text below* 🤖(titles are exempt).