[sage-devel] Re: How much do we support the casual user
I'm not entirely sure how to implement this though, if we don't want it to be the global behavior. I was considering just implementing it for the rank() function, but I'm assuming it processes the input into the function before it starts running the actual function, right? So it isn't just behavior I could set within the rank function. Would it be possible or desirable to make it so that matrix by scalar multiplication converts the scalar to an element of QQ? Or perhaps rank treats the entries of the matrix as members of QQ? The latter sounds best to me. Also, with regard to is_prime, would it be possible/easy change the default behavior of is_prime to try to convert the input to an integer if it is a member of QQ and raising an error if it is unable to convert the input to an integer, and give an option/keyword to not do this conversion? Perhaps if the conversion is succesful, a warning could be raised that the conversion was made, in case the user actually did want to check for primality over QQ. Though, Volker Braun's suggestion also sounds good, but I'm not sure how helpful it would be to a beginner if they don't know what a field is. I might suggest a warning which comes up if the user enters an element of QQ that is equivalent to an integer that tells them to run ZZ(x).is_prime() instead of (x).is_prime, if they to check primality over the integers. However, I'm not sure how elegant this solution is. On Tuesday, March 27, 2018 at 2:07:41 AM UTC-5, Ralf Stephan wrote: > > Hello, > I thought I'd try Sage for a casual computation. I was interested in which > numbers of the form (2^n - (-1)^n)/3 are prime. I first tried out n=23: > > sage: (2^23+1)/3 > 2796203 > sage: _.is_prime() > False > sage: factor(2796203) > 2796203 > > It turns out that Rational.is_prime does not exist and the fallback gives > false answers. > > Then, I tried to print a list of primes of the above form, using the > global is_prime: > > sage: for n in range(1,100): > : if is_prime((2^n - (-1)^n)/3): > : print((2^n - (-1)^n)/3) > : > sage: > > No output. Turns out `is_prime(ZZ((2^n - (-1)^n)/3))` works. Really? How > long does Sage exist without a fix to that? This goes beyond "serious lack > of reviewers" and "dev shortage". > > There was always the notion that you shouldn't "team up" for ticket > review. I'm now breaking it. If YOU are interested in fixing the above or > similar problems please mail me. There are also about 25 calculus tickets > from me waiting for review. But probably noone is really interested in that > either. The algebraists can have their Sage back. Good job. > -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at https://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.
[sage-devel] Re: How much do we support the casual user
The obvious answer: Show a warning if you test field elements for primality * easy to implement using standard Python machinery * does not introduce backward-incompatibile changes * is mathematically correct * informative to casual users * unlikely to give spurious warnings in existing code -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at https://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.
[sage-devel] Re: Compilation error sage-8.1
This looks like a gcc/gfortran problem. Could you post also logs/pkgs/config.log ? You might consider forcing building gcc, see SAGE_INSTALL_GCC in http://doc.sagemath.org/html/en/installation/source.html#environment-variables On Thursday, March 29, 2018 at 5:18:09 PM UTC+1, Paul Mercat wrote: > > Hello, > > I've tried to compile sage-8.1 on a linux server, and I get the following > error: > > Error building Sage. > > The following package(s) may have failed to build (not necessarily > during this run of 'make all'): > > * package: numpy-1.13.3.p0 > log file: /home/paul.mercat/sage-8.1/logs/pkgs/numpy-1.13.3.p0.log > build directory: > /home/paul.mercat/sage-8.1/local/var/tmp/sage/build/numpy-1.13.3.p0 > > The build directory may contain configuration files and other potentially > helpful information. WARNING: if you now run 'make' again, the build > directory will, by default, be deleted. Set the environment variable > SAGE_KEEP_BUILT_SPKGS to 'yes' to prevent this. > > make: *** [all] Error 1 > > How can I solve this problem ? > -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at https://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.
Re: [sage-devel] Re: How much do we support the casual user
On Thursday, March 29, 2018 at 11:57:32 AM UTC-7, William wrote: > > > Thanks -- I should have added that the above was a quick "proof of > concept". > > In fact, letting 1.3e5 still be parsed as a float literal would make this modified behaviour just extremely annoying rather than completely unworkable :-). -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at https://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.
Re: [sage-devel] Re: How much do we support the casual user
On Thu, Mar 29, 2018 at 11:56 AM, Nils Bruinwrote: > On Thursday, March 29, 2018 at 10:37:03 AM UTC-7, William wrote: >> >> >> It's surprisingly easy to implement this, due to how Robert Bradshaw >> rewrote this part of the Sage preparser.If you define this >> function in a notebook or command line sage session: >> >> def RealNumber(s): >> if '.' not in s: >> return QQ(s) >> a = s.split('.') >> return ZZ(a[0]) + ZZ(a[1])/10^len(a[1]) >> >> then all real number literals will be interpreted as exact rationals! >> > Cool! it does require slightly more complicated string mangling to work in > general, though: > > sage: 1.3e5 > TypeError: unable to convert '3e5' to a rational Thanks -- I should have added that the above was a quick "proof of concept". William -- William (http://wstein.org) -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at https://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.
Re: [sage-devel] Re: How much do we support the casual user
On Thursday, March 29, 2018 at 10:37:03 AM UTC-7, William wrote: > > > It's surprisingly easy to implement this, due to how Robert Bradshaw > rewrote this part of the Sage preparser.If you define this > function in a notebook or command line sage session: > > def RealNumber(s): > if '.' not in s: > return QQ(s) > a = s.split('.') > return ZZ(a[0]) + ZZ(a[1])/10^len(a[1]) > > then all real number literals will be interpreted as exact rationals! > > Cool! it does require slightly more complicated string mangling to work in general, though: sage: 1.3e5 TypeError: unable to convert '3e5' to a rational -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at https://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.
[sage-devel] streamline_plot raises NotImplementedError
I'm wondering if this is a known bug. I'm using Sagemath8.1 in Jupyter Notebook Consider the sequence: var("x,y,z,t") f(x,y)=sin(x*y) Df=f.gradient() The command plot_vector_field(Df,(x,0,1),(y,0,1)) produces a nice vector field, but the command streamline_plot(Df,(x,0,1),(y,0,1)) raises an NotImplementedError. This has to do with how f.gradient() is not recognized as a vector field. A workaround is to catch the exception and make make f.gradient() into a pair of expressions in x,y. def flowline_plot(vf,xRange,yRange,options={}): try: return streamline_plot(vf,xRange,yRange,**options) except NotImplementedError: return streamline_plot((vf[0](x,y),vf[1](x,y)),xRange,yRange,**options) -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at https://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.
Re: [sage-devel] Re: How much do we support optional packages.
On Tuesday, March 27, 2018 at 8:39:50 AM UTC-4, Erik Bray wrote: > > On Sun, Mar 25, 2018 at 4:49 PM, Simon King> wrote: > > Hi! > > > > On 2018-03-25, Volker Braun wrote: > >> On Sunday, March 25, 2018 at 2:51:46 PM UTC+2, Dima Pasechnik wrote: > >>> > >>> one can install autotools on archlinux systemwide > >>> > >> > >> Also, autotools aren't even required to build Sage. > >> > >> Whats the point of delaying a release for weeks/months to fix an > optional > >> package? Presumably you agree that broken standard packages should have > the > >> highest priority, so broken optional packages necessarily have a lower > >> priority. > > > > In my previous post I didn't understand that the actual point of this > > thread apparently is not "How much support are we supposed to provide > for > > optional packages?", but "Are optional packages important enough to > > constitute a blocker?". > > > > As a maintainer of a former optional package, I repeatedly found it > > annoying that the package got broken by changes in SageMath. It feels > > like EACH TIME I fix upstream to make it work with the latest Sage > version > > and open a ticket for upgrading the package, BEFORE THE REVIEW IS > FINISHED > > there will be yet another change in Sage that breaks the just-fixed > package > > yet again. For that reason, I lost the impetus at some point, and now > the > > package doesn't properly work since several years. > > > > Therefore I do believe that Sage development should treat optional > packages > > with more respect. > > I agree--I think there should be at least one buildbot run > per-platform--maybe not for every issue but at least run once a week, > that tests building all optional packages and running tests that use > them (i.e. tagged with # optional - ). > > A build with broken optional packages could then be considered a broken > build. > > We also tried to improve this by having "existing" optional packages tested by default in users' setups when sage -testall or whatever was run, but maybe that hasn't yielded the bevy of bug reports it should have.Yes, if an optional package fails on all reasonable platforms we/build creator has access to, that is a blocker. Simon has been remarkably patient regarding his package, by the way. -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at https://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.
Re: [sage-devel] Re: How much do we support the casual user
On Wed, Mar 28, 2018 at 11:01 PM, saad khalidwrote: > On Wednesday, March 28, 2018 at 1:52:17 AM UTC-5, Simon King wrote: >> >> Hi Andrey and Saad, >> >> On 2018-03-28, Andrey Novoseltsev wrote: >> > On Tuesday, 27 March 2018 18:03:48 UTC-6, saad khalid wrote: >> >> >> >> Why not assume by default that when someone enters a floating point >> >> number, they intend it as a member of QQ, at least in this case. >> >> >> > >> > It may be an interesting option to have similar to "automatic_names". >> >> +1 >> >> I certainly oppose for it being the default, as when I type in a float >> I *want* a float (actually an element of RR). >> >> Cheers, >> Simon >> > > Yes, I definitely agree with that. Do others also feel this would be > apropriate? How could we go about implementing this? It's surprisingly easy to implement this, due to how Robert Bradshaw rewrote this part of the Sage preparser.If you define this function in a notebook or command line sage session: def RealNumber(s): if '.' not in s: return QQ(s) a = s.split('.') return ZZ(a[0]) + ZZ(a[1])/10^len(a[1]) then all real number literals will be interpreted as exact rationals! sage: 3.45 69/20 sage: matrix(2, [1.5,2.5, 7, 8.333]) [ 3/2 5/2] [ 7 8333/1000] sage: 3.5*x^2 - x*1.23445 + 2/3 7/2*x^2 - 24689/2*x + 2/3 You can similarly change the interpretation of integer literals by defining "Integer". https://cocalc.com/share/4a5f0542-5873-4eed-a85c-a18c706e8bcd/support/2018-03-29-103001-RealNumber.ipynb?viewer=share > > -- > You received this message because you are subscribed to the Google Groups > "sage-devel" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to sage-devel+unsubscr...@googlegroups.com. > To post to this group, send email to sage-devel@googlegroups.com. > Visit this group at https://groups.google.com/group/sage-devel. > For more options, visit https://groups.google.com/d/optout. -- William (http://wstein.org) -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at https://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.
[sage-devel] Compilation error sage-8.1
Hello, I've tried to compile sage-8.1 on a linux server, and I get the following error: Error building Sage. The following package(s) may have failed to build (not necessarily during this run of 'make all'): * package: numpy-1.13.3.p0 log file: /home/paul.mercat/sage-8.1/logs/pkgs/numpy-1.13.3.p0.log build directory: /home/paul.mercat/sage-8.1/local/var/tmp/sage/build/numpy-1.13.3.p0 The build directory may contain configuration files and other potentially helpful information. WARNING: if you now run 'make' again, the build directory will, by default, be deleted. Set the environment variable SAGE_KEEP_BUILT_SPKGS to 'yes' to prevent this. make: *** [all] Error 1 How can I solve this problem ? -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at https://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout. Found local metadata for numpy-1.13.3.p0 Using cached file /home/paul.mercat/sage-8.1/upstream/numpy-1.13.3.zip numpy-1.13.3.p0 Setting up build directory for numpy-1.13.3.p0 Finished extraction Applying patches from ../patches... Applying ../patches/PEP_3141.patch patching file numpy/core/numeric.py Hunk #2 succeeded at 2155 with fuzz 2 (offset -7 lines). Applying ../patches/numpy-1.10.2-no-hardcode-blas.patch patching file numpy/distutils/system_info.py Hunk #1 succeeded at 1679 (offset -11 lines). Hunk #2 succeeded at 1712 (offset -10 lines). Host system: Linux signal.cmi.univ-mrs.fr 3.10.0-327.36.3.el7.x86_64 #1 SMP Mon Oct 24 16:09:20 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux C compiler: gcc C compiler version: Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.5/lto-wrapper Target: x86_64-redhat-linux Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-initfini-array --disable-libgcj --with-isl=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/cloog-install --enable-gnu-indirect-function --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux Thread model: posix gcc version 4.8.5 20150623 (Red Hat 4.8.5-4) (GCC) Running from numpy source directory. Note: if you need reliable uninstall behavior, then install with pip instead of using `setup.py install`: - `pip install .` (from a git repo or downloaded source release) - `pip install numpy` (last NumPy release on PyPi) blas_opt_info: blas_mkl_info: libraries mkl_rt not found in ['/home/paul.mercat/sage-8.1/local/lib', '/usr/local/lib64', '/usr/local/lib', '/usr/lib64', '/usr/lib', '/usr/lib/'] NOT AVAILABLE blis_info: libraries blis not found in ['/home/paul.mercat/sage-8.1/local/lib', '/usr/local/lib64', '/usr/local/lib', '/usr/lib64', '/usr/lib', '/usr/lib/'] NOT AVAILABLE openblas_info: Disabled openblas_info: (OPENBLAS is None) libraries openblas not found in [] NOT AVAILABLE atlas_3_10_blas_threads_info: Disabled atlas_3_10_blas_threads_info: (PTATLAS is None) libraries tatlas not found in [] NOT AVAILABLE atlas_3_10_blas_info: Disabled atlas_3_10_blas_info: (ATLAS is None) libraries satlas not found in [] NOT AVAILABLE atlas_blas_threads_info: Disabled atlas_blas_threads_info: (PTATLAS is None) libraries ptf77blas,ptcblas,atlas not found in [] NOT AVAILABLE atlas_blas_info: Disabled atlas_blas_info: (ATLAS is None) libraries f77blas,cblas,atlas not found in [] NOT AVAILABLE /home/paul.mercat/sage-8.1/local/var/tmp/sage/build/numpy-1.13.3.p0/src/numpy/distutils/system_info.py:572: UserWarning: Atlas (http://math-atlas.sourceforge.net/) libraries not found. Directories to search for the libraries can be specified in the numpy/distutils/site.cfg file (section [atlas]) or by setting the ATLAS environment variable. self.calc_info() blas_info: customize UnixCCompiler C compiler: gcc -DNDEBUG -g -fwrapv -O3 -Wall -D__CEPHES_COMPLEX_H -fPIC creating /tmp/tmpNjVWbB/tmp creating /tmp/tmpNjVWbB/tmp/tmpNjVWbB compile options:
Re: [sage-devel] Re: Graphical tool for matrix input
On Wednesday, March 28, 2018 at 9:20:17 AM UTC-4, Jeroen Demeyer wrote: > > On 2018-03-28 15:05, Simon King wrote: > > By "graphical", I really mean "interactively". > > It seems to me that those would be two different things: > > (1) A notebook widget for inputting matrices > > This already exists, at least for a given size mxn - and in Sage cell or CoCalc, one can dynamically allocate that: http://sagecell.sagemath.org/?z=eJxzyMwrSS1KTC7h5UpJTVOI18i1Nda04uVSAAIHhByIC5HPszWByWNRg1Dnq2CrkJtYUpRZoZGrk6eJrAcEijPyyzV8NQE0yR9W=sage @interact def _(m=3): @interact def _(n=4): @interact def _(M = matrix(m,n)): show(M) I nearly always make an interact to grade linear algebra exams for this reason. -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at https://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.
[sage-devel] Re: 8.2.rc0 - banner change ?
Thanks for reporting. This is handled by https://trac.sagemath.org/ticket/25056 Best wishes, Eric. -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at https://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.
[sage-devel] 8.2.rc0 - banner change ?
I just started 8.2.rc0 in a terminal and observed a change in the banner. Is this an expected behavior or something goes wrong ? confetti:sage dcoudert$ ./sage ┌┐ │ SageMath version 8.2.beta8, Release Date: 2018-03-10 │ │ Type "notebook()" for the browser-based notebook interface.│ │ Type "help()" for help.│ └┘ ┏┓ ┃ Warning: this is a prerelease version, and it may be unstable. ┃ ┗┛ sage: confetti:sage dcoudert$ ./sage SageMath version 8.2.rc0, Release Date: 2018-03-28 sage: -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at https://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.
[sage-devel] Re: How much do we support the casual user
On Wednesday, March 28, 2018 at 1:52:17 AM UTC-5, Simon King wrote: > > Hi Andrey and Saad, > > On 2018-03-28, Andrey Novoseltsev> wrote: > > On Tuesday, 27 March 2018 18:03:48 UTC-6, saad khalid wrote: > >> > >> Why not assume by default that when someone enters a floating point > >> number, they intend it as a member of QQ, at least in this case. > >> > > > > It may be an interesting option to have similar to "automatic_names". > > +1 > > I certainly oppose for it being the default, as when I type in a float > I *want* a float (actually an element of RR). > > Cheers, > Simon > > Yes, I definitely agree with that. Do others also feel this would be apropriate? How could we go about implementing this? -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at https://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.