Ask Your Question

Olivier R.'s profile - activity

2024-04-02 20:09:11 +0200 received badge  Nice Question (source)
2024-04-02 17:03:06 +0200 commented answer Dynamic documentation, how to use EXAMPLE:: tag?

Great, thanks! Olivier

2024-04-02 16:33:19 +0200 asked a question Dynamic documentation, how to use EXAMPLE:: tag?

Dynamic documentation, how to use EXAMPLE:: tag? Dear all, I'm writing the documentation of a package. A function des

2023-02-24 10:21:09 +0200 commented question Eigenvalues of an integral operators

Yes, G(F)(y). A basic answer consists in approximating the integral. Wiith Simpson's formula, this gives def GetEigenva

2023-02-24 09:49:35 +0200 commented question Eigenvalues of an integral operators

Yes, G(F)(y). A basic answer consists in approximating the integral. Wiith Simpson's formula, this gives def GetEigenva

2023-02-24 09:48:28 +0200 commented question Eigenvalues of an integral operators

Yes, G(F)(y). A basic answer consists in approximating the integral, and for instance, with Simpson's formula, this give

2023-02-24 09:46:44 +0200 commented question Eigenvalues of an integral operators

Yes, G(F)(y). A basic answer consists in approximating the integral, and for instance, with Simpson's formula, this give

2023-02-23 10:59:14 +0200 asked a question Eigenvalues of an integral operators

