Hi developers, today I released a (yet) tiny OCaml binding for the quantum computing sdk of IBM, named qiskit. Qiskit is a python library, so I used pyml for wrapping python classes and modules over OCaml (that was very easy, pyml worked like a charm).
At the moment the library allows to:
- create a quantum circuit using all the standard gates and draw it
- simulate the quantum circuit execution locally
- send the circuit to IBM quantum computer for real hardware execution
The source code of this is available here: https://github.com/dakk/caml_qiskit , and you will be able to install it using opam where its name is qiskit; the library needs python3 + qiskit + matplotlib + numpy to work.
I wrote a medium post showing a basic example: https://medium.com/@dakk/ocaml-and-quantum-computing-fcf4b60d3159
Hi, you might be interested in this code: https://github.com/chetmurthy/qc-ocaml
I wrote it a good while ago, but IIRC I was able to create a circuit, compile to a “circuit”, submit a job, monitor its progress, recover results.
I didn’t get around to interfacing with IBM’s simulator.
If you find the code useful, I’m happy to re-license under GPL.
I recently played with Quipper whose model might be a better fit for OCaml:
cool project, I didn’t found it while searching for ocaml & quantum; caml_qiskit goal is to wrap qiskit in an ocaml library without rewriting anything and keeping the API / module structure lookalike the python version; but your repo can be useful for other sort of libraries, maybe a native ocaml quantum library which can interact with IBMQ (and others). I’ll bookmark it, thanks
yep, no worries. I didn’t advertise it for reasons I can’t divulge. But in any case, if’s ever of any use, lemme know and I’ll relicense it. Though heh, the code is so trivial, maybe even that isn’t worth the trouble.