25 : model_(model), generator_(seed) {
27 throw std::invalid_argument(
"Sampler::Sampler needs a non-null model.");
37 size_t d = sigmas.size();
39 for (
size_t i = 0;
i <
d;
i++) {
46 std::normal_distribution<double> dist(0.0, sigma);
std::mt19937_64 generator_
Vector sample() const
sample from distribution
noiseModel::Diagonal::shared_ptr model_
noiseModel::Diagonal::shared_ptr model
static Vector sampleDiagonal(const Vector &sigmas, std::mt19937_64 *rng)
sample with given random number generator
sampling from a NoiseModel
static noiseModel::Diagonal::shared_ptr Diagonal(const Matrix &covariance)
static const double sigma
Sampler(const noiseModel::Diagonal::shared_ptr &model, uint_fast64_t seed=42u)
std::shared_ptr< Diagonal > shared_ptr