Eigenvalues of an integral operators Dear all, I want to find the first eigenvalues (and even the eigenvectors if pos

2022-10-23 05:31:05 +0200 received badge  Nice Question (source)
2022-09-22 09:26:22 +0200 commented answer Clipping a 2D plot

Many thanks for all that! I had misinterpreted the meaning of xmax, xmin, ymax, ymin family :/ Best, O.

2022-09-21 13:56:06 +0200 asked a question Clipping a 2D plot

Clipping a 2D plot Dear all, Best is a small example: ``` def fC(p): return([p[0]/(p[0]+2), (p[1]+1)/(p[0]+2)])

2022-02-07 00:33:22 +0200 received badge  Self-Learner (source)
2022-02-07 00:33:22 +0200 received badge  Teacher (source)
2022-02-07 00:11:37 +0200 answered a question max unevaled in plot??

Sorry for the noise, I'm seeing the light -- I should have written ``` def ff(b): return(max([b, 1-b])) show(plot

2022-02-06 23:57:58 +0200 asked a question max unevaled in plot??

max unevaled in plot?? Dear all, Here is a puzzling code: ``` var('a') show(plot(max([1-a, a]), (a,0,1))) show(plot

2020-08-31 23:40:43 +0200 commented answer Iteration over a Combinations(alist, 5).list()

Oh, merci (que je me sens cruche :) ! Mais soulagé !)

2020-08-30 15:52:38 +0200 asked a question Iteration over a Combinations(alist, 5).list()

Dear all,

I have a big set built as : Combinations([1,2,3,4,5,6,7], 5).list() through which I need to iterate. In real life, the list [1,2,3,4,5,6,7] has 72 components. I don't need this set of combinations, only to iterate through it. I did not find the proper way to do that with the combinat package, but I have the feeling I overlooked something.

Many thanks if you have infos on this issue!

Best, O.

2020-08-02 18:40:17 +0200 commented answer Timing : are hurwitz_zeta values cached?

Thanks for the syntax in Arb to get the Hurwitz-zeta!

2020-08-02 18:37:53 +0200 received badge  Autobiographer
2020-08-02 12:50:38 +0200 asked a question Timing : are hurwitz_zeta values cached?

Dear all, It seems the values of hurwitz_zeta are cached in some way. This makes sense, but I couldn't find documentation on that issue, and in particular, on how to clear the cache: I want to time several instances of a script and need to start afresh each time. Here is an ECM:

import sys
from timeit import default_timer as timer
def ECM(prec):
    start, CF = timer(), ComplexField(prec)
    hurwitz_zeta(s = CF(2), x = CF(0.5)) 
    end = timer()    
return end-start

for i in range(0,20):
    ECM(3000)

0.10533331300030113
0.011018371998943621
0.011091479000242543
0.0118424979991687
etc...

Then start afresh, get a similar answer. I am pretty sure this system-caching mechanism is explained somewhere but my morning queries drew a blank --

Pointers would be appreciated! Best, Olivier

2020-08-02 00:12:42 +0200 asked a question change_ring for DirichletGroup: some initialisation is required for ComplexIntervalField?

Dear all,

A code will better explain my predicament:

myCIF = ComplexIntervalField( 200 )                                                                   
myD = DirichletGroup(5)                                                                               
myDCIF = myD.change_ring(myCIF)                                                                           
[e.values() for e in myDCIF] 
--> NotImplementedError followed by lots of shouting involving in particular 'cachefunc.pyx'

Then do it a second time:

[e.values() for e in myDCIF] 
--> Good result!

The mystery gets more mysterious if one tries it with 'ComplexField' rather than with 'ComplexIntervalField': everything goes smoothly. Here is thus my way out:

myCF =  ComplexField( 200 + 1)
myCIF = ComplexIntervalField( 200 )                                                                   
myD = DirichletGroup(5)                                                                               
myDCF = myD.change_ring(myCF)                                                                           
[[myCIF(v) for v in e.values()] for e in myDCF]

Maybe there is something simple I didn't get that would avoid the above manipulation?

Many thanks in advance! Olivier

2020-07-31 12:47:54 +0200 commented answer Complex roots of non-squarefree real polynomial

Oups, many thanks, 'p.roots()' works like a charm! I guess 'complex_roots(p)' must be kept for more specific usage. Best, O.

2020-07-31 09:34:25 +0200 asked a question Complex roots of non-squarefree real polynomial

Dear all, I need in my script the maximum of the absolute value of the roots of a polynomial. I don't know the polynomial the user will introduce, so it may well be non squarefree and with non-integer coefficients. Here is something that baffled me for some time:

x = var('x')
R0X = PolynomialRing(RealField(40), x) 
P0 = 1 + 2*x + x ^2
P  = R0X( P0)
complex_roots(P)
--> ok, good result
P0 = 1-2*x-7*x^2-4*x^3 # -4 * (x-1/4) * (x + 1)^2
P  = R0X( P0)
complex_roots(P)
--> waiting, waiting ....

The mystery is not so hard to pierce, I think:

 P.squarefree_decomposition()                                                                                                  
 sage: -4.0000*x^3 - 7.0000*x^2 - 2.0000*x + 1.0000

But then, I still have my initial problem! I can use some apriori bound for these roots. I'm still unhappy of not being able to get a better numerical approximation --

Many thanks for your lights! Olivier

2020-07-19 16:06:48 +0200 commented answer Spline interpolation varies hugely when variables are rescaled in 3d-lists ?

Ok, now I understand that aspect_ratio modifies only the rendering and has no effect on the datas produced.

I also tried adding

C = ComplexField(200)

and replacing

zeta(fx(x/nx) + I*fy(y/ny))

by

C(zeta(fx(x/nx) + I*fy(y/ny)))

with the same output.

2020-07-12 11:56:35 +0200 received badge  Nice Question (source)
2020-07-12 01:52:41 +0200 received badge  Student (source)
2020-07-11 15:06:35 +0200 received badge  Editor (source)
2020-07-11 15:05:32 +0200 asked a question Spline interpolation varies hugely when variables are rescaled in 3d-lists ?

Dear all,

Here is a short script:


(nbx, nby) = (74, 90)

def fx(x):
    return (0.5 + x/2.5)

def fy(y):
    return (40*y)

zetaPlot = list_plot3d([(30 * (fx(x/nbx)-1/2)+1/2 ,  fy(y/nby), 5 * abs(zeta(fx(x/nbx) + I*fy(y/nby)))) 

                        for x in range(-nbx, nbx+1) for y in range(-nby, nby+1)], 

                        interpolation_type = 'spline')

zetaPlot.show()

Now modify the z-coordinate: replace "5 * abs(zeta...)" by "abs(zeta...)" The resulting graph is essentially flat. Can anyone tell me what is happening there? Also, I would like to get rid of my scaling parameters 30 and 5 by using frame_aspect_ratio, to get cleaner code and a better annoted frame, but I don't seem to understand how to do it.

A great many thanks for anyone who would take the time to teach me that, it is some hours that I'm struggling with some docs and examples without having reached much --

Best, Olivier

2019-08-07 14:05:06 +0200 asked a question unable to simplify to a complex interval approximation

Dear all,

Once simplified, here is the problem. This is something that goes smoothly with Sage 8.6 and not with Sage 8.1. It turns out that Sage 8.1 is the one bundled with Ubuntu 18.04 LTS so I'm interested in solving this issue. I'm also interested in this question in itself. Here it is:

C = ComplexIntervalField(200)

C(-psi(1/3))

That work's just fine in Sage 8.6 but Sage 8.1 answers:

TypeError: unable to simplify to a complex interval approximation

Of course C(psi(1/3)) works just fine. Many thanks in advance