The Quipper System

Safe HaskellNone

Quipper.Algorithms.QLS.CircLiftingImport

Contents

Description

This module contains definitions to work with Template Haskell. All the definitions in this module are used by Template Haskell in Quipper.Algorithms.QLS.TemplateOracle and Quipper.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) => Circ (qa -> Circ (qa -> Circ Qubit)) Source #

Template version of /=.

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

Template version of <.

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

Template version of <=.

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

Template version of >.

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

Template version of >=.

Lifting of arithmetic operators

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

Template version of -.

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

Template version of +.

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

Template version of *.

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

Template version of negate.

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

Template version of abs.

Operations on QDouble

local_pi :: FDouble Source #

The constant pi as an FDouble.

id_fdouble :: FDouble -> FDouble Source #

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.

Relation between QDouble and QSignedInt.

template_floor :: Circ (QDouble -> Circ QSignedInt) Source #

Template version of floor.

Dealing with parameters.

template_rational :: Double -> Circ QDouble Source #

Lift a real number to QDouble.

getIntFromParam :: Int -> Int Source #

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

paramZero :: Int Source #

Parameter integer of value '0'.

template_paramZero :: Circ Int Source #

Template version of paramZero.

paramTen :: Int Source #

Parameter integer of value '10'.

template_paramTen :: Circ Int Source #

Template version of paramTen.

paramSucc :: Int -> Int Source #

Successor function acting on parameter Int.

template_paramSucc :: Circ (Int -> Circ Int) Source #

Template version of paramSucc.

paramPred :: Int -> Int Source #

Predecessor function acting on parameter Int.

template_paramPred :: Circ (Int -> Circ Int) Source #

Template version of paramPred.

paramMinus :: Int -> Int -> Int Source #

Subtraction of parameter integers.

template_paramMinus :: Circ (Int -> Circ (Int -> Circ Int)) Source #

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.