make_discrete_distribution

guppylang.std.qsystem.random.make_discrete_distribution(weights: array[float, DISCRETE_N]) DiscreteDistribution[DISCRETE_N][source]

Construct a discrete probability distribution over the set {0, 1, 2, … DISCRETE_N - 1}, given as an array of weights which represent probabilities. The weights need not be normalized, but must be non-negative and not all zero.