Skip to content
/ mcc Public

Compiles a quantum computation in the form of Measurement Calculus command sequences and generates C++ code using intel Cnc

Notifications You must be signed in to change notification settings

yvdriess/mcc

Repository files navigation

Measurement Calculus Compiler
------------------------------

1. Introduction
---------------

Files included:
 - graph.lisp : Common Lisp source code for the MC compiler
 - cnc_generator.lisp : C++ code generator, using the Intel CnC library; used by graph.lisp
 - cnc_model.lisp : Common Lisp abstractions to help build a CnC graph representation
 - w3.mc : non-trivial example of a Measurement Calculus program producing a W3 entanglement state.
 - qft/qft[2-22].mc : Quantum Fourier Transform examples, Measurement Calculus programs generated from the recursive quantum circuit definition.
 - Makefile, *.sh, ... : setup and compilation scripts, see below

Any questions or comments can be sent to 'yvdriess at vub.ac.be'

2. Installation
---------------

Requires
 - Intel Thread Building Blocks 3.0 or more
	http://threadingbuildingblocks.org/
 - Intel Concurrent Collections 0.8 or more
   	https://icnc.github.io/
 - Steel Bank Common Lisp (sbcl) with quicklisp installed to bootstrap the compiler
 - Make sure all the TBB and CnC environment variables are set

Quick start
 'sh quickstart.sh' to bootstrap, compile and run a non-trivial program that should run in the order of single-digit seconds.

Bootstrapping
 'sh bootstrap.sh' runs a save-lisp-and-die on the MCC program written in Common Lisp, this creates a binary called ./mcc which accepts valid Measurement Calculus programs. 

Compiler
 './mcc < w3.mc' feeds a non-trivial (W3-entanglement creation) quantum computation to the compiler; producing C++ source and header files, respectively 'mccompiled.C' and 'mccompiled.h'
 QFT examples for 2 to 22 qubits can be found in the qft/ directory.
 
Running the mccompiled program
 run 'make' to build the generated C++ program and run the resulting './mccompiled'. You can control the number of threads with the -t argument, -s will make CnC report scheduler statistics and -d will output a CnC execution trace for debugging purposes.
	./mccompiled [-t num_threads] [-s] [-d]
	
3.  See Also
-------------
MCC compiles to a low-level 'quantum virtual machine' instruction set.

A fast stand-alone implementation of the low-level measurement calculus operations can be found on github as well:
   https://github.com/yvdriess/qvm

About

Compiles a quantum computation in the form of Measurement Calculus command sequences and generates C++ code using intel Cnc

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published