SuccessProb#

qualtran.resource_counting.SuccessProb

The success probability of a bloq.

Inherits From: CostKey

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

View source

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

bloq

The bloq to compute the cost of.

get_callee_cost

A 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

View source

The value corresponding to zero cost.

__ne__

Check equality and either forward a NotImplemented or return the result negated.

__eq__

Method generated by attrs for class SuccessProb.