qilisdk.noise.gaussian_perturbation

Classes

GaussianPerturbation

Gaussian-distributed parameter perturbation.

Module Contents

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

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ámetros:
  • 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.

Muestra:

ValueError – If std is negative.

property mean: float[fuente]

Return the mean of the Gaussian offset.

Devuelve:

The mean value.

property std: float[fuente]

Return the standard deviation of the Gaussian offset.

Devuelve:

The standard deviation value.

perturb(value: float) float[fuente]

Return a perturbed version of a parameter value.

Parámetros:

value (float) – The original parameter value.

Devuelve:

The perturbed parameter value.