package qiskit
Not available on OCaml 5.5Install
dune-project
Dependency
Authors
Maintainers
Sources
md5=f2467e0c9a8f1c4514594cce8026aaa6
sha512=f1eb42b7f6c0eb98cc580de6ffa54dea69c89d13df5ccc493c088e9007a7ab05edd253d7173e2fe8f54ac68b066e2f3870a2c0e9f5acd34ee7047079160c5379
Description
An OCaml wrapper for the Qiskit quantum computing toolkit
Added to opam-repository:
README
Caml_qiskit
An OCaml wrapper for IBM Qiskit quantum computing toolkit.
opam install qiskit
Example
open Qiskit
(* Create the circuit *)
let qc = quantum_circuit 2 2
|> h 0
|> id 1
|> barrier
|> cx 0 1
|> barrier
|> measure 0 0
|> measure 1 1
|> draw;;
(* Start a simulation *)
aer_simulator "statevector"
|> run qc
|> result
|> get_counts
|> Visualization.plot_histogram;
(* Run the circuit on real quantum hardware *)
let serv = IBMRuntime.service ~token:"TOKEN" () in
let backend = IBMRuntime.least_busy serv in
let j = IBMRuntime.sampler backend |> IBMRuntime.run (transpile qc backend) in
j
|> result
|> IBMRuntime.get_counts
|> Visualization.plot_histogram;;
Install
opam install qiskit
You also need to install these python libraries (via pip):
- matplotlib
- numpy
- qiskit
- qiskit_aer
- pylatexenc
And optional for IBM quantum cloud computers:
- qiskit_ibm_runtime
Note: the legacy IBMProvider module (backed by qiskit_ibm_provider) has been deprecated by IBM and is not compatible with qiskit >= 2.0; use the IBMRuntime module instead.
License
Copyright (c) 2020-2026 Davide Gessa
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
Dev Dependencies (3)
-
bisect_ppx
dev & >= "2.8.3" -
odoc
dev & >= "2.2.1" -
ounit2
with-test & >= "2.2.7"
Optional Dependencies
None
Used by
None
Conflicts
None
Build status
Results of building qiskit with each compiler on check.ci.ocaml.org, run of against opam-repository 8a77e58. All results for this package.
Each result links to its build log. To keep crawlers from overloading the site, build logs require a GitHub sign-in (see ocurrent/opam-health-check). On your first log, GitHub asks you to “Authorize opam-health-check”, the OCurrent app that runs these checks; it sees only your public profile, not your repositories. The sign-in lasts 30 days.
| Version | OCaml 4.11 | OCaml 4.14 | OCaml 5.2 | OCaml 5.4 | OCaml 5.5 |
|---|---|---|---|---|---|
| 2.0.1 (this version) | n/a | n/a | good | n/a | n/a |
| 1.0.2 | good | n/a | good | n/a | n/a |
- good Package successfully built
- partial One of the dependencies failed to build
- bad Package failed to build
- n/a Package is not available in this environment
- internal Internal failure