quipper-libraries-0.9.0.0: The standard libraries for Quipper.

Safe HaskellNone
LanguageHaskell98

Quipper.Libraries.Unboxing

Description

This library provides functions for “unboxing” hierarchical circuits, replacing calls to named subroutines by inlined copies of the subroutines themselves.

Synopsis

Documentation

unbox_transformer :: Transformer Circ Qubit Bit Source #

A transformer to peel away one level of boxing. Transforms any top-level subroutine gate into its corresponding circuit.

unbox_unary :: (QCData x, QCData y) => (x -> Circ y) -> x -> Circ y Source #

Peel away one level of boxing from a circuit. Transforms any top-level subroutine gate into its corresponding circuit.

unbox :: (QCData x, QCData y, QCurry qfun x y) => qfun -> qfun Source #

Peel away one level of boxing from a circuit. Transforms any top-level subroutine gate into its corresponding circuit.

The type of this heavily overloaded function is difficult to read. In more readable form, it has all of the following types:

unbox :: (QCData x) =>  Circ x -> Circ x
unbox :: (QCData x, QCData y) =>  (x -> Circ y) -> (x -> Circ y)
unbox :: (QCData x, QCData y, QCData z) => (x -> y -> Circ z) -> (x -> y -> Circ z)

and so forth.

unbox_recursive_filtered_transformer :: (BoxId -> Bool) -> Transformer Circ Qubit Bit Source #

A transformer to recursively unbox some specified class of boxed subroutines.

unbox_recursive_filtered_unary :: (QCData x, QCData y) => (BoxId -> Bool) -> (x -> Circ y) -> x -> Circ y Source #

Recursively unbox all subroutines satisfying a given predicate.

unbox_recursive_filtered :: (QCData x, QCData y, QCurry qfun x y) => (BoxId -> Bool) -> qfun -> qfun Source #

Recursively unbox all subroutines satisfying a given predicate.

The type of this heavily overloaded function is difficult to read. In more readable form, it has all of the following types:

unbox_recursive_filtered :: (QCData x) => (BoxId -> Bool) -> Circ x -> Circ x
unbox_recursive_filtered :: (QCData x, QCData y) => (BoxId -> Bool) -> (x -> Circ y) -> (x -> Circ y)

and so forth.

unbox_recursive :: (QCData x, QCData y, QCurry qfun x y) => qfun -> qfun Source #

Recursively unbox all subroutines of a circuit.

The type of this heavily overloaded function is difficult to read. In more readable form, it has all of the following types:

unbox_recursive :: (QCData x) =>  Circ x -> Circ x
unbox_recursive :: (QCData x, QCData y) =>  (x -> Circ y) -> (x -> Circ y)
unbox_recursive :: (QCData x, QCData y, QCData z) => (x -> y -> Circ z) -> (x -> y -> Circ z)

and so forth.