SuccessProb#
qualtran.resource_counting.SuccessProb
View source on GitHub
|
The success probability of a bloq.
Inherits From: CostKey
qualtran.resource_counting.SuccessProb()
A bloq’s success probability is the multiplicative product of its callees’
success probabilities. Bloqs that have a specific success probability should override
my_static_costs to provide their actual success probability.
Methods#
compute
compute(
bloq: 'Bloq', get_callee_cost: Callable[['Bloq'], float]
) -> float
Compute this type of cost.
When implementing a new CostKey, this method must be overridden.
Users should not call this method directly. Instead: use the qualtran.resource_counting
functions like get_cost_value, get_cost_cache, or query_costs. These provide
caching, logging, generalizers, and support for static costs.
For recursive computations, use the provided callable to recurse.
Args
bloqThe bloq to compute the cost of.
get_callee_costA qualtran-provided function for computing costs for “callees” of the bloq; i.e. bloqs in the decomposition. Use this function to accurately cache intermediate cost values and respect bloqs’ static costs.
Returns
zero
zero() -> float
The value corresponding to zero cost.
__ne__
__ne__(
other
)
Check equality and either forward a NotImplemented or return the result negated.
__eq__
__eq__(
other
)
Method generated by attrs for class SuccessProb.
View source on GitHub