feat: Add initial jeff-qiskitc converter tool - #84
Draft
aks8134 wants to merge 1 commit into
Draft
Conversation
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.
Summary
Adds
tools/jeff-qiskitc, a C++ tool that converts a jeffModuleinto aQiskit
QkCircuitvia the Qiskit C API. jeff -> Qiskit direction only, fornow. 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 productrotations) onto the matching
QkGate/QkPauliProductRotation.Op/QubitOp/FloatOp/AllocOp/MeasureNdOp/GateOp(circuit_converter.*); each capnp union kind modeled as its own type
jeff_qiskitc.cppis the entry point: a resource-counting pass sizes theQkCircuitup front, then a second pass builds it.Currently covers
QubitOp'salloc/measureNd/gatevariants andOp'squbit/floatvariants.Testing
Added
tools/jeff-qiskitc/tests/gate_conversion_test.cpp, exercising everyentry in
WellKnownToQkGateMap/ControlledQkGateMapplus a handful ofPauli 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.txtneedsQISKIT_C_DIRpointed at aQiskit C API install (headers +
libqiskit.so), and I don't have visibilityinto 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_testctest --test-dir buildAI Disclosures
All the library code and the design decisions have been made by me. For the tests and cmake files, I used claude code.