Quantum Computing on a Commodore 64 in 200 Lines of BASIC
In an age where companies are selling two-qubit quantum computers for a sum of money that would make your wallet recoil in horror, here we are, stepping off ...
Qiskit is a python SDK developed by IBM and allows everyone to create quantum circuits, simulate them locally and also run the quantum circuit on a real quantum computer. Qiskit is a very good environment for moving first steps in QC: it’s powerful, but simple at the same time; furthermore it provides many learning resources (ie: the textbook and Abraham (Abe) Asfaw youtube tutorials).
Qiskit is usable only with Python at the moment (since the whole library is written using this language); Python is a really good language for this kind of libraries, since its syntax is clear, and the learning time for this language is usually really short.
Nevertheless I want to use Ocaml language for my quantum experiments, so I started to write a binding library from Qiskit to OCaml, and today I released the library on opam (install via opam install qiskit). At the moment the library allows to write simple quantum circuits, simulate them locally and run them on IBM quantum computers.
The source code is available here while the docs are here.
Let’s see a short 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.get_backend "qasm_simulator"
|> execute qc
|> result
|> get_counts
|> Visualization.plot_histogram;
(* Run the circuit on real quantum hardware *)
let prov = IBMQ.enable_account "IBMQ_API_KEY" in
let j = Provider.get_backend "ibmq_london" prov |> execute qc in
Tools.Monitor.job_monitor j;
j
|> result
|> get_counts
|> Visualization.plot_histogram;;
If you liked caml_qiskit, please put a star on github.com/dakk/caml_qiskit
Article on medium.
In an age where companies are selling two-qubit quantum computers for a sum of money that would make your wallet recoil in horror, here we are, stepping off ...
This June I emerged as one of the top participants with 9 bounties collected (alongside another exceptional contributor) in the #UnitaryHack Hackathon, hoste...
A few days ago I came across a yt video discussing the ESA Copernicus program, a European initiative for monitoring earth via a satellite constellation. This...
Qiskit is a python SDK developed by IBM and allows everyone to create quantum circuits, simulate them locally and also run the quantum circuit on a real quan...
As someone noticed from the previous post, last weeks I started to write a new programming language for Tezos smart contracts. This project was initially int...
While writing a new programming language, it is often useful to write some real use-cases to test the syntax, the language expressiveness and the code cleann...
Documentation is like sex: when it is good, it is very, very good; and when it is bad, it is better than nothing
This is my new blog, based on jekyll. I’ll soon import old posts from my old blog.
Contractvm is a general-purpose decentralized framework based on blockchain. The framework allows to implement arbitrary decentralized applications in an eas...
Most of bitcoin dice software use a system to prove the fair play of the server for each bet. Most of them implement this mechanism using two seed (server se...
In the aim to merge two of my server on digitalocean, today I tried to write a mod_rewrite rule to redirect a secondary domain to a subfolder. After one hour...
MineML is a multithread CPU based bitcoin miner written in F#. At the moment it’s a slow implementation, but the class structure offers the possibility to im...