| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Traq.Primitives.Class.QuantumCost
Synopsis
- class (size ~ SizeType prim, prec ~ PrecType prim, SizeToPrec size prec, TypeCheckPrim prim size) => QuantumHavocCostPrim prim size prec | prim -> size prec where
- quantumQueryCostsQuantum :: prim -> FailProb prec -> PrimFnShape prim prec
- quantumQueryCostsUnitary :: prim -> FailProb prec -> PrimFnShape prim (UnitaryQueries prec)
- quantumExprCosts :: (CostModel cost, prec ~ PrecType cost) => prim -> FailProb prec -> cost
- class (size ~ SizeType prim, prec ~ PrecType prim, SizeToPrec size prec, TypeCheckPrim prim size) => QuantumExpCostPrim prim size prec where
- quantumExpQueryCostsQuantum :: forall shape m. (shape ~ PrimFnShape prim, m ~ EvaluationMonad prec) => prim -> FailProb prec -> shape ([Value size] -> m [Value size]) -> shape [([Value size], prec)]
- quantumExpQueryCostsUnitary :: forall shape m. (shape ~ PrimFnShape prim, m ~ EvaluationMonad prec) => prim -> FailProb prec -> shape ([Value size] -> m [Value size]) -> shape (UnitaryQueries prec)
- quantumExpExprCosts :: forall shape cost m. (CostModel cost, prec ~ PrecType cost, shape ~ PrimFnShape prim, m ~ EvaluationMonad prec) => prim -> FailProb prec -> shape ([Value size] -> m [Value size]) -> cost
Classical-Quantum Compilation and Cost
class (size ~ SizeType prim, prec ~ PrecType prim, SizeToPrec size prec, TypeCheckPrim prim size) => QuantumHavocCostPrim prim size prec | prim -> size prec where #
Worst-case Quantum query and operation costs of a primitive. Represents one level of the call graph. The quantum compiler of the primitive can use both the quantum and unitary compilation of its function arguments.
Minimal complete definition
Nothing
Methods
quantumQueryCostsQuantum :: prim -> FailProb prec -> PrimFnShape prim prec #
Bound on number of queries made to each function's quantum compilation.
default quantumQueryCostsQuantum :: (Generic prim, GQuantumHavocCostPrim (Rep prim) size prec) => prim -> FailProb prec -> PrimFnShape prim prec #
quantumQueryCostsUnitary :: prim -> FailProb prec -> PrimFnShape prim (UnitaryQueries prec) #
Bound on number of queries made to each function's unitary compilation.
default quantumQueryCostsUnitary :: (Generic prim, GQuantumHavocCostPrim (Rep prim) size prec) => prim -> FailProb prec -> PrimFnShape prim (UnitaryQueries prec) #
quantumExprCosts :: (CostModel cost, prec ~ PrecType cost) => prim -> FailProb prec -> cost #
Cost of all additional operations.
Instances
class (size ~ SizeType prim, prec ~ PrecType prim, SizeToPrec size prec, TypeCheckPrim prim size) => QuantumExpCostPrim prim size prec where #
Expected Quantum query and operation costs of a primitive. Represents one level of the call graph. The quantum compiler of the primitive can use both the quantum and unitary compilation of its function arguments.
Minimal complete definition
Nothing
Methods
quantumExpQueryCostsQuantum :: forall shape m. (shape ~ PrimFnShape prim, m ~ EvaluationMonad prec) => prim -> FailProb prec -> shape ([Value size] -> m [Value size]) -> shape [([Value size], prec)] #
default quantumExpQueryCostsQuantum :: forall shape m. (Generic prim, GQuantumExpCostPrim (Rep prim) size prec) => (shape ~ PrimFnShape prim, m ~ EvaluationMonad prec) => prim -> FailProb prec -> shape ([Value size] -> m [Value size]) -> shape [([Value size], prec)] #
quantumExpQueryCostsUnitary :: forall shape m. (shape ~ PrimFnShape prim, m ~ EvaluationMonad prec) => prim -> FailProb prec -> shape ([Value size] -> m [Value size]) -> shape (UnitaryQueries prec) #
Bound on the expected number of queries made to each function's unitary compilation.
default quantumExpQueryCostsUnitary :: forall shape m. (Generic prim, GQuantumExpCostPrim (Rep prim) size prec) => (shape ~ PrimFnShape prim, m ~ EvaluationMonad prec) => prim -> FailProb prec -> shape ([Value size] -> m [Value size]) -> shape (UnitaryQueries prec) #
quantumExpExprCosts :: forall shape cost m. (CostModel cost, prec ~ PrecType cost, shape ~ PrimFnShape prim, m ~ EvaluationMonad prec) => prim -> FailProb prec -> shape ([Value size] -> m [Value size]) -> cost #
Cost of all additional operations. Defaults to zero.
default quantumExpExprCosts :: forall shape cost m. (Generic prim, GQuantumExpCostPrim (Rep prim) size prec) => (CostModel cost, prec ~ PrecType cost, shape ~ PrimFnShape prim, m ~ EvaluationMonad prec) => prim -> FailProb prec -> shape ([Value size] -> m [Value size]) -> cost #
Instances
| (EvalReqs size prec, Floating prec) => QuantumExpCostPrim (DefaultPrimCollection size prec) size prec # | |
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 # | |
| (EvalReqs size prec, Floating prec, Ord prec) => QuantumExpCostPrim (CAmplify size prec) size prec # | |
Defined in Traq.Primitives.Amplify.CAmplify Methods quantumExpQueryCostsQuantum :: (shape ~ PrimFnShape (CAmplify size prec), m ~ EvaluationMonad prec) => CAmplify size prec -> FailProb prec -> shape ([Value size] -> m [Value size]) -> shape [([Value size], prec)] # quantumExpQueryCostsUnitary :: (shape ~ PrimFnShape (CAmplify size prec), m ~ EvaluationMonad prec) => CAmplify 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 (CAmplify size prec), m ~ EvaluationMonad prec) => CAmplify size prec -> FailProb prec -> shape ([Value size] -> m [Value size]) -> cost # | |
| (EvalReqs size prec, Floating prec, Ord prec) => QuantumExpCostPrim (QAmplify size prec) size prec # | |
Defined in Traq.Primitives.Amplify.QAmplify Methods quantumExpQueryCostsQuantum :: (shape ~ PrimFnShape (QAmplify size prec), m ~ EvaluationMonad prec) => QAmplify size prec -> FailProb prec -> shape ([Value size] -> m [Value size]) -> shape [([Value size], prec)] # quantumExpQueryCostsUnitary :: (shape ~ PrimFnShape (QAmplify size prec), m ~ EvaluationMonad prec) => QAmplify 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 (QAmplify size prec), m ~ EvaluationMonad prec) => QAmplify size prec -> FailProb prec -> shape ([Value size] -> m [Value size]) -> cost # | |
| (Floating precT, Integral sizeT, SizeToPrec sizeT precT) => QuantumExpCostPrim (QMax sizeT precT) sizeT precT # | |
Defined in Traq.Primitives.Max.QMax Methods quantumExpQueryCostsQuantum :: (shape ~ PrimFnShape (QMax sizeT precT), m ~ EvaluationMonad precT) => QMax sizeT precT -> FailProb precT -> shape ([Value sizeT] -> m [Value sizeT]) -> shape [([Value sizeT], precT)] # quantumExpQueryCostsUnitary :: (shape ~ PrimFnShape (QMax sizeT precT), m ~ EvaluationMonad precT) => QMax sizeT precT -> FailProb precT -> shape ([Value sizeT] -> m [Value sizeT]) -> shape (UnitaryQueries precT) # quantumExpExprCosts :: forall shape cost m. (CostModel cost, precT ~ PrecType cost, shape ~ PrimFnShape (QMax sizeT precT), m ~ EvaluationMonad precT) => QMax sizeT precT -> FailProb precT -> shape ([Value sizeT] -> m [Value sizeT]) -> cost # | |
| (size ~ SizeT, Floating prec, Monoidal prec, Semiring prec) => QuantumExpCostPrim (DetSearch size prec) size prec # | |
Defined in Traq.Primitives.Search.DetSearch Methods quantumExpQueryCostsQuantum :: (shape ~ PrimFnShape (DetSearch size prec), m ~ EvaluationMonad prec) => DetSearch size prec -> FailProb prec -> shape ([Value size] -> m [Value size]) -> shape [([Value size], prec)] # quantumExpQueryCostsUnitary :: (shape ~ PrimFnShape (DetSearch size prec), m ~ EvaluationMonad prec) => DetSearch 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 (DetSearch size prec), m ~ EvaluationMonad prec) => DetSearch size prec -> FailProb prec -> shape ([Value size] -> m [Value size]) -> cost # | |
| (sizeT ~ SizeT, Floating precT, RVType precT precT) => QuantumExpCostPrim (QSearchCFNW sizeT precT) sizeT precT # | |
Defined in Traq.Primitives.Search.QSearchCFNW Methods quantumExpQueryCostsQuantum :: (shape ~ PrimFnShape (QSearchCFNW sizeT precT), m ~ EvaluationMonad precT) => QSearchCFNW sizeT precT -> FailProb precT -> shape ([Value sizeT] -> m [Value sizeT]) -> shape [([Value sizeT], precT)] # quantumExpQueryCostsUnitary :: (shape ~ PrimFnShape (QSearchCFNW sizeT precT), m ~ EvaluationMonad precT) => QSearchCFNW sizeT precT -> FailProb precT -> shape ([Value sizeT] -> m [Value sizeT]) -> shape (UnitaryQueries precT) # quantumExpExprCosts :: forall shape cost m. (CostModel cost, precT ~ PrecType cost, shape ~ PrimFnShape (QSearchCFNW sizeT precT), m ~ EvaluationMonad precT) => QSearchCFNW sizeT precT -> FailProb precT -> shape ([Value sizeT] -> m [Value sizeT]) -> cost # | |
| (size ~ SizeT, Floating prec, Monoidal prec, Semiring prec) => QuantumExpCostPrim (RandomSearch size prec) size prec # | |
Defined in Traq.Primitives.Search.RandomSearch Methods quantumExpQueryCostsQuantum :: (shape ~ PrimFnShape (RandomSearch size prec), m ~ EvaluationMonad prec) => RandomSearch size prec -> FailProb prec -> shape ([Value size] -> m [Value size]) -> shape [([Value size], prec)] # quantumExpQueryCostsUnitary :: (shape ~ PrimFnShape (RandomSearch size prec), m ~ EvaluationMonad prec) => RandomSearch 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 (RandomSearch size prec), m ~ EvaluationMonad prec) => RandomSearch size prec -> FailProb prec -> shape ([Value size] -> m [Value size]) -> cost # | |