-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | An embedded, scalable functional programming language for quantum computing.
--
-- Quipper is an embedded, scalable functional programming language for
-- quantum computing. It provides, among other things:
--
--
-- - A high-level circuit description language. This includes
-- gate-by-gate descriptions of circuit fragments, as well as powerful
-- operators for assembling and manipulating circuits.
-- - A monadic semantics, allowing for a mixture of procedural and
-- declarative programming styles.
-- - Built-in facilities for automatic synthesis of reversible quantum
-- circuits, including from classical code.
-- - Support for hierarchical circuits.
-- - Extensible quantum data types.
-- - Programmable circuit transformers.
-- - Support for three execution phases: compile time, circuit
-- generation time, and circuit execution time. A dynamic lifting
-- operation to allow circuit generation to be parametric on values
-- generated at circuit execution time.
-- - Extensive libraries of quantum functions, including: libraries for
-- quantum integer and fixed-point arithmetic; the Quantum Fourier
-- transform; an efficient Qram implementation; libraries for simulation
-- of pseudo-classical circuits, Stabilizer circuits, and arbitrary
-- circuits; libraries for exact and approximate decomposition of
-- circuits into specific gate sets.
--
--
-- This package contains the rendering part, which has been separated to
-- reduce dependencies in quipper-core.
@package quipper-rendering
@version 0.8
-- | Pretty-printing of low-level quantum circuits.
module Quipper.Printing
-- | Generate an ASCII representation of a low-level boxed quantum circuit.
ascii_of_bcircuit :: BCircuit -> String
-- | Interactively output a DBCircuit to standard output. This
-- supports dynamic lifting by prompting the user for bit values when a
-- dynamic lifting operation is encountered. Effectively the user is
-- asked to behave like a quantum device.
print_dbcircuit_ascii :: ErrMsg -> DBCircuit a -> IO ()
-- | Interactively read a bit (either 0 or 1) from standard input. This is
-- intended for interactive user input, so it skips white space until a 0
-- or 1 is encountered. In case the first non-whitespace character isn't
-- 0 or 1 or #, the rest of the line is ignored and the user is
-- prompted to try again.
--
-- However, this also works for non-interactive input, so that the input
-- can be redirected from a file. In this case, the characters 0 and 1
-- and whitespace, including newlines, can be interspersed freely.
-- '#' starts a comment that extends until the end of the line.
getBit :: IO Bool
-- | Print gate counts for a boxed circuit: first the simple gate count for
-- each subroutine separately, then the aggregated count for the whole
-- circuit.
print_gatecounts_bcircuit :: BCircuit -> IO ()
-- | Render a low-level dynamic quantum circuit as a graphical
-- Document. If there are subroutines, each of them is placed on a
-- separate page. If the circuit uses dynamic lifting, an error is
-- produced.
render_dbcircuit :: FormatStyle -> ErrMsg -> DBCircuit a -> Document ()
-- | Display the circuit directly in Acrobat Reader. This may not be
-- portable. It requires the external program "acroread" to be installed.
preview_bcircuit :: BCircuit -> IO ()
-- | Available output formats.
data Format
-- | Encapsulated PostScript graphics.
EPS :: Format
-- | Portable Document Format. One circuit per page.
PDF :: Format
-- | PostScript. One circuit per page.
PS :: Format
-- | A textual representation of circuits.
ASCII :: Format
-- | Don't print anything, but preview directly on screen (requires the
-- external program acroread).
Preview :: Format
-- | Print statistics on gate counts.
GateCount :: Format
CustomStyle :: FormatStyle -> Format
-- | A data type that holds all the customizable parameters.
data FormatStyle
FormatStyle :: RenderFormat -> Color -> Color -> Double -> Double -> Double -> Double -> Double -> Double -> Double -> Double -> Double -> Double -> Double -> Double -> Double -> Double -> Double -> Double -> Font -> Font -> Color -> Font -> Color -> Font -> Color -> Bool -> FormatStyle
-- | The RenderFormat to use.
[renderformat] :: FormatStyle -> RenderFormat
-- | The color of the background.
[backgroundcolor] :: FormatStyle -> Color
-- | The color of the foreground (e.g. wires and gates).
[foregroundcolor] :: FormatStyle -> Color
-- | Line width.
[linewidth] :: FormatStyle -> Double
-- | Gap for double line representing classical bit.
[coffs] :: FormatStyle -> Double
-- | Radius of dots for "controlled" gates.
[dotradius] :: FormatStyle -> Double
-- | Radius of oplus for "not" gate.
[oplusradius] :: FormatStyle -> Double
-- | Horizontal column width.
[xoff] :: FormatStyle -> Double
-- | Difference between width of box and width of label.
[gatepad] :: FormatStyle -> Double
-- | Height of labelled box.
[gateheight] :: FormatStyle -> Double
-- | Width and height of "cross" for swap gate.
[crossradius] :: FormatStyle -> Double
-- | Vertical shift for text labels.
[stringbase] :: FormatStyle -> Double
-- | Width of "bar" bar.
[barwidth] :: FormatStyle -> Double
-- | Height of "bar" bar.
[barheight] :: FormatStyle -> Double
-- | Width of "D" symbol.
[dwidth] :: FormatStyle -> Double
-- | Height of "D" symbol.
[dheight] :: FormatStyle -> Double
-- | Maximal width of a gate label.
[maxgatelabelwidth] :: FormatStyle -> Double
-- | Maximal width of a wire label.
[maxlabelwidth] :: FormatStyle -> Double
-- | Maximal width of a wire number.
[maxnumberwidth] :: FormatStyle -> Double
-- | Font to use for labels on gates.
[gatefont] :: FormatStyle -> Font
-- | Font to use for comments.
[commentfont] :: FormatStyle -> Font
-- | Color to use for comments.
[commentcolor] :: FormatStyle -> Color
-- | Font to use for labels.
[labelfont] :: FormatStyle -> Font
-- | Color to use for labels.
[labelcolor] :: FormatStyle -> Color
-- | Font to use for numbers.
[numberfont] :: FormatStyle -> Font
-- | Color to use for numbers.
[numbercolor] :: FormatStyle -> Color
-- | Whether to label each subroutine call with shape parameters
[subroutineshape] :: FormatStyle -> Bool
-- | The default PDF Style.
pdf :: FormatStyle
-- | The default EPS Style.
eps :: FormatStyle
-- | The default PS Style.
ps :: FormatStyle
-- | A mapping from lower-case strings (to be used, e.g., with command line
-- options) to available formats.
format_enum :: [(String, Format)]
-- | Print a low-level quantum circuit directly to the IO monad, using the
-- specified format.
print_dbcircuit :: Format -> ErrMsg -> DBCircuit a -> IO ()
-- | Print a document to the requested format, which must be one of
-- PS, PDF, EPS, or Preview.
print_of_document :: Format -> Document a -> IO a
-- | Like print_of_document, but also takes a Custom data
-- structure.
print_of_document_custom :: Custom -> Format -> Document a -> IO a
-- | Print a circuit generating function to the specified format; this
-- requires a shape parameter.
print_unary :: (QCData qa) => Format -> (qa -> Circ b) -> qa -> IO ()
-- | Print a circuit generating function to the specified format. Unlike
-- print_unary, this can be applied to a circuit-generating
-- function in curried form with n arguments, for any n >=
-- 0. It then requires n shape parameters.
--
-- The type of this heavily overloaded function is difficult to read. In
-- more readable form, it has all of the following types:
--
--
-- print_generic :: Format -> Circ qa -> IO ()
-- print_generic :: (QCData qa) => Format -> (qa -> Circ qb) -> a -> IO ()
-- print_generic :: (QCData qa, QCData qb) => Format -> (qa -> qb -> Circ qc) -> a -> b -> IO ()
--
--
-- and so forth.
print_generic :: (QCData qa, QCurry qfun qa b, Curry fun qa (IO ())) => Format -> qfun -> fun
-- | Like print_generic, but only works at simple types, and
-- therefore requires no shape parameters.
print_simple :: (QCData qa, QCurry qfun qa b, Curry fun qa (IO ()), QCData_Simple qa) => Format -> qfun -> IO ()
instance GHC.Show.Show Quipper.Printing.Format
instance GHC.Show.Show Quipper.Printing.AnnGatetype
instance GHC.Classes.Ord Quipper.Printing.AnnGatetype
instance GHC.Classes.Eq Quipper.Printing.AnnGatetype
instance GHC.Show.Show Quipper.Printing.Gatetype
instance GHC.Classes.Ord Quipper.Printing.Gatetype
instance GHC.Classes.Eq Quipper.Printing.Gatetype
instance GHC.Show.Show Quipper.Printing.FormatStyle