ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Wed, 04 May 2022 02:11:38 +0200how to compute x^ip (mod P) in F2https://ask.sagemath.org/question/62303/how-to-compute-xip-mod-p-in-f2/hello
i want to compute x^iq (mod P) for q=2,0<=i<=3. By using the Euclidean algorithm;
but i don
p = 3
X = ZZ['X'].gen()
P = 1+X+X^2+X^3
K.<X> = GF(p)['X'].quotient(P)
K.<X> = PolynomialRing(GF(2),'X')
X = K.gen()
S = K.quotient(P, 'X')
X = S.gen()
M = matrix([(X^(p*i).list() for i in range(p)]).transpose()
but my matrix M does not correspond to what i have when i do it by hand.
thanksjasmyneWed, 04 May 2022 02:11:38 +0200https://ask.sagemath.org/question/62303/Declaring a vector space map of ringshttps://ask.sagemath.org/question/38258/declaring-a-vector-space-map-of-rings/ Hello sage community!
I am new to sage and have a question which is originally motivated from my tries to implement Berlekamp's algorithm. One is working over a finite field $K=GF(q)$ and wants to factor a polynomial $f\in K[x]$. To do so one considers the ring $R=K[x]/f$ and the map $\beta\colon g\mapsto g^q-g$ from $R$ to itself and wants to compute its kernel. The problem for me is that the definition of $\beta$ <i>uses</i> the ring multiplication of of $R$ but <i>is</i> only a map of $K$-vector spaces, not a ring homomorphism. I am wondering how I can declare this map using sage.
I know I can find a standard $K$-basis of $R$ and I know I can describe $\beta$ by describing its matrix corresponding to this base and I know how to compute the kernel of that matrix and how to translate its elements back to elements of $R$. But still I am interested in wether it is possible to declare a <i>vector space</i> homomorphism of <i>rings</i> in sage and how to work with it.
Thank you!ILikeAlgebraFri, 14 Jul 2017 12:29:00 +0200https://ask.sagemath.org/question/38258/berlekamp masseyhttps://ask.sagemath.org/question/9792/berlekamp-massey/Hello,
I am trying to use B/M algo included in Sage. Now,
berlekamp_massey([GF(2)(0),0,1,0,1,0,0,1,0,1,1,1,0,0,1,1,0,0,0,0,1,0,1,1,0,1,0,1,0,0,0,1,1,1,1,0])
evals to f(x)=x^5 + x^3 + x^2 + x + 1 which is the minimal poly.
Also, I know that when I take the reciprocal (x^5*f(1/x)), I find
g(x)=x^5+x^4+x^3+x^2+1 which is the connection poly. of this LFSR.
My question is how can I regenerate this sequence using this connection poly.?
Providing initial states 0,0,1,0,1 yields to another sequence:
(0 0 1 0 1 1 0 1 0 1 0 0 0 1 1 1 0 1 1 1 1 1 0 0 1 0 0 1 1 0 0)
I think, there might be a bug in B/M implementation because other implementations give
x^19 + x^18 + x^17 + x^14 + x^13 + x^10 + x^9 + x^8 + x^6 + x^3 + x^2 + 1
when fed with the same sequence.
Thanks,
evrim.evrimSat, 09 Feb 2013 21:00:43 +0100https://ask.sagemath.org/question/9792/