Install Quipper (tested on Ubuntu 22.04)
-
Install xpdf for viewing Quipper circuits.
sudo apt install xpdf
-
Installing stack.
sudo apt install haskell-stack
If you are not using ubuntu,
follow the instruction here for
installing stack on your system.
-
Create a stack project.
stack new quipper-project
The above command should create a folder called 'quipper-project'
with some subfolders such as app/, src/, test/ and config files such as
package.yaml and stack.yaml.
-
Go to the quipper-project directory.
cd quipper-project
-
Download and unzip this and this to the quipper-project.
So under quipper-project, there should be a folder called
'quipper-utils-0.9.0.0' and another folder called 'quipper-language-0.9.0.0'
-
Under quipper-project, first remove the
the file 'stack.yaml', then download this file
and put it in the current directory.
-
Open 'package.yaml' in an editor. Add the following two lines in the 'dependencies' section right after '- base >= 4.7 && < 5'.
- quipper
- quipper-language
- quipper-libraries
- random
-
Remove the main file in the app/ directory.
rm app/Main.hs
Then download and put this file to the directory quipper-project/app.
-
Under the quipper-project directory, type the following command.
stack build
This process may take a while (10~30 minutes), so maybe get some coffee or do some stretching?
-
Test our installation.
stack exec quipper-project-exe
The above should open a quipper circuit in xpdf. If you see the circuit,
congrats, you have now successfully install Quipper!