Back to Forum | View unanswered posts | View active topics
Topic review - How to use NTL in singular? |
Author |
Message |
|
|
Post subject: |
Re: How to use NTL in singular? |
 |
|
In your case GF (3^2) is represented by a primitive element. See http://www.singular.uni-kl.de/Manual/latest/sing_29.htm#SEC39 for an example of this.
In your case GF (3^2) is represented by a primitive element. See [url]http://www.singular.uni-kl.de/Manual/latest/sing_29.htm#SEC39[/url] for an example of this.
|
|
|
 |
Posted: Tue Oct 11, 2011 2:24 pm |
|
|
 |
|
|
Post subject: |
Re: How to use NTL in singular? |
 |
|
Thanks. But when I define a ring: ring s=(9,a),(x,y),dp; s; // # ground field : 9 // primitive element : a // minpoly : 1*a^2+2*a^1+2*a^0 // number of vars : 2 // block 1 : ordering dp // : names x y // block 2 : ordering C
then i can't reduce the elememts like a^6 or a7x2+a9y; what i mean is to present the coefficients by the basis { 1, a }, in fact a^6 is (-a-1);
Thanks. But when I define a ring: ring s=(9,a),(x,y),dp; s; // # ground field : 9 // primitive element : a // minpoly : 1*a^2+2*a^1+2*a^0 // number of vars : 2 // block 1 : ordering dp // : names x y // block 2 : ordering C
then i can't reduce the elememts like a^6 or a7x2+a9y; what i mean is to present the coefficients by the basis { 1, a }, in fact a^6 is (-a-1);
|
|
|
 |
Posted: Sat Oct 08, 2011 5:09 am |
|
|
 |
|
|
Post subject: |
Re: How to use NTL in singular? |
 |
|
If you want a uniformly random element of GF (3^3) you're right.
If you want a uniformly random element of GF (3^3) you're right.
|
|
|
 |
Posted: Tue Sep 27, 2011 2:36 pm |
|
|
 |
|
|
Post subject: |
Re: How to use NTL in singular? |
 |
|
Each coefficient of the monomial in f is zero with probability 1/3. So f must be defined as poly f = sparsepoly (0,2,0,4);
Don't you think so?
Each coefficient of the monomial in f is zero with probability 1/3. So f must be defined as poly f = sparsepoly (0,2,0,4);
Don't you think so?
|
|
|
 |
Posted: Tue Sep 27, 2011 4:01 am |
|
|
 |
|
|
Post subject: |
Re: How to use NTL in singular? |
 |
|
Hi Try something like LIB "random.lib"; ring r= 3,x,dp; poly f= sparsepoly (0,2,50,4);
ring s=(3,a),(x,y),dp; minpoly= a3+2a+1; map m= r,a; m (f); The sparsepoly (0,2,50,4) creates a random polynomial in x with coefficients in the range [1,4) of degree between 0 and 2. And each monomial is zero with probability 0,5. The last 4 lines maps this polynomial to a ring s with coefficients from Z/3Z[a]/ (a3+2a+1).
Hi Try something like LIB "random.lib"; ring r= 3,x,dp; poly f= sparsepoly (0,2,50,4);
ring s=(3,a),(x,y),dp; minpoly= a3+2a+1; map m= r,a; m (f); The sparsepoly (0,2,50,4) creates a random polynomial in x with coefficients in the range [1,4) of degree between 0 and 2. And each monomial is zero with probability 0,5. The last 4 lines maps this polynomial to a ring s with coefficients from Z/3Z[a]/ (a3+2a+1).
|
|
|
 |
Posted: Mon Aug 29, 2011 11:36 am |
|
|
 |
|
|
Post subject: |
Re: How to use NTL in singular? |
 |
|
Say, GF(3^3), I want randomly generate a element in this field, and each one with equal possibility to be outputted.
Say, GF(3^3), I want randomly generate a element in this field, and each one with equal possibility to be outputted.
|
|
|
 |
Posted: Sat Aug 27, 2011 7:51 am |
|
|
 |
|
|
Post subject: |
Re: How to use NTL in singular? |
 |
|
What do you mean by Quote: but sparsepoly can not generate a random element of the field with equal posibility...
Use the command random for random integers within a specified range http://www.singular.uni-kl.de/Manual/la ... htm#SEC340
What do you mean by
[quote] but sparsepoly can not generate a random element of the field with equal posibility... [/quote]
Use the command [b]random[/b] for random integers within a specified range
http://www.singular.uni-kl.de/Manual/latest/sing_300.htm#SEC340
|
|
|
 |
Posted: Thu Aug 25, 2011 1:56 pm |
|
|
 |
|
|
Post subject: |
Re: How to use NTL in singular? |
 |
|
but sparsepoly can not generate a random element of the field with equal posibility...
but sparsepoly can not generate a random element of the field with equal posibility...
|
|
|
 |
Posted: Thu Aug 25, 2011 11:43 am |
|
|
 |
|
|
Post subject: |
Re: How to use NTL in singular? |
 |
|
Hi, you can use the function random in a prime field or sparsepoly in a non prime field (Please check the manual). NTL is used by default for univariate gcd and factorization. If you need NTL for anything besides this let me know.
Hi, you can use the function random in a prime field or sparsepoly in a non prime field (Please check the manual). NTL is used by default for univariate gcd and factorization. If you need NTL for anything besides this let me know.
|
|
|
 |
Posted: Mon Aug 22, 2011 12:06 pm |
|
|
 |
|
|
Post subject: |
How to use NTL in singular? |
 |
|
I want to generate a random element in a finite field, (may not be a prime field), do I have to write dynamic module? And I can't find a file to reference with the sourcecode written in the structure of dynamic module. Besides, how can I use NTL in singular? Should I write dynamic module too? Thank you
I want to generate a random element in a finite field, (may not be a prime field), do I have to write dynamic module? And I can't find a file to reference with the sourcecode written in the structure of dynamic module. Besides, how can I use NTL in singular? Should I write dynamic module too? Thank you
|
|
|
 |
Posted: Sun Aug 21, 2011 10:39 am |
|
|
 |
|
|
It is currently Fri May 13, 2022 11:06 am
|
|