  In this paper we present a canonical quantum computing method to estimate the
weighted sum w(k)f(k) of the values taken by a discrete function f and real
weights w(k). The canonical aspect of the method comes from relying on a single
linear function encoded in the amplitudes of a quantum state, and using
register entangling to encode the function f.
  We further expand this framework by mapping function values to hashes in
order to estimate weighted sums w(k)h(f(k)) of hashed function values with real
hashes h. This generalization allows the computation of restricted weighted
sums such as value at risk, comparators, as well as Lebesgue integrals and
partial moments of statistical distributions.
  We also introduce essential building blocks such as efficient encodings of
standardized linear quantum states and normal distributions.
