estimator.nd.NoiseDistribution

estimator.nd.NoiseDistribution#

class estimator.nd.NoiseDistribution(n: int | None = None, mean: float = 0, stddev: float = 0, bounds: tuple = (<MagicMock name='mock.__neg__()' id='140263692870848'>, <MagicMock id='140263692671920'>), is_Gaussian_like: bool = False, _density: float = 1.0)[source]#

All noise distributions are instances of this class. It is recommended to pick one of the following available implementations below: - DiscreteGaussian - DiscreteGaussianAlpha - CenteredBinomial - Uniform - UniformMod - SparseTernary - SparseBinary - Binary - Ternary

NOTE: Generally, to generate an LWE parameter you call one of the above for the secret and error, without specifying the dimension n and m for secret/error respectively! These are initialized, when constructing the LWEParameters object.

__call__(**kwargs)#

Call self as a function.

Methods

__init__([n, mean, stddev, bounds, ...])

resize(new_n)

Return an altered distribution having a dimension new_n.

support_size([fraction])

Attributes

bounds

hamming_weight

The number of non-zero coefficients in this distribution

is_Gaussian_like

is_bounded

Whether the value of coefficients are bounded

is_sparse

Whether the density of the distribution is < 1/2.

mean

n

stddev