munich-quantum-toolkit / munich-quantum-toolkit/core
✨ Preserve Qiskit transpiler layouts in compiler programs
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 133
- Forks
- 73
- Avg merge
- 17h 34m
- Merged PRs (30d)
- 261
Description
🤖 AI text below 🤖
Goal
Preserve Qiskit transpiler layout information in compiler programs. The initial translation in #2031 accepts circuits with circ.layout, imports their operations normally, and intentionally ignores the layout metadata.
Implementation direction
- Define a shared compiler layout representation for mappings between logical resources, physical resources, and any output permutation. Do not store an opaque Qiskit object or Qiskit-specific module attributes.
- Specify the lifetime and update rules for layouts as compiler transformations add, remove, reorder, route, or reuse qubits.
- Distinguish an initial layout, a final layout, and a transformation-derived permutation where the distinction affects semantics.
- Import the supported Qiskit layout forms into this representation and reconstruct compatible Qiskit layout metadata on output.
- Define explicit degradation or rejection behavior when an output format cannot preserve the layout.
Edge cases
- Partial layouts, ancilla qubits, virtual-to-physical gaps, final permutations, routed circuits, and circuits whose registers do not follow physical order.
- Layouts that become stale after transformations or refer to resources removed from the program.
- Import from and export to Qiskit minor versions with different layout surface APIs.
Acceptance tests
- Import currently supported circuits both with and without layouts and confirm identical instruction semantics.
- Round trips for initial layouts, final layouts, ancillas, partial mappings, and nontrivial permutations.
- Transformation tests that verify mappings are updated or invalidated according to the documented contract.
- Explicit tests for output formats that cannot represent the compiler layout.
Part of #917.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the initial Qiskit translation described in #2031 and the compiler transformations that can change qubit mappings. Define the documented layout lifetime and update rules, then use the listed acceptance cases to verify imports, round trips, transformations, and unsupported output formats.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100