HQbricks is a platform dedicated to the analysis and verification of quantum programs.
Key features:
- HQbricks library: A symbolic execution and specification verification tool for hybrid circuits (classical/quantum)
- Interactive Jupyter Notebook tutorial: An accessible, hands-on guide to help you get started and explore the core features of HQbricks
- QbIRcks: An intermediate representation and translation platform from/to state-of-the-art intermediate representations OpenQASM2 and AQASM
-
Install OCaml.
-
Create an OPAM switch with OCaml version 5.3.0:
opam switch create 5.3.0
eval $(opam env)
- Install project dependencies:
opam install . --deps-only --with-test
- Build the project:
dune build
- Install the HQbricks library and the QbIRcks Translate command:
dune install
- Optional: Install the Jupyter Notebook tutorial Docker image:
docker build -f Dockerfile.hqbricks-tuto -t hqbricks-tuto .
- Optional: Install the HQbricks Docker image:
docker build -f Dockerfile.hqbricks -t hqbricks .
The documentation of the HQbricks library is available in docs/index.html and can be opened in a web browser. It contains a Getting Started guide in the beginning of the Hqbricks documentation with a simple Quantum Teleportation verification example. The code can be found in example/teleportation.ml, and can be run using:
dune exec example/teleportation.exe
To access the Jupyter Notebook tutorial, run:
docker run -it --rm -p 8888:8888 hqbricks-tuto
Then open this link in a web browser:
http://localhost:8888/
The tutorial can be followed either by working through the exercises and filling in the code, or by simply following the solutions.
The tutorial is also available on DockerHub.
QbIRcks is an intermediate representation in the form of an AST embedded in OCaml.
It can represent programs written in our higher-level verification tools and can be translated from/to OpenQASM2 and AQASM using QbIRcks Translate.
QbIRcks Translate is a translation platform to translate QbIRcks files from/to OpenQASM2 and AQASM files. A QbIRcks file is a QbIRcks AST value serialized into json.
qbircks-translate [--input-file=FILE] [--output-file=FILE] [OPTION]… TRANSLATION
TRANSLATION
Specify the translation direction, which must be one of:
-
openqasm2_to_qbircks
-
qbircks_to_openqasm2
-
aqasm_to_qbircks
-
qbircks_to_aqasm
-
-i FILE, --input-file=FILE (absent=-)
FILEis the file to read from. Use - for stdin -
-o FILE, --output-file=FILE (absent=-)
FILEis the file to write to. Use - for stdout -
--help[=FMT] (default=auto)
Show this help in formatFMT. The valueFMTmust be one of auto, pager, groff or plain. With auto, the format is pager or plain whenever the TERM env var is dumb or undefined. -
--version
Show version information.