qilisdk.noise.gaussian_perturbation

Classes

GaussianPerturbation

Gaussian-distributed parameter perturbation.

Module Contents

class GaussianPerturbation(*, mean: float = 0.0, std: float, seed: int = 42)[font]

Bases: qilisdk.noise.parameter_perturbation.ParameterPerturbation

Gaussian-distributed parameter perturbation.

Each call to perturb adds a random offset drawn from N(mean, std^2).

Paràmetres:
  • mean (float) – Mean of the Gaussian offset.

  • std (float) – Standard deviation of the Gaussian offset (must be >= 0).

  • seed (int) – Seed for the random number generator.

Llença:

ValueError – If std is negative.

property mean: float[font]

Return the mean of the Gaussian offset.

Retorna:

The mean value.

property std: float[font]

Return the standard deviation of the Gaussian offset.

Retorna:

The standard deviation value.

perturb(value: float) float[font]

Return a perturbed version of a parameter value.

Paràmetres:

value (float) – The original parameter value.

Retorna:

The perturbed parameter value.