我是https://embed.plnkr.co/nyLl6w9iBwgWDvTUbN7p/的新用户,我想使用Sage库:
from sage.stats.distributions.discrete_gaussian_polynomial import DiscreteGaussianDistributionPolynomialSampler
sage: DiscreteGaussianDistributionPolynomialSampler(ZZ['x'], 8, 3.0)()
3*x^7 + 3*x^6 - 3*x^5 - x^4 - 5*x^2 + 3
DiscreteGaussianDistributionPolynomialSampler(P, n, sigma)
P - a univariate polynomial ring over the Integers
n - number of coefficients to be sampled
sigma -
然而,它需要univariate polynomial ring over the Integers
,但我想使用整数模数的商环。像这样:
商多项式环:(x ^ 1024 + 1)模数13 :
modulus = 13
R = PolynomialRing(GF(modulus), "X")
X = R.gen()
Y = R.quotient(X^1024 + 1, "x")
x = Y.gen()
问题:有可能吗?如果不可能有办法用(x^1024 +1)
手动修改结果,然后用13
手动修改结果吗?
任何帮助都将不胜感激。