Random thoughts, daily life, being a student, quantum computing.


The first HCAR submission

Taking a cue from others - an easy blogging entry :).

I've finally made a submission to the HCAR for L-QPL. Content below:

LQPL - A quantum programming language compiler and emulator

LQPL (Linear Quantum Programming Language) consists of two main pieces, a compiler for a functional quantum programming language and an associated assembler / emulator.

The system was the main subject of the author's master's thesis and was inspired by Peter Selinger's paper Towards a Quantum Programming Language. LQPL incorporates a simplified module / include system (more like C's include than Haskell's import), various predefined unitary transforms, algebraic data types, and operations on purely classical data. The compiler translates LQPL programs into an assembler like language. The emulator, written using Gtk2Hs, translates the assembler to machine code and provides visualization of the program as it executes.

For example, the following procedure implements quantum teleportation:

teleport::(n:Qubit, a:Qubit, b:Qubit ; b:Qubit) =
Not a <= n ;
Had n;
measure a of
0> => {}
1> => {Not b};
measure n of
0> => {}
1> => {RhoZ b}

The emulator will allow a person to step through this program, displaying the quantum values as a tree. The figure below is a screen shot showing the results after the first measure in

Since the publication of the thesis, some time and attention has been spent on improving performance and the UI of the emulator.

We plan to release this to the public sometime this year. It will be made available from the author's website and the programming languages research group's website at
the University of Calgary.
Post a Comment