estimator.SDis.variance

static SDis.variance(secret_distribution, alpha=None, q=None, n=None)[source]

Variance of the secret per component.

Parameters:
  • secret_distribution – distribution of secret, see module level documentation for details
  • alpha – only used for normal form LWE
  • q – only used for normal form LWE
  • n – only used for sparse secrets

EXAMPLE:

sage: from estimator import SDis
sage: SDis.variance(True, 8./2^15, 2^15).sqrt().n()
3.19...

sage: SDis.variance((-3,3), 8./2^15, 2^15)
4

sage: SDis.variance(((-3,3),64), 8./2^15, 2^15, n=256)
7/6

sage: SDis.variance((-3,2))
35/12

sage: SDis.variance(((-3,2),64), n=256)
371/400

sage: SDis.variance((-1,1), 8./2^15, 2^15)
2/3

sage: SDis.variance(((-1,1),64), 8./2^15, 2^15, n=256)
1/4

Note

This function assumes that the bounds are of opposite sign, and that the distribution is centred around zero.