Ask Your Question
2

Polynomial ring modulus integer to univariate polynomial ring over the Integers

asked 2016-10-22 02:50:00 -0600

Node.js gravatar image

I want to use the DiscreteGaussianDistributionPolynomialSampler library:

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 -

However, it takes a univariate polynomial ring over the Integers but I want to use a quotient ring of integers modulus instead. Something like this:

Quotient polynomial ring of: (x^1024 + 1) modulus 13:

modulus = 13
R = PolynomialRing(GF(modulus), "X")
X = R.gen()
Y = R.quotient(X^1024 + 1, "x")
x = Y.gen()

Question: Is it possible? if it is not possible is there a way to manually mod the result with x^1024 +1 and then with 13 afterwards?

Any help would be appreciated.

edit retag flag offensive close merge delete

Comments

Link of the library (I didn't have sufficient points to have URL in my question): http://doc.sagemath.org/html/en/reference/stats/sage/stats/distributions/discrete_gaussian_polynomial.html#sage.stats.distributions.discrete_gaussian_polynomial.DiscreteGaussianDistributionPolynomialSampler.__init__ (link)

Node.js gravatar imageNode.js ( 2016-10-22 02:51:01 -0600 )edit
slelievre gravatar imageslelievre ( 2016-12-03 08:42:54 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
1

answered 2016-10-27 07:23:50 -0600

castor gravatar image

Your code is almost there, probably you need the following:

from sage.stats.distributions.discrete_gaussian_polynomial import DiscreteGaussianDistributionPolynomialSampler
f=DiscreteGaussianDistributionPolynomialSampler(ZZ['x'], 8, 3.0)()
R.<X> = PolynomialRing(GF(13))
Y.<t> = R.quotient(X^1024 + 1)
Y(f)

Here you obtain

10*t^7 + 5*t^6 + 3*t^4 + 7*t^3 + 12*t^2 + 2*t + 1
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2016-10-22 02:50:00 -0600

Seen: 349 times

Last updated: Oct 27 '16