unitaria.Estimator¶
- class unitaria.Estimator(default_precision: float, default_failure_probability: float = 0.01)[source]¶
Bases:
ABCInterface representing a way to estimate the norm of a block encoding.
- Parameters:
default_precision – Default for the
precisionparameter inestimate_norm.default_failure_probability – Default for the
failure_probabilityparameter inestimate_norm.
- abstractmethod estimate_norm(precision: float | None = None, failure_probability: float | None = None) float[source]¶
Estimate the norm of the given block encoding.
The block encoding must represent a vector. The returned value is guaranteed to lie in the range
[0, node.normalization].The implementors of this method are free to interpret the
precision``argument loosely, and ignore the ``failure_probabilityargument.- Parameters:
node – The node representing the vector of which to compute the norm.
precision – The absolute precision, with which the norm should be computed. If
None,self.default_precisionis used instead.failure_probability – The maximum allowed failure probability, with which the absolute error of the estimate may exceed the given precision. If
None,self.default_failure_probabilityis used instead.