This is a variable name clash. Somehow, using 'x' for modulus creates a problem.
If I instead do

T.<xx>=GF(2)[]
K.<a>=GF(2^6, modulus=xx^6 + xx^4 + xx^3 + xx + 1)
...

then everything works as expected.


On Fri, Nov 22, 2019 at 9:51 AM Dima Pasechnik <dimp...@gmail.com> wrote:
>
> This is now https://trac.sagemath.org/ticket/28786
> Note that it only happens if modulus is explicitly given.
>
> On Fri, Nov 22, 2019 at 9:47 AM Dima Pasechnik <dimp...@gmail.com> wrote:
> >
> > yes, I can confirm this is still giving an error in the latest Sage
> > beta. (9.0.beta6).
> > Note that actually it's two identical inputs, the 2nd executed after
> > the 1st gives the error.
> >
> > I'll open a ticket.
> >
> > On Fri, Nov 22, 2019 at 7:53 AM Samanta <susantasamant...@gmail.com> wrote:
> > >
> > > I did not understand why the error has occurred. For the first time, it 
> > > returned output but for the second time when I run the same code, I found 
> > > an error "ValueError: the degree of the modulus does not equal the degree 
> > > of the field" which is also not true as my irreducible polynomial has 
> > > degree 6.
> > > I am attaching my code and output for two consecutive times.
> > >
> > > sage: K.<a>=GF(2^6, modulus=x^6 + x^4 + x^3 + x + 1)
> > > ....: x=a^9
> > > ....: y=a^21
> > > ....: z=1/x
> > > ....: v=vector([1,y,y^2,y^3,y^4,y^5,y^6])
> > > ....: 
> > > S=matrix([[1,1,1,1,1,1,1],[1,z,z^2,z^3,z^4,z^5,z^6],[1,(z^2),(z^2)^2,(z^2)^3,(z^2)^4,(z^2)^5,(z^2)^6],[1,(z^3),(z^3)^2,(z^3)^3,(z^3)^4,(z^
> > > ....: 
> > > 3)^5,(z^3)^6],[1,(z^4),(z^4)^2,(z^4)^3,(z^4)^4,(z^4)^5,(z^4)^6],[1,(z^5),(z^5)^2,(z^5)^3,(z^5)^4,(z^5)^5,(z^5)^6],[1,(z^6),(z^6)^2,(z^6)^3
> > > ....: ,(z^6)^4,(z^6)^5,(z^6)^6]])
> > > ....: w=S*v
> > > ....: w
> > > ....:
> > > (1, a^3 + a + 1, a^5 + a^4 + a^3 + a^2 + 1, a^4 + a^3 + a^2, a^5 + a^4 + 
> > > a^3, a^3 + a^2 + 1, a^4 + a^3 + a^2 + a + 1)
> > >
> > > sage: K.<a>=GF(2^6, modulus=x^6 + x^4 + x^3 + x + 1)
> > > ....: x=a^9
> > > ....: y=a^21
> > > ....: z=1/x
> > > ....: v=vector([1,y,y^2,y^3,y^4,y^5,y^6])
> > > ....: 
> > > S=matrix([[1,1,1,1,1,1,1],[1,z,z^2,z^3,z^4,z^5,z^6],[1,(z^2),(z^2)^2,(z^2)^3,(z^2)^4,(z^2)^5,(z^2)^6],[1,(z^3),(z^3)^2,(z^3)^3,(z^3)^4,(z^
> > > ....: 
> > > 3)^5,(z^3)^6],[1,(z^4),(z^4)^2,(z^4)^3,(z^4)^4,(z^4)^5,(z^4)^6],[1,(z^5),(z^5)^2,(z^5)^3,(z^5)^4,(z^5)^5,(z^5)^6],[1,(z^6),(z^6)^2,(z^6)^3
> > > ....: ,(z^6)^4,(z^6)^5,(z^6)^6]])
> > > ....: w=S*v
> > > ....: w
> > > ....:
> > > ---------------------------------------------------------------------------
> > > ValueError                                Traceback (most recent call 
> > > last)
> > > <ipython-input-3-37bf7e6f8848> in <module>()
> > > ----> 1 K = GF(Integer(2)**Integer(6), modulus=x**Integer(6) + 
> > > x**Integer(4) + x**Integer(3) + x + Integer(1), names=('a',)); (a,) = 
> > > K._first_ngens(1)
> > >       2 x=a**Integer(9)
> > >       3 y=a**Integer(21)
> > >       4 z=Integer(1)/x
> > >       5 
> > > v=vector([Integer(1),y,y**Integer(2),y**Integer(3),y**Integer(4),y**Integer(5),y**Integer(6)])
> > >
> > > /home/susanta/Desktop/SageMath/local/lib/python2.7/site-packages/sage/structure/factory.pyx
> > >  in sage.structure.factory.UniqueFactory.__call__ 
> > > (build/cythonized/sage/structure/factory.c:2162)()
> > >     366             False
> > >     367         """
> > > --> 368         key, kwds = self.create_key_and_extra_args(*args, **kwds)
> > >     369         version = self.get_version(sage_version)
> > >     370         return self.get_object(version, key, kwds)
> > >
> > > /home/susanta/Desktop/SageMath/local/lib/python2.7/site-packages/sage/rings/finite_rings/finite_field_constructor.pyc
> > >  in create_key_and_extra_args(self, order, name, modulus, names, impl, 
> > > proof, check_irreducible, prefix, repr, elem_cache, **kwds)
> > >     583
> > >     584                     if modulus.degree() != n:
> > > --> 585                         raise ValueError("the degree of the 
> > > modulus does not equal the degree of the field")
> > >     586                     if check_irreducible and not 
> > > modulus.is_irreducible():
> > >     587                         raise ValueError("finite field modulus 
> > > must be irreducible but it is not")
> > >
> > > ValueError: the degree of the modulus does not equal the degree of the 
> > > field
> > >
> > > --
> > > You received this message because you are subscribed to the Google Groups 
> > > "sage-support" group.
> > > To unsubscribe from this group and stop receiving emails from it, send an 
> > > email to sage-support+unsubscr...@googlegroups.com.
> > > To view this discussion on the web visit 
> > > https://groups.google.com/d/msgid/sage-support/47e0cba1-d1be-40b7-b376-cfa537b68e29%40googlegroups.com.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/CAAWYfq167j%3DVciCDWp1z9_ws%2Bqgse4aF1AUWdbeu27G6PJc3ag%40mail.gmail.com.

Reply via email to