The Quipper System

Safe HaskellNone

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 Algorithms.QLS.TemplateOracle and Algorithms.QLS.RealFunc.

Synopsis

Utility function

grepn :: Eq a => [a] -> [a] -> IntSource

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.

Operations on QDouble

local_pi :: FDoubleSource

The constant pi as an FDouble.

Relation between QDouble and QSignedInt.

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

Template version of floor.

template_ceiling :: Circ (QDouble -> Circ QSignedInt)Source

Template version of ceil.

Dealing with parameters.

template_rational :: Double -> Circ QDoubleSource

Lift a real number to QDouble.

getIntFromParam :: Int -> IntSource

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

paramZero :: IntSource

Parameter integer of value '0'.

template_paramZero :: Circ IntSource

Template version of paramZero.

paramTen :: IntSource

Parameter integer of value '10'.

template_paramTen :: Circ IntSource

Template version of paramTen.

paramSucc :: Int -> IntSource

Successor function acting on parameter Int.

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

Template version of paramSucc.

paramPred :: Int -> IntSource

Predecessor function acting on parameter Int.

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

Template version of paramPred.

paramMinus :: Int -> Int -> IntSource

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.