traq
Safe HaskellSafe-Inferred
LanguageHaskell2010

Traq.Primitives

Synopsis

Specialized typeclasses

Collections

Default collection (with exp cost + compile)

data DefaultPrimCollection size prec #

Constructors

QAny (QSearchCFNW size prec) 
RAny (RandomSearch size prec) 
DAny (DetSearch size prec) 
CAmp (CAmplify size prec) 
QAmp (QAmplify size prec) 
QMax' (QMax size prec) 

Instances

Instances details
Generic (DefaultPrimCollection size prec) # 
Instance details

Defined in Traq.Primitives

Associated Types

type Rep (DefaultPrimCollection size prec) :: Type -> Type #

Methods

from :: DefaultPrimCollection size prec -> Rep (DefaultPrimCollection size prec) x #

to :: Rep (DefaultPrimCollection size prec) x -> DefaultPrimCollection size prec #

(Show size, Show prec) => Show (DefaultPrimCollection size prec) # 
Instance details

Defined in Traq.Primitives

(Eq size, Eq prec) => Eq (DefaultPrimCollection size prec) # 
Instance details

Defined in Traq.Primitives

Methods

(==) :: DefaultPrimCollection size prec -> DefaultPrimCollection size prec -> Bool #

(/=) :: DefaultPrimCollection size prec -> DefaultPrimCollection size prec -> Bool #

(Show size, Show prec, Fractional prec) => SerializePrim (DefaultPrimCollection size prec) # 
Instance details

Defined in Traq.Primitives

MapSize (DefaultPrimCollection size prec) # 
Instance details

Defined in Traq.Primitives

Associated Types

type MappedSize (DefaultPrimCollection size prec) size' #

Methods

mapSize :: (size0 ~ SizeType (DefaultPrimCollection size prec), size' ~ SizeType ext', ext' ~ MappedSize (DefaultPrimCollection size prec) size') => (size0 -> size') -> DefaultPrimCollection size prec -> ext' #

TypingReqs size => TypeCheckPrim (DefaultPrimCollection size prec) size # 
Instance details

Defined in Traq.Primitives

Methods

inferRetTypesPrim :: forall ext' shape m. (m ~ TypeChecker ext', size ~ SizeType ext', shape ~ PrimFnShape (DefaultPrimCollection size prec)) => DefaultPrimCollection size prec -> shape (FnType size) -> m [VarType size] #

(size ~ SizeT, TypingReqs size, Integral size, RealFloat prec, Show prec) => QuantumCompilePrim (DefaultPrimCollection size prec) size prec # 
Instance details

Defined in Traq.Primitives

Methods

compileQPrim :: forall ext' m (shape :: Type -> Type). (m ~ PrimCompileMonad ext' (DefaultPrimCollection size prec), size ~ SizeType ext', prec ~ PrecType ext', shape ~ PrimFnShape (DefaultPrimCollection size prec)) => DefaultPrimCollection size prec -> FailProb prec -> m (ProcDef size) #

(TypingReqs size, Integral size, RealFloat prec, Show prec) => UnitaryCompilePrim (DefaultPrimCollection size prec) size prec # 
Instance details

Defined in Traq.Primitives

Methods

compileUPrim :: forall ext' m (shape :: Type -> Type). (m ~ PrimCompileMonad ext' (DefaultPrimCollection size prec), size ~ SizeType ext', prec ~ PrecType ext', shape ~ PrimFnShape (DefaultPrimCollection size prec)) => DefaultPrimCollection size prec -> FailProb prec -> m (ProcDef size) #

Ord prec => EvalPrim (DefaultPrimCollection size prec) size prec # 
Instance details

Defined in Traq.Primitives

Methods

evalPrim :: forall ext' shape m. (Evaluatable ext' size prec, m ~ Evaluator ext', SizeType ext' ~ size, PrecType ext' ~ prec, shape ~ PrimFnShape (DefaultPrimCollection size prec)) => DefaultPrimCollection size prec -> shape ([Value size] -> m [Value size]) -> m [Value size] #

(EvalReqs size prec, Floating prec, Ord prec) => QuantumExpCostPrim (DefaultPrimCollection size prec) size prec # 
Instance details

Defined in Traq.Primitives

Methods

quantumExpQueryCostsQuantum :: (shape ~ PrimFnShape (DefaultPrimCollection size prec), m ~ EvaluationMonad prec) => DefaultPrimCollection size prec -> FailProb prec -> shape ([Value size] -> m [Value size]) -> shape [([Value size], prec)] #

quantumExpQueryCostsUnitary :: (shape ~ PrimFnShape (DefaultPrimCollection size prec), m ~ EvaluationMonad prec) => DefaultPrimCollection size prec -> FailProb prec -> shape ([Value size] -> m [Value size]) -> shape (UnitaryQueries prec) #

quantumExpExprCosts :: forall shape cost m. (CostModel cost, prec ~ PrecType cost, shape ~ PrimFnShape (DefaultPrimCollection size prec), m ~ EvaluationMonad prec) => DefaultPrimCollection size prec -> FailProb prec -> shape ([Value size] -> m [Value size]) -> cost #

(TypingReqs size, Integral size, Floating prec, SizeToPrec size prec) => QuantumHavocCostPrim (DefaultPrimCollection size prec) size prec # 
Instance details

Defined in Traq.Primitives

(TypingReqs size, Integral size, Floating prec, SizeToPrec size prec) => UnitaryCostPrim (DefaultPrimCollection size prec) size prec # 
Instance details

Defined in Traq.Primitives

Methods

unitaryQueryCosts :: DefaultPrimCollection size prec -> FailProb prec -> PrimFnShape (DefaultPrimCollection size prec) (UnitaryQueries prec) #

unitaryExprCosts :: (CostModel cost, prec ~ PrecType cost) => DefaultPrimCollection size prec -> FailProb prec -> cost #

type Rep (DefaultPrimCollection size prec) # 
Instance details

Defined in Traq.Primitives

type PrecType (DefaultPrimCollection size prec) # 
Instance details

Defined in Traq.Primitives

type PrecType (DefaultPrimCollection size prec) = prec
type SizeType (DefaultPrimCollection size prec) # 
Instance details

Defined in Traq.Primitives

type SizeType (DefaultPrimCollection size prec) = size
type PrimFnShape (DefaultPrimCollection size prec) # 
Instance details

Defined in Traq.Primitives

type MappedSize (DefaultPrimCollection size prec) size' # 
Instance details

Defined in Traq.Primitives

type MappedSize (DefaultPrimCollection size prec) size' = DefaultPrimCollection size' prec

type DefaultPrims size prec = Primitive (DefaultPrimCollection size prec) #

primitives with worst-case cost support.

type WorstCasePrims size prec = Primitive (WorstCasePrimCollection size prec) #