Re: [sage-support] Segmentation fault

2014-04-20 Thread Jan Medina
well i use this algorithm Bose_Chowla with the same parameters, this algorithm used 2 hours and a half to find this set. So what is the problem whit the other algorithm? def Bose_Chowla(p,h): if is_prime(p): F.=GF(p^h,name='x') g=random_primitive(p,h); a=[discrete_log(

Re: [sage-support] Segmentation fault

2014-04-20 Thread William Stein
I just realized this is from another thread. Anyway, I tried running it, but killed it after it had used 22GB of RAM. 5848 8399046 39 19 21.6g 20g 208 R 100 52.4 1:42.91 python So you're doing something that exhausts all your RAM, which can lead to a segfault. William On Sun, Apr 20, 2

Re: [sage-support] Segmentation fault

2014-04-20 Thread Jan Medina
Oh sorry, this is random_primitive def random_primitive(p,h): F.=GF(p^h) s=p^h-1 r=F.random_element() j=0 if r!=0: for t in prime_factors(s): if r^(s/t)==1: j=j+1 if j==0: return r else: ret

Re: [sage-support] Re: Random Primitive

2014-04-20 Thread Jan Medina
I think this is a fast algorithm. Im not sure what fast can be just testing the multiplicative order El domingo, 20 de abril de 2014 15:00:37 UTC-5, John Cremona escribió: > > Any reason not to just test r.multiplicative_order() ? > > John Cremona > > On 20 April 2014 20:11, Jan Medina > > wro

Re: [sage-support] Segmentation fault

2014-04-20 Thread William Stein
On Sun, Apr 20, 2014 at 8:36 PM, Jan Medina wrote: > I have this error when i runnig this algorithm > > def Trujillo_Gomez(p,h): > if is_prime(p): > F.=GF(p^(h-1),name='x') > g=random_primitive(p,h-1); > s=p^(h-1) > for i in range(p): > a1=discrete_l

[sage-support] Segmentation fault

2014-04-20 Thread Jan Medina
I have this error when i runnig this algorithm def Trujillo_Gomez(p,h): if is_prime(p): F.=GF(p^(h-1),name='x') g=random_primitive(p,h-1); s=p^(h-1) for i in range(p): a1=discrete_log(g+i,g) a2=a1-i a3=s*a1+i A2=A2

Re: [sage-support] The ubuntu ppa need ffmpeg but it is not the name in ubuntu 14.04

2014-04-20 Thread xunitc
The same as above, it works fine. Thank you! 2014-04-20 17:00 GMT+08:00 Jan Groenewald : > Hi > > I've uploaded a new version with only the ffmpeg dependency removed. Please > try apt-get update and apt-get install sagemath-upstream-binary. > > I will be continuing the thread on sage-devel to get

Re: [sage-support] The ubuntu ppa need ffmpeg but it is not the name in ubuntu 14.04

2014-04-20 Thread Emmanuel Charpentier
Le dimanche 20 avril 2014 11:00:54 UTC+2, Jan Groenewald a écrit : > > Hi > > I've uploaded a new version with only the ffmpeg dependency removed. > Please try apt-get update and apt-get install sagemath-upstream-binary. > That worked fine, thank you. I have just a lingering libavcodec54 that

Re: [sage-support] Re: Random Primitive

2014-04-20 Thread John Cremona
Any reason not to just test r.multiplicative_order() ? John Cremona On 20 April 2014 20:11, Jan Medina wrote: > I did this algorithm to find a primitive element of a multiplicative group > on a finite field. This is a basic algorithm > def random_primitive(p,h): > F.=GF(p^h) > s=p^h-1 >

[sage-support] Computational geometry in the plane: in Sage?

2014-04-20 Thread Ed Scheinerman
Does Sage have, or is there a package I can add, that implements basic plane geometry objects and operations. The sort of thing I'd like to do is, given two points, construct the line that contains them. Or given two circles, intersect them yielding 0, 1, or 2 points. Given a set of points, det

[sage-support] Solving Trigonometric Equations

2014-04-20 Thread Hadi Lq
Hi everyone How can I solve these trigonometric equations: var('A d c1 c2') solve([A*cos(d)==c1,A*sin(d)==c2],A,d) It just gives me: [A*cos(d) == c1, A*sin(d) == c2] -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group

[sage-support] Re: Random Primitive

2014-04-20 Thread Jan Medina
I did this algorithm to find a primitive element of a multiplicative group on a finite field. This is a basic algorithm def random_primitive(p,h): F.=GF(p^h) s=p^h-1 r=F.random_element() j=0 if r!=0: for t in prime_factors(s): if r^(s/t)==1:

[sage-support] Re: Plot the modulus of a complex function.

2014-04-20 Thread Alberto Verga
Same question: kx, ky = var('kx', 'ky', domain='real') k = vector( [kx, ky] ) d1 = vector( [0,1/sqrt(3)] ) d2 = vector( [-1/2,-1/(2*sqrt(3))] ) d3 = vector( [1/2,-1/(2*sqrt(3))] ) hk(kx,ky) = -exp(I*k.dot_product(d1)) - exp(I*k.dot_product(d2)) - exp(I*k.dot_product(d3)) ek(kx,ky) = sqrt((hk(kx

[sage-support] Re: Norm of real valued vector

2014-04-20 Thread Alberto Verga
add assume r>0 r,p = var('r', 'p', domain='real') assume(r>0) norm(vector([r*cos(p),r*sin(p)])).simplify_full() to obtain r Le samedi 19 avril 2014 20:53:53 UTC+2, Hadi Lq a écrit : > > Hi everyone > > sage: R.=RR[] > sage: rvec=vector([r*cos(p),r*sin(p)]) > sage: rr=rvec.norm() > sage: rr.simpl

[sage-support] Re: Norm of real valued vector

2014-04-20 Thread Alberto Verga
You may try: r, p = var('r', 'p', domain = 'real') norm( vector([r*cos(p), r*sin(p)]) ).simplify_full() Le samedi 19 avril 2014 20:53:53 UTC+2, Hadi Lq a écrit : > > Hi everyone > > sage: R.=RR[] > sage: rvec=vector([r*cos(p),r*sin(p)]) > sage: rr=rvec.norm() > sage: rr.simplify_full() >

Re: [sage-support] The ubuntu ppa need ffmpeg but it is not the name in ubuntu 14.04

2014-04-20 Thread Jan Groenewald
Hi I've uploaded a new version with only the ffmpeg dependency removed. Please try apt-get update and apt-get install sagemath-upstream-binary. I will be continuing the thread on sage-devel to get a better set of Depends/Recommends/Suggests. Regards, Jan On 20 April 2014 00:53, xunitc xc wr