[sage-devel] Re: My talk with martin Albrecht

2007-11-09 Thread Bobby Moretti
A typo: on page 11, replace "permutations groups" with "permutation groups". On page 38, you say #sage-devel. You might also want to give the irc server's address. Looks like a great intro to Sage. Good luck with the talk. -Bobby On Nov 9, 2007 4:17 PM, William Stein <[EMAIL PROTECTED]> wrote:

[sage-devel] Re: ?Matrix

2007-11-09 Thread Robert Bradshaw
Type sage: Matrix? And the file line tells you that its defined in sage/matrix/ constructor.py - Robert On Nov 9, 2007, at 4:22 PM, John Voight wrote: > > How do I use matrix (or Matrix?) inside python files which are > compiled? Suppose I have a file: > > def my_matrix(d): > return Ma

[sage-devel] Re: My talk with martin Albrecht

2007-11-09 Thread John Voight
Oh, I didn't know I was going to get quoted! (That's fine, of course.) Are we suppose to write "SAGE" since it's an acronym or "Sage" like you do? JV --~--~-~--~~~---~--~~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this

[sage-devel] ?Matrix

2007-11-09 Thread John Voight
How do I use matrix (or Matrix?) inside python files which are compiled? Suppose I have a file: def my_matrix(d): return Matrix(ZZ,d,d,[ [i+j for i in range(d)] for j in range(d)]) I include it in my favorite directory, and compile SAGE, and run: sage: my_matrix(3)

[sage-devel] My talk with martin Albrecht

2007-11-09 Thread William Stein
Hi everybody, The slides of Martin and my talk are available at http://sage.math.washington.edu/tmp/talk/. An accompanying SAGE worksheet can be found at http://sage.math.washington.edu/home/malb/SAGE_Demo.sws . Feedback is very welcome :-) William -- William Stein Associate Professo

[sage-devel] Re: Fwd: [sage-support] sage-2.8.12 build report

2007-11-09 Thread John Voight
I just downloaded a new tarball from sage.math. JV --~--~-~--~~~---~--~~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.co

[sage-devel] Re: sqrt mod p

2007-11-09 Thread William Stein
On Nov 9, 2007 11:19 PM, Steffen <[EMAIL PROTECTED]> wrote: > Hi, I have implemented the Tonelli and Shanks algorithm which has a > complexity of O(ln^4(p)) and appears to be amazing fast. So far its a Could you post some cool impressive benchmarks? :-) william > quick and dirty implementatio

[sage-devel] Re: Fwd: [sage-support] sage-2.8.12 build report

2007-11-09 Thread John Voight
I tried to sage -upgrade my 2.8.9 this evening on an Ubuntu x686, and I got: Building sage/matrix/misc.c because it depends on sage/matrix/ misc.pyx. touch sage/matrix/misc.pyx; cython --embed-positions --incref-local- binop -I/home/kostadm/sage/devel/sage-main -o sage/matrix/misc.c sage/ matrix/

[sage-devel] Re: sqrt mod p

2007-11-09 Thread Steffen
Hi, I have implemented the Tonelli and Shanks algorithm which has a complexity of O(ln^4(p)) and appears to be amazing fast. So far its a quick and dirty implementation directly in my Sage file and without error handling. I will ask Martin (when meeting him next time in the office) how to integrat

[sage-devel] Re: number_field_element coercion

2007-11-09 Thread Robert Bradshaw
On Nov 8, 2007, at 1:52 PM, mabshoff wrote: > There is without a doubt something fishy going on with coercion. See > also malb's report with polynomial rings at > > http://www.sagetrac.org/sage_trac/ticket/1046 Just to confirm, this is only the first time, right? I am pretty sure this is becaus

[sage-devel] Re: sqrt mod p

2007-11-09 Thread John Cremona
I see. In my example a was sage: type(a) John On 09/11/2007, Robert Bradshaw <[EMAIL PROTECTED]> wrote: > > On Nov 9, 2007, at 1:43 PM, John Cremona wrote: > > > [Hello Robert -- are you in Bristol yet?] > > Just got in. > > > I'm puzzled now. My comment on inefficiency and Steffen's were ba

[sage-devel] Re: sqrt mod p

