Template Class DiscreteRandomVariable¶
Defined in File MeasurementKernels.hpp
Class Documentation¶
-
template<typename PrecisionT>
class DiscreteRandomVariable¶ Generate samples using the alias method.
- Template Parameters
PrecisionT – Precision data type
Public Functions
-
inline DiscreteRandomVariable(std::mt19937 &gen, const std::vector<PrecisionT> &probs)¶
Create a DiscreteRandomVariable object.
- Parameters
gen – Random number generator reference.
probs – Probabilities for values 0 up to N - 1, where N = probs.size().
-
inline std::size_t operator()() const¶
Return a discrete random value.
api/classPennylane_1_1LightningQubit_1_1Measures_1_1DiscreteRandomVariable
Download Python script
Download Notebook
View on GitHub