Running QCL (Quantum Computation Language) on Ubuntu

Yesterday, I posted how to run QCL (Quantum Computation Language) on Windows. Today, I’ll show how to install and run it on Ubuntu (I’m using Ubuntu 15.04 running on an Azure VM). QCL does have a binary distribution, but I will be compiling it from the source code.

Since my approach to running QCL on Windows was to use Cygwin, the process is similar, with a few differences.

From an Ubuntu command prompt, download and extract the QCL source code.

$ wget
$ tar xvzf qcl-0.6.4.tgz

Next, I discovered that I needed to install libplot-dev, otherwise I got an error message during compilation saying “fatal error: plotter.h: No such file or directory”. I also found that I needed to install flex because I got a compile error saying “/usr/bin/ld: cannot find -lfl”, and libncurses-dev, because I got an error saying “/usr/bin/ld: cannot find -lncurses”.

You can install these dependencies using apt-get, like this:

$ sudo apt-get update
$ sudo apt-get install flex libncurses-dev libplot-dev libreadline-dev

Now change to the qcl folder and compile it:

$ cd qcl-0.6.4
$ make

Now you should be able to run qcl…

$ ./qcl

…and then get the QCL command prompt, which will look something like this:

QCL Quantum Computation Language (64 qubits, seed 1450711245)
[0/64] 1 |0>


  • amr says:

    always this error fatal error: readline/readline.h: No such file or directory

  • Try installing libreadline-dev first…

    sudo apt-get install libreadline-dev

  • Hernan Mayor says:

    I installed QCL in my ubuntu following this instructions, and the installation seem to terminate ok.

    The created folder qcl-0.6.4 contains a qcl module, but when I invoke it it gives the following answer:
    qcl: command not found.

    Please your halp


  • Hernan Mayor says:

    Yes, thank you.

    It is now working ok.

  • Mike says:

    I get the error: fatal error: plotter.h: No such file or directory.
    I suspect it’s because I’ve been having trouble getting libplot-dev, because I am on Scientific Linux.

  • Zen says:

    Hello, i am trying to follow this tutorial, i am on Windows, under the linux subsystems, i tried this and everything seemed to work fine,i didnt have make at first but i installed it normally then i started the make program, the process started but it got blocked at the 120 line of the makefile outputting :
    mv yacc.*?h yacc.h
    mv: cannot stat ‘yacc.*?h’: No such file or directory
    Makefile:120: recipe for target ‘yacc.h’ failed
    make: *** [yacc.h] Error 1

Leave a Reply

Your email address will not be published. Required fields are marked *