2007-11-09 Thread Robert Bradshaw
On Nov 9, 2007, at 1:43 PM, John Cremona wrote: > [Hello Robert -- are you in Bristol yet?] Just got in. > I'm puzzled now. My comment on inefficiency and Steffen's were based > on the code >> for i from 0 <= i <= n/2: >> if (i*i) % n == self.ivalue: >>

[sage-devel] Re: sqrt mod p

2007-11-09 Thread John Cremona
[Hello Robert -- are you in Bristol yet?] I'm puzzled now. My comment on inefficiency and Steffen's were based on the code > for i from 0 <= i <= n/2: > if (i*i) % n == self.ivalue: > return self._new_c(i) > but now when I do a.sqrt??

[sage-devel] Re: sqrt mod p

2007-11-09 Thread Robert Bradshaw
On Nov 9, 2007, at 11:46 AM, Steffen wrote: > The easier %4 == 3 case seems to be implemented efficiently, but the > %4 == 1 not. The algo from Tonelli and Shanks might be a good solution > here. Any thoughts on other/better algorithm? > > Steffen I actually wrote this code. It eventually dispat

[sage-devel] Re: number_field_element coercion

2007-11-09 Thread William Stein
On Fri, 09 Nov 2007 15:07:03 -, John Voight <[EMAIL PROTECTED]> wrote: > Thanks, somehow I knew this was going to become a trac ticket. It is > also my suspicion that it is an optimization issue with number > fields. It seems really bizarre that it should be calling a > polynomial ring const

[sage-devel] Re: sqrt mod p

2007-11-09 Thread John Cremona
You are right, that is a really stupid algorithm for p=1 (mod 4)! I will suggest this as something easy to be fixed at Sage Days 6 (which is just starting). One could either use pari to do the sqrt more efficiently, or implement something like Tonelli-Shanks as you suggest. John On 09/11/2007,

[sage-devel] Re: sqrt mod p

2007-11-09 Thread Steffen
Thx, I am wondering why I did not try the command a.sqrt?? on my own. However, it seems as the implemented algorithm is not the most efficient one. My result from a.sqrt?? from the latest release: def sqrt(self, extend=True, all=False): cdef int_fast32_t i, n = self.__modulus.int32

[sage-devel] Re: sqrt mod p

2007-11-09 Thread John Cremona
Use the ?? operator to see the algorithm: sage: a=GF(next_prime(10^6)).random_element()^2; sage: a.sqrt?? Type: builtin_function_or_method Base Class: String Form: Namespace: Interactive Source: def sqrt(self, extend=True, all=False): r""" Returns squ

[sage-devel] Re: random polynomial generation

2007-11-09 Thread didier deshommes
On 11/7/07, Martin Albrecht <[EMAIL PROTECTED]> wrote: > > Hi everybody, > > I've attached a 'random_monomial.py' to > >http://trac.sagemath.org/sage_trac/ticket/980 > > which implements Steffen's and my proposal. Hey guys, I've attached a patch for this at http://trac.sagemath.org/sage_trac/

[sage-devel] Re: number_field_element coercion

2007-11-09 Thread John Voight
Thanks, somehow I knew this was going to become a trac ticket. It is also my suspicion that it is an optimization issue with number fields. It seems really bizarre that it should be calling a polynomial ring constructor! (The cost right now is absolutely killing me right now. I've started enum

[sage-devel] sqrt mod p

2007-11-09 Thread Steffen
Hi, I need to find square roots in GF(prime). I did it like this: y = sqrt(GF(prime)(ySquare)) So far I am not quite happy with the calculation periods and I would like to know which algorithm is used. In my case is prime % 4 == 1, which is the hardest case to find the square root mod p. I am sa

[sage-devel] sqrt mod p

2007-11-09 Thread Steffen
Hi, I need to find square roots in GF(prime). I did it like this: y = sqrt(GF(prime)(ySquare)) So far I am not quite happy with the calculation periods and I would like to know which algorithm is used. In my case is prime % 4 == 1, which is the hardest case to find the square root mod p. I am sa

[sage-devel] Re: number_field_element coercion

2007-11-09 Thread William Stein
On Nov 8, 2007 9:52 PM, mabshoff <[EMAIL PROTECTED]> wrote: [...] > > Woah! Can someone explain to me the various calls above? I'd think > > this should take epsilon time to coerce the elements of the sequence. > > Or perhaps is there another better way to coerce into Z_F (or, > > equivalently f