[Feature][QDP] Prototype interoperability with PennyLane and Qiskit
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Active
- Domain
- backend, machine-learning
Research direction
Start with the Q4 interoperability discussion #1465 and the one-encode-path work in #1477, then locate the existing Encoder path and the framework APIs for state preparation. Define the adapter mapping and supported circuit subset, implement both milestones with optional framework imports, and add mapping tests, a design note, and one runnable example per framework. Done means the documented prototype handles the supported cases and rejects unsupported operations with a list of them.
Written by the indexing model from the issue text.
Description
Description
Add a small interoperability prototype so PennyLane and Qiskit users can use QDP for data encoding without adopting QuMat first.
The first milestone exposes QDP-encoded states as framework-native objects. A second milestone accepts a narrow, documented state-preparation circuit from each framework and maps it onto existing QDP encodings. This is a prototype to learn whether the workflow is useful, not a new execution engine.
Use case
A user already has a PennyLane QNode or a Qiskit circuit and wants QDP's GPU encoding and memory planning. Today they must either rebuild the preparation in QuMat or move intermediate arrays by hand. Circuit.initialize(state) covers the Qiskit case inside QuMat, but there is no direct framework-native entry point and no PennyLane support.
This is the interoperability area from the Q4 roadmap discussion (#1465): QDP as a preparation layer that other frameworks can call.
Proposed solution and alternatives
Proposed module: qumat.interop (name open for discussion), with framework modules imported lazily so neither PennyLane nor Qiskit becomes a hard dependency.
Milestone 1, QDP to framework:
encode_state(data, encoding=..., num_qubits=...)that calls the existingEncoderpath and returns a state vector.pennylane.state(...)returns an array suitable forqml.StatePrep/qml.QubitStateVector.qiskit.state(...)returns aqiskit.quantum_info.Statevectoror aninitializeinstruction.- The adapter should accept either an
Encoder-produced tensor or a precomputed NumPy state vector, so mapping and framework handoff can be tested without a GPU. The end-to-end path uses the existing CUDA/AMDEncoder; there is no CPU QDP encoder today. - Tests skip cleanly when the optional framework is not installed.
Milestone 2, framework to QDP:
from_pennylane(circuit)andfrom_qiskit(circuit)for a documented subset only: basis-state preparation, amplitude state preparation, and angle encoding.- Reject unsupported operations with an error that lists them.
- Do not transpile arbitrary gate sets.
Deliverables:
- Prototype module.
- Short design note covering the mapping, the supported subset, and where the adapter sits relative to QuMat and QDP.
- Unit tests for the mapping.
- One runnable example per framework.
Alternatives considered:
- Full circuit transpilation into QuMat. Too large for a prototype and duplicates work in both frameworks.
- Documentation-only array export. Does not close the workflow gap.
Out of scope:
- Full gate-set transpilation.
- QPU execution.
- Replacing PennyLane or Qiskit.
- New encodings.
- Bypassing the one-encode-path work in #1477.
Related issues
- Discussion #1465 (Q4 roadmap, interoperability area)
- #1477 (one encode path), which the adapter should call
- #1431 (Preprocessor bindings), if input validation is reused
Are you willing to submit a PR?
Yes.
- Dominant language
- Rust
- Stars
- 2.3k
- Forks
- 1k
- Avg merge
- 2d 20h
- Merged PRs (30d)
- 7
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing 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.
More from apache/mahout
-
[Bug] Amazon Braket get_final_state_vector() changes the circuit, so execute_circuit() fails afterwardsPossibly taken @Howardisme claimed this 48 days ago. Openbug enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
apache/mahout#1538 · 1 comment ·
Maintainers usually reply within 2 days
-
[Bug] Reusing a parameter name on two gates fails on Qiskit only (name conflict adding parameter)Possibly taken @Imad2702 claimed this 50 days ago. Openbug enhancement good-first-issue qumat
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
apache/mahout#1509 · 2 comments ·
Maintainers usually reply within 2 days
-
[Bug] Cirq backend ignores the initialized simulator and creates its own cirq.Simulator()Possibly taken @Howardisme claimed this 49 days ago. Openbug enhancement good-first-issue qumat
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
apache/mahout#1508 · 1 comment · 1 assignee ·
Maintainers usually reply within 2 days
-
[Bug] Unknown backend_name leaks ModuleNotFoundError instead of a clear ValueErrorPossibly taken @Asterisk-Hunter claimed this 38 days ago. Openbug enhancement good-first-issue qumat
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
apache/mahout#1506 · 5 comments ·
Maintainers usually reply within 2 days
-
Braket backend: circuit mutation and NumPy scalar parity bugsPossibly taken @andrewmusselman claimed this 46 days ago. Openbug enhancement
Difficulty 1/5 1-3 hours Newbie friendliness 1/100
Maintainers usually reply within 2 days
Similar issues
-
chat compiler P1
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
HerringtonDarkholme/hd-lang#2793 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
security-advisory
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
MinBZK/regelrecht#2173 ·
-
ci
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
jonathanong/no-mistakes#5804 ·
-
triage: failed
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
oxc-project/tsrs#1277 · 1 comment ·
Maintainers usually reply within 1 day