The Quipper System

Algorithms.QLS.CircLiftingImport

Description

This module contains definitions to work with Template Haskell. All the definitions in this module are used by Template Haskell in Algorithms.QLS.TemplateOracle and Algorithms.QLS.RealFunc.

Synopsis

# Utility function

grepn :: Eq a => [a] -> [a] -> Int Source #

grepn regexp list: Counts how many times regexp is a sublist of list.

# Lifting of ordering operators.

template_symb_slash_symb_equal_ :: (Typeable qa, QOrd qa, Show (BType qa)) => Circ (qa -> Circ (qa -> Circ Qubit)) Source #

Template version of /=.

template_symb_oangle_ :: (Typeable qa, QOrd qa, Show (BType qa)) => Circ (qa -> Circ (qa -> Circ Qubit)) Source #

Template version of <.

template_symb_oangle_symb_equal_ :: (Typeable qa, QOrd qa, Show (BType qa)) => Circ (qa -> Circ (qa -> Circ Qubit)) Source #

Template version of <=.

template_symb_cangle_ :: (Typeable qa, QOrd qa, Show (BType qa)) => Circ (qa -> Circ (qa -> Circ Qubit)) Source #

Template version of >.

template_symb_cangle_symb_equal_ :: (Typeable qa, QOrd qa, Show (BType qa)) => Circ (qa -> Circ (qa -> Circ Qubit)) Source #

Template version of >=.

# Lifting of arithmetic operators

template_symb_minus_ :: (Typeable qa, QNum qa, Show (BType qa)) => Circ (qa -> Circ (qa -> Circ qa)) Source #

Template version of -.

template_symb_plus_ :: (Typeable qa, QNum qa, Show (BType qa)) => Circ (qa -> Circ (qa -> Circ qa)) Source #

Template version of +.

template_symb_star_ :: (Typeable qa, QNum qa, Show (BType qa)) => Circ (qa -> Circ (qa -> Circ qa)) Source #

Template version of *.

template_negate :: (Typeable qa, QNum qa, Show (BType qa)) => Circ (qa -> Circ qa) Source #

Template version of negate.

template_abs :: (Typeable qa, QNum qa, Show (BType qa)) => Circ (qa -> Circ qa) Source #

Template version of abs.

Template version of mod

# Operations on QDouble

Template version of / on Fractional.

The constant pi as an FDouble.

Template version of local_pi.

The identity function of type FDouble. This is used to help the type checker work around a problem in GHC 8.0, where types of overloaded operations sometimes require disambiguation.

Template version of id_fdouble.

# Relation between QDouble and QSignedInt.

Template version of floor.

Template version of ceil.

Template version of fromIntegral.

# Dealing with parameters.

Lift a real number to QDouble.

Lift an integer to QSignedInt.

Make a parameter Int as a regular Int that can be lifted.

Template version of getIntFromParam.

Parameter integer of value '0'.

Template version of paramZero.

Parameter integer of value '10'.

Template version of paramTen.

Successor function acting on parameter Int.

Template version of paramSucc.

Predecessor function acting on parameter Int.

Template version of paramPred.

Subtraction of parameter integers.

Template version of paramMinus.

# Miscellaneous operations.

template_length :: Circ ([a] -> Circ QSignedInt) Source #

Lifted version of length.

take_half :: [a] -> [a] Source #

Return the first half of the input list.

template_take_half :: Circ ([a] -> Circ [a]) Source #

Lifted version of take_half.