@hackage quipper-algorithms0.9.0.0
A set of algorithms implemented in Quipper.
Categories
License
BSD-3-Clause
Maintainer
selinger@mathstat.dal.ca
Links
- Homepage
- Documentation
- No source repository
- Changelog
- Security
Versions
- 0.9.0.0 Mon, 30 Dec 2019
Installation
CustomDependencies (15)
- Lattices >=0.0.1
- QuickCheck >=2.6
- array >=0.5
- base >=4.5 && <5
- containers >=0.5.2.1
- deepseq >=1.4 Show all…
Dependents (1)
@hackage/quipper-all
Running the included algorithms
Each algorithm builds an executable file, which can be run with various command line parameters to do different things. Run each command with option --help to see a summary of the usage information.
In the following, we describe the set of options for the algorithms that were implemented.
Running the bwt program
Usage for Binary Welded Tree algorithm:
Usage: bwt [OPTION...]
-h --help print usage info and exit
-C --circuit output the whole circuit (default)
-O --oracle output only the oracle
-K --oraclec output the "classical" oracle as a classical circuit
-G --graph print colored graph computed from oracle
-S --simulate run simulations of some circuit fragments for tree height n
-f --repeats= set parameter s (iteration count; default 1)
-l --large set large problem size: n=300, s=336960
-t
Examples of command line options:
-
Show the complete circuit for the BWT algorithm using the "orthodox" (official GFI) oracle, with n=5 and s=1:
./bwt -C -o orthodox -n 5 -s 1
(One can point out the different parts of the algorithm: 8 oracle calls, and 4 very short diffusion steps).
-
Show the same, using the "Template Haskell" oracle: this oracle is much larger, but automatically generated from classical code (and completely unoptimized):
./bwt -C -o template -n 5 -s 1
The "template oracle" is defined in BWT/Template.hs. See the documentation of the module Quipper/CircLifting for how it works.
-
Show the graph of the BWT algorithm, which is obtained by simulating the orthodox oracle (and therefore offers some evidence for the correctness of the oracle implementation):
./bwt -G -o orthodox -n 5
-
Show the orthodox oracle for n=300. Note that this will result in a big file. One has to zoom in substantially to see gates.
./bwt -O -o orthodox -n 300
-
Show the complete circuit for the BWT algorithm, but decompose everything into binary gates:
./bwt -C -o orthodox -n 5 -s 1 -g binary
-
Show the oracle from Figure 1a (alternate oracle).
./bwt -C -o figure1a
-
The same, decomposed into binary+Toffoli gates, or binary gates only, respectively:
./bwt -C -o figure1a -g toffoli ./bwt -C -o figure1a -g binary
-
Show gate counts for BWT algorithm with n=300 and s=1, using "orthodox" oracle:
./bwt -C -o orthodox -n 300 -s 1 -f gatecount
-
Show gate counts for same, after decomposition to binary gates:
./bwt -C -o orthodox -n 300 -s 1 -f gatecount -g binary
Obviously, most other combinations of command line options are also possible, for example: decompose to toffoli gates and then simulate and show the graph. Some other combinations are not legal: for example, decomposing to binary gates and then simulating. (The classical simulator will complain that the circuit is not boolean; it contains "V" gates).
- Similarly, one can run demos for the triangle finding algorithm using various command line options.
Note that the triangle finding algorithm is not a deliverable; it is a work in progress. The only implemented algorithm that is officially a deliverable is the "orthodox" BWT implementation in BWT.BWT.
Running the bf program
Usage for the Boolean Formula algorithm:
Usage: bf [OPTION...]
-C --circuit output the whole circuit (default)
-D --demo run a demo of the circuit
-H --hexboard output a representation of the initial state of the given oracle, i.e. the game played so far
-p
Running the cl program
Usage for the Class Number algorithm:
Usage: cl [OPTION...]
-h --help print usage info and exit
-f
Running the gse program
Usage for Ground State Estimation algorithm:
Usage: gse [OPTION...]
-h --help print usage info and exit
-C --circuit output the whole circuit (default)
-T
Running the qls program
Usage for Quantum Linear Systems algorithm:
Usage: qls [OPTION...]
-h --help print usage info and exit
-C --circuit output the whole circuit (default)
-O
Running the tf program
Usage for Triangle Finding algorithm:
Usage: tf [OPTION...]
-h --help print usage info and exit
-f
Running the usv program
Usage for Unique Shortest Vector algorithm:
Usage: usv [OPTION...]
-h --help print usage info and exit
-f --s= Random number generator seed s (default: 1)
-F output subroutine f (depends on b).
-G output subroutine g (depends on b).
-H output subroutine h (depends on n).
-U output algorithm 1 (depends on b).
-Q output algorithm 2 (depends on b).
-R output algorithm 3 (depends on b).
-T output algorithm 4 (depends on n).
-S output sieving subroutine (depends on n).
-D output algorithm 5 (depends on n).
-t test subroutine h (depends on n).
Possible values for format are: eps, pdf, ps, postscript, ascii, preview, gatecount.
Possible values for gatebase are: logical, binary, toffoli, cliffordt_old, cliffordt, cliffordt_keepphase, standard, strict, approximate, approximate_keepphase, exact, trimcontrols.