Skip to content

feat: Add initial jeff-qiskitc converter tool - #84

Draft
aks8134 wants to merge 1 commit into
unitaryfoundation:mainfrom
aks8134:jeff_qiskitc
Draft

feat: Add initial jeff-qiskitc converter tool#84
aks8134 wants to merge 1 commit into
unitaryfoundation:mainfrom
aks8134:jeff_qiskitc

Conversation

@aks8134

@aks8134 aks8134 commented Jul 22, 2026

Copy link
Copy Markdown

Summary

Adds tools/jeff-qiskitc, a C++ tool that converts a jeff Module into a
Qiskit QkCircuit via the Qiskit C API. jeff -> Qiskit direction only, for
now. I'll add Qiskit -> jeff direction commit, after getting feedback from reviewers regarding
the design chosen here.

  • WellKnownGate / PauliProductRotationGate / QubitGate (gate_converter.*)
    map jeff's QubitGate (wellKnown + controlled variants, and Pauli product
    rotations) onto the matching QkGate/QkPauliProductRotation.

  • Op / QubitOp / FloatOp / AllocOp / MeasureNdOp / GateOp
    (circuit_converter.*); each capnp union kind modeled as its own type

  • jeff_qiskitc.cpp is the entry point: a resource-counting pass sizes the
    QkCircuit up front, then a second pass builds it.

Currently covers QubitOp's alloc/measureNd/gate variants and Op's
qubit/float variants.

Testing

Added tools/jeff-qiskitc/tests/gate_conversion_test.cpp, exercising every
entry in WellKnownToQkGateMap/ControlledQkGateMap plus a handful of
Pauli product rotations, wired up via a new CMakeLists.txt
(ctest-registered). Locally: 216 assertions, 0 failures.

Open question for maintainers

This repo has no existing C++ build/CI setup. The new CMakeLists.txt needs QISKIT_C_DIR pointed at a
Qiskit C API install (headers + libqiskit.so), and I don't have visibility
into how CI should obtain that; build from source, a prebuilt release
artifact, or something else? Would appreciate guidance before wiring this
into CI.

Test plan

cmake -S tools/jeff-qiskitc -B build -DQISKIT_C_DIR=<path>
cmake --build build --target gate_conversion_test
ctest --test-dir build

AI Disclosures

All the library code and the design decisions have been made by me. For the tests and cmake files, I used claude code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant