Re: [sage-support] Re: XPPAUT and Sage
On Tuesday 15 June 2010 23:41, ma...@mendelu.cz wrote: > > Hello Jeff, yes, it looks like this on my PC > Thanks for letting me know. > > File -> Quit does not help? > Yes, it does. I tried the close button in the upper right corner of the window. That doesn't work. Jeff -- 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: XPPAUT and Sage
On 16 čvn, 04:29, Jeff Post wrote: > On Sunday 13 June 2010 03:04, Jose Guzman wrote: > > > > > Let me know the solution to the makefile problem, I am also interested > > in compiling from the sources, and found problems with the library Vector.o > > Attached are images of xppaut when it first starts, and after clicking the ok > button. Can someone verify that this is what should be expected? Hello Jeff, yes, it looks like this on my PC > > Before I proceed any further in trying to fix the build process for Linux, I'd > like to know that I'm going in the right direction. > > If anyone is willing to test the binary, let me know, but be forewarned the > dang thing will NOT terminate. You'll have to use the kill -9 command. (And File -> Quit does not help? Robert -- 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
Re: [sage-support] Re: XPPAUT and Sage
On Sunday 13 June 2010 03:04, Jose Guzman wrote: > > Hey Jeff, > > Let me know the solution to the makefile problem, I am also interested > in compiling from the sources, and found problems with the library Vector.o I've finally had some time to play around with this, and from what I see so far, not only the Makefile but the whole build process is hosed. Just goes to show once again that good mathematicians tend to be lousy programmers ;-) I've had some success, but there's still a way to go. If and when I get it working I'll post a tar.gz file with a single Makefile that will build the whole thing on Linux. Jeff -- 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] Minimal Quadratic Twist of Elliptic Curve over Q
When I take an elliptic curve out of Sage's table of elliptic curves and then try to use the minimal_quadratic_twist() function, Sage returns the original curve as the twist. Example: L=elliptic_curves.rank(0,n=1) E=L[0] Et, D=E.minimal_quadratic_twist() Result: E=Et, D=1 How do I ask Sage to give me a new curve? Corinne -- 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] preparser and from __future__ import problem
Hey Guys, I am new to Sage and Python. I have encountered a problem with importing form __future__. The commands that I execute work perfectly on a pure python environment but apparently there is some kind of problem introduced by the preparser. The problem is that I cannot "from __future__ import print_function" that is I cannot import the more up-to-date functionality of print as a function. The only workaround is turning the SAGE preparser temporarily off. An other secondary bug appears to be the fact that it is impossible to evaluate preparser(False) and from __future__ import command in the same cell while doing it in two separate cells works perfectly. This was a filed bug in some previous SAGE version (cannot find the relevant ticket in the trac) but although marked as closed apparently is still present. A notebook that fully explains the problem is published at: http://www.sagenb.org/home/pub/2155 Can you look into this and tell me if I should file a bug report. Or maybe somebody more expert can do this. Best Regards, Gennady N. Uraltsev Math Student Scuola Normale Superiore di Pisa. -- 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: Cube root
There's also the function nth_root: sage: a.nth_root(3, truncate_mode=True) (10, True) sage: b=256 sage: b.nth_root(3, truncate_mode=True) (6, False) The second return value tells you whether the number is a cube (or more general power), in which case the first value returns a root. So you could define your own is_cube function like this: sage: def is_cube(n): : return n.nth_root(3,True)[1] : sage: is_cube(1000) True sage: is_cube(100) False I have ignored complexity issues for simplicity! John Cremona On Jun 15, 11:24 am, William Stein wrote: > On Mon, Jun 14, 2010 at 11:17 PM, Dan Drake wrote: > > On Tue, 15 Jun 2010 at 10:58AM +0530, Santanu Sarkar wrote: > >> Is there any function by which we can decide a positive integer X, > >> is a perfect cube or not i.e., weather there is an integer Y such that > > >> Y^3=X? > > > There is probably a much better way, but you can get the exponents of > > the prime factorization and check if they're divisible by 3: > > That has complexity "issues", at least if X is large. > Better would be to factor the polynomial y^3 - x: > > sage: y = polygen(ZZ,'y') > sage: (y^3 - 27).roots() > [(3, 1)] > sage: len((y^3 - 27).roots()) > 0 > True > sage: len((y^3 - 997^3).roots()) > 0 > True > sage: len((y^3 - 997^3*17).roots()) > 0 > False > > At least this is polynomial time and trivial to implement. > > One can probably do better by just computing explicitly the cube root > of y to sufficiently large precision numerically, and checking if the > result is an integer, e.g., > > sage: s = numerical_approx(997^3, 500)^(1/3); (s-s.floor()) < 1e-100 > True > sage: s = numerical_approx(997^3*17, 500)^(1/3); (s-s.floor()) < 1e-100 > False > > > > > > > > > sage: x = 8 > > sage: list(x.factor()) > > [(2, 3)] > > sage: all(e % 3 == 0 for p, e in x.factor()) > > True > > sage: x = 10 > > sage: all(e % 3 == 0 for p, e in x.factor()) > > False > > > Dan > > > -- > > --- Dan Drake > > - http://mathsci.kaist.ac.kr/~drake > > --- > > > -BEGIN PGP SIGNATURE- > > Version: GnuPG v1.4.10 (GNU/Linux) > > > iEYEARECAAYFAkwXGxAACgkQr4V8SljC5Lo6VQCgjyyFYfreEhh9aDGVNl9RZ7Qc > > HYkAn2CUj31hydEYCJsF4mr7fGwrgvqW > > =DrmM > > -END PGP SIGNATURE- > > -- > William Stein > Professor of Mathematics > University of Washingtonhttp://wstein.org -- 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
Re: [sage-support] Warning messages when compiling 'lcalc'
Professor Stein, you are completely missing the point. Any serious attempt to check source code would include in a thorough check of what variables are used, their types, what they are used for, how they are used, what (if any) values they are initialized to. That would be true whether you were looking at your own code or that written by someone else. I can not possibly see how an author can check his/her code properly unless they have done that. Doing that, one would soon realize these problems. Neither can I understand how mathematical software than needs to be compiled by an end-user can be taken seriously unless there is a test suite. Lcalc lacks one. When someone can't be bothered to check their code, then why should I believe they have taken due care to implement the mathematics properly? They may be the best mathematician in the world, but I personally would not trust their ability to write high quality software. Of course, any non-trivial program is likely to have bugs, but the frequency of bugs could be reduced by careful testing - something that has clearly not been done in lcalc. I can see some of the source code from Mathematica in the form of .m files. The care that has been taken in writing them is clearly more than the care which was taken in writing lcalc. In principle with open-source code, it is possible for a user to check the code themselves. In practice, that is not likely to be the case, for all except the smallest of sections, especially when the code is poorly commented. I do not fully trust any program, but my confidence in Sage is decreasing as I look at code like lcalc and see some of the comments on public mailing lists. It's a shame, as I like using Sage, but after looking at some of the source code, in particular that of lcalc, my enthusiasm has decreased markedly. lcalc just happened to be the part that interested me, which is why I have looked at that in greater depth. Anne. On 8 June 2010 20:30, William Stein wrote: > On Tue, Jun 8, 2010 at 12:21 PM, Anne Driver > wrote: > > When building open-source software, it is not unusual to see a few > compiler > > warnings - usually deprecated code. There's quite a lot of them in Sage. > > > > But looking at lcalc, the code seems particularly poor, with lots of > unused > > variables & deprecated code. It does not exactly inspire confidence in > Sage. > > I don't know how it possible to check code core correctness under such > > circumstances. > > The person who wrote Lcalc is easily the world leader in algorithms > for numerical > computation of zeros of L-series of all types, and has done vastly > more along these > lines than anybody else. I would greatly prefer code with unused variables > from a person that understands the relevant mathematics, than the > other way around. > > > tmp_x is unused. I thought that would be defined in a C or C++ file, not > a > > header file. Lfind_zeros.h It's actually normal practice to have code in > C > > and C++ files, not header files. > > > > Functions are declared to return values, but do not do so. 'missing_data' > is > > unused. Is that since it's not needed, or because the author forget to > use > > it, so the code is unstable? > > Maybe you should ask the author... > > > There are reports of "deprecated or antiquated header which may be > removed > > without further notice at a future date". > > > > Unfortunately, lcalc was the part of Sage I intended using - now I think > I > > will look at other software. Hopefully some high quality open-source > > software. Parts of the code are quite well commented, but other parts > have > > few if any comments. This has rather put me off. > > Good luck. > > -- William > > > > > Anne > > > > -- > > 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 > > > > > > -- > William Stein > Professor of Mathematics > University of Washington > http://wstein.org > > -- > 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 > -- 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: interest in adaptive implicit plotter?
If you are interested in the 2d adjustable code, there is some documentation posted at this wiki page: http://www.norsemathology.org/wiki/index.php?title=Adjustable_Mesh_Plot At the bottom of the page is a link to download a Sage worksheet containing the code. 1. There is a need to change the code to subdivide when it finds the function - to give better resolution. Right now it just subdivides when the function values change quickly. We'll work on this. 2. Chris Fronk, the student who wrote the code, did a lot of testing. If we locate the test material I will post that as well. 3. The basic algorithm is there and works (except #1). We may need help to get it in the correct form for Sage. Don On Jun 14, 9:22 pm, Jason Grout wrote: > On 6/14/10 7:45 PM, Don K wrote: > > > > > Another idea is code that "follows the contour" using the gradient of > >> the function. > > > Years ago, Steve, my colleague, wrote up such an algorithm for > > Mathematica. I believe it was part of one on of the standard packages > > at that time. > > > But it sounds like if you/they already have code, so it probably would > >> be easiest to just convert it into the library function. > > > We have code for 2d implicit functions (it likely needs work). We > > want to implement for 3d implicit functions. > > Fantastic! It's likely that you and your colleague Steve know more > about this subject than I do. I'm excited to see what you guys have, > and learn from your code. > > Jason -- 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
Re: [sage-support] Cube root
On Mon, Jun 14, 2010 at 11:17 PM, Dan Drake wrote: > On Tue, 15 Jun 2010 at 10:58AM +0530, Santanu Sarkar wrote: >> Is there any function by which we can decide a positive integer X, >> is a perfect cube or not i.e., weather there is an integer Y such that >> >> Y^3=X? > > There is probably a much better way, but you can get the exponents of > the prime factorization and check if they're divisible by 3: That has complexity "issues", at least if X is large. Better would be to factor the polynomial y^3 - x: sage: y = polygen(ZZ,'y') sage: (y^3 - 27).roots() [(3, 1)] sage: len((y^3 - 27).roots()) > 0 True sage: len((y^3 - 997^3).roots()) > 0 True sage: len((y^3 - 997^3*17).roots()) > 0 False At least this is polynomial time and trivial to implement. One can probably do better by just computing explicitly the cube root of y to sufficiently large precision numerically, and checking if the result is an integer, e.g., sage: s = numerical_approx(997^3, 500)^(1/3); (s-s.floor()) < 1e-100 True sage: s = numerical_approx(997^3*17, 500)^(1/3); (s-s.floor()) < 1e-100 False > > sage: x = 8 > sage: list(x.factor()) > [(2, 3)] > sage: all(e % 3 == 0 for p, e in x.factor()) > True > sage: x = 10 > sage: all(e % 3 == 0 for p, e in x.factor()) > False > > > > Dan > > -- > --- Dan Drake > - http://mathsci.kaist.ac.kr/~drake > --- > > -BEGIN PGP SIGNATURE- > Version: GnuPG v1.4.10 (GNU/Linux) > > iEYEARECAAYFAkwXGxAACgkQr4V8SljC5Lo6VQCgjyyFYfreEhh9aDGVNl9RZ7Qc > HYkAn2CUj31hydEYCJsF4mr7fGwrgvqW > =DrmM > -END PGP SIGNATURE- > > -- William Stein Professor of Mathematics University of Washington http://wstein.org -- 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