package qcaml
Install
dune-project
Dependency
Authors
Maintainers
Sources
md5=cdda9603871a788171bcc9abfb09fd41
sha512=f6b7c88938fc772e9fc81066432d08333043cb02107dcb9593a73b1d04d84a968371cd07e3afb9d3d7d17729d9cfaa19b4ed1dd4b7bf05e0eb355a3b54d512e1
Description
QCaml is a lightweight OCaml library for experimenting with quantum states, gates and measurements. It provides tools for learning quantum computing concepts and visualizing qubit states on the Bloch sphere.
Features:
- Single qubit state representation with complex amplitudes
- Fundamental quantum gates (Hadamard, Pauli-X/Y/Z)
- Quantum measurements with probabilistic state collapse
- Interactive Bloch sphere visualization using OpenGL/GLUT
- Comprehensive test suite
README
A lightweight OCaml library to experiment with quantum states, gates and measurements. For learning quantum computing concepts and visualizing qubit states on the Bloch sphere.
Presentation 
QCaml for Quantum (O)Caml is an experimental library for simulating quantum algorithms. This library is currently under development. Among the MVP's features are qubit declaration, application of classical gates (X,Y,Z,H), measurement, and visualization.
Installation
Prerequisites
You need the opam package manager to install the OCaml build tools.
$ sudo apt install opam # debian/ubuntu
$ opam init
$ opam switch create 5.2.0
$ eval $(opam env)
$ opam install dune odoc alcotest bisect_ppxBuild and install
The following will clone the repository, build QCaml and install it into your opam.
$ git clone https://github.com/elias-utf8/qcaml.git
$ cd qcaml/
$ make
$ opam install .Quick start
Try this simple example by running dune exec examples/bloch_sphere.exe to visualize a superposition state on the Bloch sphere:
|
|
Features
| Feature | Status | Description |
|---|---|---|
| Qubit Initialization | ✓ Completed | Single and multi-qubit state initialization with arbitrary amplitudes |
| Basic Quantum Gates | ✓ Completed | Implementation of fundamental gates (Hadamard, Pauli-X/Y/Z) |
| Quantum Measurements | ✓ Completed | Computational basis measurements with probability calculations |
| Bloch sphere visualization | ✓ Completed | Visualization of qubit states on the Bloch sphere |
| Advanced Gate | In progress.. | Extended gate set (Phase and rotation gates) |
| Circuit Builder | ○ Planned | High-level API for composing and optimizing quantum circuits |
| Multi-Qubit Operations | ○ Planned | Efficient tensor product operations for n-qubit systems |
| Simulator | ○ Planned (I will never have time) | Export circuits to standard formats (QASM, diagram generation) |
Documentation
API Reference: Generated documentation at _build/default/_doc/_html/index.html (after running dune build @doc) or see online documentation )
Resources
Quantum Computing Course – Math and Theory for Beginners : https://youtu.be/tsbCSkvHhMo?si=XTbz10_b1v1aAS-3
Dependencies (4)
- conf-freeglut
- dune-configurator
-
dune
>= "3.17" & >= "3.17" -
ocaml
>= "5.2"
Dev Dependencies (3)
-
bisect_ppx
with-test -
odoc
with-doc -
alcotest
with-test
Used by
None
Conflicts
None
