[sage-support] Show Tree
I am trying plot a tree than Figure using Digraph but I cann't get this. I get disordered tree. How I will be able to plot than figure?. The code is in attach. Figure https://lh4.googleusercontent.com/-pN081ZMS4hQ/UiYCjc90uGI/AYU/Om642gbP5N8/s1600/binaryHash.jpg -- 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 post to this group, send email to sage-support@googlegroups.com. Visit this group at http://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/groups/opt_out. code.sage Description: Binary data
[sage-support] Question about MPI4PY + SAGE
Dears members, I want know if SAGE, used with mpi4py, support distribuited programming i.e distruited memory for example ... atte Juan -- You received this message because you are subscribed to the Google Groups sage-support group. To post to this group, send email to sage-support@googlegroups.com. To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/sage-support?hl=en.
[sage-support] Fraction Fields coefficients
Dears members, How I will can get the coefficients list in Fraction Field. When I write p.lis() i obtained this message: 'FractionFieldElement_1poly_field' object has no attribute 'list' -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org
[sage-support] Question about sorted
Hi Everybody, I want sort in lexicographic order a binary strings (numpy array), I can use sorted function? best regards -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org
[sage-support] Question about representation GF
Dears members. Give F.a = GF(2^self.m,modulus=a^4+a+1); and let p(X), g(X) belong F[X], I want know, if is there any function to obtain the xgcd of p(X) and g(X), but when these are in log representation? thanks -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org
[sage-support] Question about plot
Dears members I need axes_labels in vertical and horizontal form in side sideways od axis, how make this?. example http://www.personal.psu.edu/egp11/Eric_Paterson/Blog/Entries/2009/11/18_Open-Source_alternatives_for_MATLAB_in_teaching_and_research_files/ericPlot.jpg #P is list_plot tipe P.set_legend_options(loc='upper left') show(P, figsize=6,axes_labels=('log(grau(g(X)))','log(Decifragem cost(seg))'),gridlines=True) -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org
[sage-support] Question about polynomials roots
Dears members I am have a p(X) belong F[X], where F is a Galois Field. In sage i have a roots() function, I want know please, What is a algorithm used for implement this function?. thanks. -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org
[sage-support] Question about plot
Dear members I am a two-tuple vector, vet=[(1,2),(3,4),(5,6),..], i want plot this data with a line aproximation, (interpolation this points), exist any parameter in list_plot function for this. Juan -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org
[sage-support] Question about rdtsc()
Dear members Exist any function in SAGE with same goal of rdtsc() in C?. For example: tmp_ini = rdtsc() ... instructions .. ... tmp_dec = rdtsc() - tmp_ini; -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org
[sage-support] Question about download SAGE
Hi everybody Please I want download the SAGE math for fedora-32bits, but i need the file with extension *.tar not tar.lzmaa, because my tar program no have support fot this extension, ... http://ftp.iitm.ac.in/sage/linux/32bit/index.html. You know where are url? to download this, (without make). -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org
[sage-support] Question about cycles per second in SAGE
Hi everybody. Exists any command in SAGE to get the spent cpu-cycles per second in SAGE? -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org
[sage-support] Re: Question about cycles per second in SAGE
thanks by your attention Volker, ... but this command return the cycles per second measure? On 14 fev, 01:52, Volker Braun vbraun.n...@gmail.com wrote: You probably want wall time spent on executing a statement. This is best measured with timeit: sage: timeit('1+1') 625 loops, best of 3: 552 ns per loop -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org
[sage-support] Question about minimal polynomial to build GF
Hi everybody I want choose different minimal polynomial to build a Galois Field 2^m, how? For example: m = 8 sageF.a=GF(2^8) sage:print a.minpoly() I get ... x^8 + x^4 + x^3 + x^2 + 1 but I want now other polynomial for example x^8+x^7+x^4+x^3+x+1 How? thanks -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org
[sage-support] Question about MPI and SAGE
Dears I want create a new datatype, sage.rings.polynomial.polynomial_zz_pex.Polynomial_ZZ_pEX, to use comm.Reduce method, comm.Reduce([PROD,sage.rings.polynomial.polynomial_zz_pex.Polynomial_ZZ_pEX], [RESUL,sage.rings.polynomial.polynomial_zz_pex.Polynomial_ZZ_pEX],op=MPI.SUM, root=0) how i can make this? thanks, by your attention -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org
[sage-support] Questión About factor() function
Dears. In this code F.a = GF(2^(4)) PR = PolynomialRing(F,'X') M = vector(PR,8) #get a g1 g1 = (X + 1) * (X + a) * (X + a^3) * (X + a^5) * (X + a^5 + a^4 + a^3 + a) * (X + a^6 + a^5 + a^4 + a^2) * (X + a^7 + a^2 + a + 1) * (X + a^7 + a^6 + a^5 + a^3) for i in range(self.8): M[i]=g1.factor()[i] I get File parent.pyx, line 941, in sage.structure.parent.Parent.__call__ (sage/structure/parent.c:7102) File coerce_maps.pyx, line 82, in sage.structure.coerce_maps.DefaultConvertMap_unique._call_ (sage/ structure/coerce_maps.c:3254) File coerce_maps.pyx, line 77, in sage.structure.coerce_maps.DefaultConvertMap_unique._call_ (sage/ structure/coerce_maps.c:3157) File /home/juaninf/Programas/sage/local/lib/python2.6/site-packages/ sage/rings/polynomial/polynomial_ring.py, line 410, in _element_constructor_ return C(self, x, check, is_gen, construct=construct, **kwds) File polynomial_zz_pex.pyx, line 129, in sage.rings.polynomial.polynomial_zz_pex.Polynomial_ZZ_pEX.__init__ (sage/rings/polynomial/polynomial_zz_pex.cpp:11334) TypeError: unable to convert X + a^4 into the base ring Please, How I can to fix this ...? -- - Juan del Carmen Grados Vásquez Laboratório Nacional de Computação Científica Tel: +55 24 2233-6260 (http://www.lncc.br/) http://juaninf.blogspot.com - -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org
[sage-support] Question about Groener Basis
I want implement a efficient linear solve system over GF(2) (and too parallel if this is posible), i reading this article, but i dont understand http://ask.sagemath.org/question/467/solve-large-system-of-linear-equations-over-gf2 please I like please a example how, make this? for example with this matrix [1 0 0] [1 1 0] thanks -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org
[sage-support] Question about sagenb.org
Exist sagenb.org with openmpi module? -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org
[sage-support] Question about Kernel Matrix
Hi everyone I want know if exist a parallel implementation to kernels of matrices with openmpi in sage thanks -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org
[sage-support] Question about legend place in plot
Dears I am having a problem with legend place in plot please see this URL http://juaninf.blogspot.com/2011/10/pronto-comparacion-de-algoritmos-para.html I want that legend is in left side, ... how? -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org
[sage-support] Question about Convert Polynomial
Hi everyone I have two polynomial p,q, when I make sage:print polynomial, type(polynomial) get a*X type 'sage.rings.polynomial.polynomial_zz_pex.Polynomial_ZZ_pEX' X^4 + (a + 1)*X^3 + (a^3 + a)*X^2 + a*X + 1 class 'sage.rings.fraction_field_element.FractionFieldElement_1poly_field' I want convert polynomial in sage.rings.fraction_field_element.FractionFieldElement_1poly_field to sage.rings.polynomial.polynomial_zz_pex.Polynomial_ZZ_pEX is posible?, how? thanks by your answers -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org
[sage-support] Question about Plot
Hi everyone I am have 4 vectors, and I want plot 2 graphics in the same place, vector1 vs vector2 color = red vector3 vs vector4 color = yelow How? please help me, -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org
[sage-support] Question about eclipse + pydev + sage
Hi everyone I want use eclipse + pydev IDE for SAGE, I see this https://groups.google.com/forum/#!topic/sage-support/HTPssIMKMHw/discussion I got set sage-python as interpreter, but when run the *. sage, it returns Error File / home/juaninf/workspace/goppa1/src/test.sage, line 28 F. x = GF (2) ^ SyntaxError: invalid syntax Used Anyelse eclipse for this? -- - Juan del Carmen Grados Vásquez Laboratório Nacional de Computação Científica Tel: +55 24 2233-6260 (http://www.lncc.br/) http://juaninf.blogspot.com - -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org
[sage-support] Re: Question about congruence
Hi everybody, I want implement a extend Euclidean Algorithm ( to solve a(x) congruence b(x)R(x) mod (g(x))), (egcd function), but this give wrong results, below my egcd, please help me to fix ... I am testing with inverse multiplicative from output of xgcd def egcd(p1,p2): if p2 == PR(0): return (p1,1,0) else: (q1, r1) = (p1).quo_rem(p2) (d,s1,t1) = egcd(p2, r1) return (d,t1,(s1 - q1 * t1)) m = 4 F.x = GF(2) Phi.x = GF(2^m); PR = PolynomialRing(Phi,'z'); N = 2^m - 1; X = PolynomialRing(Phi,repr('z')).gen(); g = X^4+X^3+X^2+1+x^2; # goppa polynomial R = (x^3 + x^2 + 1)*X^3 + (x^3 + x^2 + x)*X^2 + (x^2 + 1)*X + x^3 + x (a11,b11,c11) = egcd(g,R) print 'testing',((c11.mod(g)*(R))).mod(g) (a11,b11,c11) = xgcd(g,R) print 'testing',((c11.mod(g)*(R))).mod(g) On 29 sep, 07:54, juaninf juan...@gmail.com wrote: in the paper that I reading say use Euclides Algorithm, but I dont know how On 29 sep, 07:29, juaninf juan...@gmail.com wrote: g(x) is prime polynomial On 29 sep, 07:28, juaninf juan...@gmail.com wrote: How do a(x) congruence b(x)R(x) mod (g(x)) in sage? thanks by your answers -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org
[sage-support] Split even and odd part p(z) = p0^2(z)+z*p1^2(z)
Hi, I am a newbie working in polynomial quotient rings: I want to implement the Patterson algorithm to decode Goppa Codes. Therefore, I need to split a polynomial p in a quotient ring in its even part p0 and its odd part p1 such that p(z) = p0^2(z)+z*p1^2(z). I run into several problems to do so in SAGE: m = 4 F.x = PolynomialRing(GF(2)) xx = F.gen() S.x = F.quotient(x^m + x + 1) print S u = S.gen() N = 2^m-1 n = 8 F_E.X = PolynomialRing(S) g = X split(g)? how? help please -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org
[sage-support] Question about congruence
How do a(x) congruence b(x)R(x) mod (g(x)) in sage? thanks by your answers -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org
[sage-support] Re: Question about congruence
g(x) is prime polynomial On 29 sep, 07:28, juaninf juan...@gmail.com wrote: How do a(x) congruence b(x)R(x) mod (g(x)) in sage? thanks by your answers -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org
[sage-support] Re: Question about congruence
in the paper that I reading say use Euclides Algorithm, but I dont know how On 29 sep, 07:29, juaninf juan...@gmail.com wrote: g(x) is prime polynomial On 29 sep, 07:28, juaninf juan...@gmail.com wrote: How do a(x) congruence b(x)R(x) mod (g(x)) in sage? thanks by your answers -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org
[sage-support] Question about xgcd method
Hi everybody, I want implement a modified extend Euclidean Algorithm, (egcd function), but this give wrong results, below my egcd, please help me to fix ... def egcd(p1,p2): if p2 == PR(0): return (p1,1,0) else: (q1, r1) = (p1).quo_rem(p2) (d,s1,t1) = egcd(p2, r1) return (d,t1,(s1 - q1 * t1)) m = 4 F.x = GF(2) Phi.x = GF(2^m); PR = PolynomialRing(Phi,'z'); N = 2^m - 1; X = PolynomialRing(Phi,repr('z')).gen(); g = X^4+X^3+X^2+1+x^2; # goppa polynomial R = (x^3 + x^2 + 1)*X^3 + (x^3 + x^2 + x)*X^2 + (x^2 + 1)*X + x^3 + x (a11,b11,c11) = egcd(g,R) print 'testing',((c11.mod(g)*(R))).mod(g) (a11,b11,c11) = xgcd(g,R) print 'testing',((c11.mod(g)*(R))).mod(g) -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org
[sage-support] Question About Primitive Element
Hi How I will get a primite element ... F = GF(2) PRF.z = PolynomialRing(F); print PRF Phi = PRF.quotient(z^4+z+1); Phi.primitive_element() . ? -- - Juan del Carmen Grados Vásquez Laboratório Nacional de Computação Científica Tel: +55 24 2233-6260 (http://www.lncc.br/) http://juaninf.blogspot.com - -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org
[sage-support] Question about Patterson Algorithm Implementation
Hi everybody, I am implement Patterson Algorithm for Goppa code, I am copying lines from paper How SAGE helps to implement Goppa Codes and McEliece PKCSs [attach], and my test is a random vector . the error are in Line 77, I expect get roots from \sigma (locator polynomial), but implementation have a fail before. thanks by your attention. ''' Patterson Implementation: The following algorithm are in [Ict2011] REFERENCES: .. [Ict2011] How SAGE helps to implement Goppa Codes and McEliece PKCSs ''' def encode(u): return u*G_Goppa def split1(p): # split polynomial p over F into even part po # and odd part p1 such that p(z) = p2 (z) + z p2 (z) Phi1 = p.parent() p0 = Phi1([sqrt(c) for c in p.list()[0::2]]) p1 = Phi1([sqrt(c) for c in p.list()[1::2]]) return (p0,p1) m = 4 N = 2^m - 1; F.x = GF(2) Phi.x = GF(2^m); PR = PolynomialRing(Phi,'z'); print 'PR is',PR; codelocators = [x^i for i in range(N)] print(codelocators) X = PolynomialRing(F,repr('z')).gen() #defining Goppa Polynomial g = X^2+X+x^3 print 'goppa polinomial=',g #verifing if g is irreducible over F if g.is_irreducible(): print 'g(z) =',g,'is irreducible' #verifing g(codelocators[i])0 for i in range(N): if g(codelocators[i])==Phi(0): print 'alarm: g(alpha_'+str(i)+')=0' #creating Parity Check Matrix H_gRS = matrix([[codelocators[j]^(i) for j in range(N)] for i in range(m)]) H_Goppa = matrix(F,m*H_gRS.nrows(),H_gRS.ncols()); for i in range(H_gRS.nrows()): for j in range(H_gRS.ncols()): be = bin(eval(H_gRS[i,j].int_repr()))[2:] be = '0'*(m-len(be))+be be = list(be) H_Goppa[m*i:m*(i+1),j]=vector(map(int,be)) #creating Generator Matrix Krnl = H_Goppa.right_kernel() G_Goppa = Krnl.basis_matrix() print 'H_Goppa=',H_Goppa print 'G_Goppa=',G_Goppa #code dimension k = G_Goppa.nrows() #TEST## #creating a random vector 'u' to test decode u = vector(F,[randint(0,1) for _ in range(k)]) print 'u=',u #coding random vector 'u' with G_Goppa c = encode(u) #creating error vector e = vector(F,H_gRS.ncols()) e[5]=1; y = vector(F,H_gRS.ncols()) #vector to test decode y = c+e; #creating syndrome polynomial s = H_gRS*y.transpose() sP = PR([s[_,0] for _ in range(s.nrows())]) #steps to Patterson Algorithm from paper g0g1 = split1(g); w = (g0g1[0])._mul_(((g0g1[1])).__invert__()) T0T1 = split1((sP).__invert__()._add_(X)) # here ERROR R = T0T1[0]+((w)*(T0T1[1])) print 'R=',R (d1,u,v) =xgcd(1,R) print 'egcd',(d1,u,v) a = g*u b = g*v #creating locator polynomial sigma = (a^2+X*(b^2)) print 'sigma',sigma #verifing roots for i in range(N): if((sigma((x^i))) == 0): # an error occured print 'error' print N-i -- - Juan del Carmen Grados Vásquez Laboratório Nacional de Computação Científica Tel: +55 24 2233-6260 (http://www.lncc.br/) http://juaninf.blogspot.com - -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org