[sage-support] Re: Does the digits method have an inverse?

2008-10-22 Thread John Cremona
2008/10/22 Timothy Clemans [EMAIL PROTECTED]: def from_digits(lis): return ZZ(''.join([str(i) for i in lis[::-1]])) Or even sage: n = 150 sage: dig = n.digits() sage: PolynomialRing(ZZ,'x')(dig)(2) 150 but I agree that this should be a provided function. NB trac ticket #2796 may soon

[sage-support] Re: multiply a list by a constant

2008-10-22 Thread Robert Bradshaw
On Oct 21, 2008, at 10:17 PM, pong wrote: Thanks to both Dan and William. However, Dan's result puzzled me. Aren't they suggested that the for loop is faster? Here is what I got: sage: timeit('list(2*vector([random() for j in range(10)]))') 625 loops, best of 3: 332 µs per loop sage:

[sage-support] Is interact partly broken in 3.1.4 (or before)?

2008-10-22 Thread kcrisman
In 3.1.4 and 3.2.alpha0 I get very weird behavior in @interact. First, when a worksheet opens up, there is the usual long and annoying automatic evaluation of the @interact cells (which I feel is not a feature, though perhaps not a bug... but I couldn't find where this was mentioned before in

[sage-support] Re: Is interact partly broken in 3.1.4 (or before)?

2008-10-22 Thread William Stein
On Wed, Oct 22, 2008 at 12:58 PM, kcrisman [EMAIL PROTECTED] wrote: In 3.1.4 and 3.2.alpha0 I get very weird behavior in @interact. First, when a worksheet opens up, there is the usual long and annoying automatic evaluation of the @interact cells (which I feel is not a feature, though

[sage-support] Odd behavior of gradient()

2008-10-22 Thread Jim Clark
The reference manual shows the following example for the gradient() function: sage: x,y = var('x y') sage: f = x^2+y^2 sage: f.gradient() (2*x, 2*y) However, if instead I enter: sage: x,y,n = var('x y n') sage: f = x^n+y^n sage: f.gradient() (y^n*log(y) + x^n*log(x), n*x^(n - 1), n*y^(n -

[sage-support] Re: Odd behavior of gradient()

2008-10-22 Thread Jason Grout
Jim Clark wrote: The reference manual shows the following example for the gradient() function: sage: x,y = var('x y') sage: f = x^2+y^2 sage: f.gradient() (2*x, 2*y) However, if instead I enter: sage: x,y,n = var('x y n') sage: f = x^n+y^n sage: f.gradient() (y^n*log(y) +

[sage-support] Re: Odd behavior of gradient()

2008-10-22 Thread Jason Grout
Jason Grout wrote: Jim Clark wrote: The reference manual shows the following example for the gradient() function: sage: x,y = var('x y') sage: f = x^2+y^2 sage: f.gradient() (2*x, 2*y) However, if instead I enter: sage: x,y,n = var('x y n') sage: f = x^n+y^n sage: f.gradient()

[sage-support] Re: Is interact partly broken in 3.1.4 (or before)?

2008-10-22 Thread kcrisman
The automatic evaluation of all @interact cells is a feature. Do you wish that this did not occur, and that users had to explicitly hit shift-enter (or click some button) to fire up any interact? It would be easy to change the implementation to have that behavior (in fact, that would be a

[sage-support] Re: Odd behavior of gradient()

2008-10-22 Thread Jim Clark
On Oct 22, 2008, at 5:28 PM, Jason Grout wrote: I've posted a patch to http://trac.sagemath.org/sage_trac/ticket/4343 Can you apply the patch and test it out? Here is the new behavior: sage: f(x,y) = x^n+y^n sage: f.gradient() ((x, y) |-- n*x^(n

[sage-support] Re: Odd behavior of gradient()

2008-10-22 Thread Jason Grout
Jim Clark wrote: On Oct 22, 2008, at 5:28 PM, Jason Grout wrote: I've posted a patch to http://trac.sagemath.org/sage_trac/ticket/4343 Can you apply the patch and test it out? Here is the new behavior: sage: f(x,y) = x^n+y^n sage: f.gradient()

[sage-support] Re: Odd behavior of gradient()

2008-10-22 Thread William Stein
On Wed, Oct 22, 2008 at 7:17 PM, Jason Grout [EMAIL PROTECTED] wrote: Jim Clark wrote: On Oct 22, 2008, at 5:28 PM, Jason Grout wrote: I've posted a patch to http://trac.sagemath.org/sage_trac/ticket/4343 Can you apply the patch and test it out? Here is the new behavior:

[sage-support] Re: Is interact partly broken in 3.1.4 (or before)?

2008-10-22 Thread Marshall Hampton
I have noticed similar things as well; sometimes I have to reload to get interact cells to appear correctly. The automatic evaluation of interact cells bothers me; I think it would be better if this was changed. Is it not enough to use #auto? - William's comments suggest things are more

[sage-support] Re: Is interact partly broken in 3.1.4 (or before)?

2008-10-22 Thread Jason Grout
Marshall Hampton wrote: I have noticed similar things as well; sometimes I have to reload to get interact cells to appear correctly. The automatic evaluation of interact cells bothers me; I think it would be better if this was changed. Is it not enough to use #auto? - William's comments

[sage-support] RQ / QR Decomposition for General Rings

2008-10-22 Thread salmanhb
Hi, I need to do an RQ decomposition (though QR would be a start) for a matrix with entries in Laurent series ring over a finite field. A matrix over ZZ and other special rings could be sent to SciPy to do the decomposition, but Laurent series aren't quite so amenable. If anyone has some good