Install Quipper (tested on Ubuntu 22.04)

  1. Install xpdf for viewing Quipper circuits. sudo apt install xpdf
  2. Installing stack.
    sudo apt install haskell-stack If you are not using ubuntu, follow the instruction here for installing stack on your system.
  3. 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.
  4. Go to the quipper-project directory.
    cd quipper-project
  5. 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'
  6. Under quipper-project, first remove the the file 'stack.yaml', then download this file and put it in the current directory.
  7. 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
  8. Remove the main file in the app/ directory. rm app/Main.hs Then download and put this file to the directory quipper-project/app.
  9. 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?
  10. 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!