[sage-support] sage build failing on 9.2beta7, failure during make
On my develop branch for sage, whenever I attempt to build with ``sage -br``, I get the following error message: make: *** No rule to make target `sagelib-no-deps'. Stop. What could be the cause of this issue? It happened all of the sudden after I made a new local branch. This is on Sage 9.2.beta7. My specs are macOS Catalina 10.15.3 with an i7 cpu. -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sage-support/ce65b3c0-fd8b-4ed6-9aad-f6eabd60d7c3n%40googlegroups.com.
Re: [sage-support] Re: Homomorphism from power series ring to residue field
Thank you, luisfe, for this detailed reply! Of course it would be formally nice to have the map lambda x: x.map_coefficients(phi) be an actual sage homomorphism (which it will always be if phi is a homomorphism of coefficient rings). But for now what you propose works fine for me. -- You received this message because you are subscribed to the Google Groups sage-support group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at http://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.
[sage-support] Re: using cell server with moodle (problem with script balise)
I'm running into the same problem with Wordpress. When I switch their TinyMCE editor between Text and Visual modes, it will add in those tags. My solution is to edit only in Text mode (the Sage boxes are invisible anyway in Visual mode, which is complicating things). See http://matroidunion.org/?p=301 . Incidentally, there seem to be some issues with the new maximize button that appeared today. Sometimes after clicking it, I have several maximize buttons in view. Anyway, back to the topic. If moodle has a text-mode editor, then that might be your best bet. I just tried Jason's suggestion for only using the CDATA thing directly, but switching to Visual made TinyMCE eat up my entire code. When trying to preview, the closing tag ]] was visible as a line of Sage code. It'd be nice if the cell server got an option to ignore the // ![CDATA[ and // ]] bits… Another issue I'm having is that Wordpress will convert empty lines into a /pp pair. But that seems to be beyond the control of the Cell Server. I think we need a proper Wordpress plugin to get everything working flawlessly. Cheers, Stefan. -- You received this message because you are subscribed to the Google Groups sage-support group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at http://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/groups/opt_out.
[sage-support] Re: Convolution Polynomial Ring
On Thursday, August 22, 2013 4:06:22 PM UTC-4, Santanu wrote: How to define polynomial ring like Z[x]/(x^10-1) Z_5[x]/(x^10-1) in Sage? sage: R1.a = PolynomialRing(ZZ) sage: R.x = R1.quotient(a^10 - 1) sage: R2.b = PolynomialRing(GF(5)) sage: S.y = R2.quotient(b^10 - 1) Now you can do: sage: x^12 x^2 sage: y^14 + 7 * y y^4 + 2*y -- You received this message because you are subscribed to the Google Groups sage-support group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at http://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/groups/opt_out.
[sage-support] Re: My installation doesn't see matroids.all
Can you give some more info on what you did? Which commands did you issue? Which patches did you install? Did you rebuild Sage after installing them? Which Sage version? Does your Sage have the matroids and Matroid keywords on startup? --Stefan. On Thursday, June 20, 2013 10:28:29 AM UTC-4, Smitty Horne wrote: I have installed the Sage program and, as far as I can tell, installed the matroids portion (including patches). But when I try to run the command 'from sage.matroids.all import *', I get an error that says No module named matroids.all. Do any of you have an idea on what I am missing? Thank you very much. -- You received this message because you are subscribed to the Google Groups sage-support group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at http://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/groups/opt_out.
[sage-support] Re: My installation doesn't see matroids.all
The command I used which caused the error was from sage.matroids.all import *. I added the matroids (I think this one worked) by using 'sage -hg clone https://bitbucket.org/matroid/sage_matroids' and '../sage setup.py install' from the shell prompt, but got the following errors on the second command: Error compiling Cython file: ... versionB = 0 size = 0 limbs = 0 longsize = 0 for i from 0 = i self.nrows(): versionB, size, limbs, longsize, data = bitset_pickle(self._M[i]) ^ These errors are because we moved some code out of our codebase and directly into Sage. I think this is the easiest way to get matroids to work right now: 0) From a terminal shell, run /path/to/sage -clone mymatroid (this will ensure the main branch of sage stays untouched, see http://www.sagemath.org/doc/developer/walk_through.html#creating-a-sandbox ) 1) Download the .patch files from each of the following pages: http://trac.sagemath.org/sage_trac/ticket/14668 http://trac.sagemath.org/sage_trac/ticket/7477 (only the two mentioned in the description). 2) Start Sage from the directory to which you saved the patches, and issue these commands: sage: hg_sage.apply(trac_14668_bitsets.patch) sage: hg_sage.apply(trac_7477_setup_doc_load.patch) sage: hg_sage.apply(trac_7477_code.patch) Watch for any errors. 3) Quit Sage, run /path/to/sage -b 4) Enjoy! -- You received this message because you are subscribed to the Google Groups sage-support group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at http://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/groups/opt_out.
[sage-support] Re: My installation doesn't see matroids.all
On Thursday, June 20, 2013 11:42:10 AM UTC-4, Smitty Horne wrote: On Thursday, June 20, 2013 9:28:29 AM UTC-5, Smitty Horne wrote: I have installed the Sage program and, as far as I can tell, installed the matroids portion (including patches). But when I try to run the command 'from sage.matroids.all import *', I get an error that says No module named matroids.all. Do any of you have an idea on what I am missing? Thank you very much. I got to the step of applying the patches and got the following error when I attempted to run hg_sage.apply(trac_14668_bitsets.patch) from the sage prompt: syntax error near unexpected token `trac_14668_bitsets.patch' That's weird, it looks like a Bash shell error. You are running Sage when entering those commands, right? Can you show what (if anything) is posted before the error? Should be something like cd /Users/stefan/sage-5.11.beta1/devel/sage sage --hg import /Users/stefan/Documents/coding/sage_matroids/trac_14668_bitsets.patch applying /Users/stefan/Documents/coding/sage_matroids/trac_14668_bitsets. patch -- You received this message because you are subscribed to the Google Groups sage-support group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at http://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/groups/opt_out.
[sage-support] Re: My installation doesn't see matroids.all
You're not running sage. Start Sage first, then from the prompt looking like sage: issue those commands. See also http://www.sagemath.org/doc/developer/walk_through.html#reviewing-a-patch --Stefan. On Thursday, June 20, 2013 11:56:09 AM UTC-4, Smitty Horne wrote: On Thursday, June 20, 2013 9:28:29 AM UTC-5, Smitty Horne wrote: I have installed the Sage program and, as far as I can tell, installed the matroids portion (including patches). But when I try to run the command 'from sage.matroids.all import *', I get an error that says No module named matroids.all. Do any of you have an idea on what I am missing? Thank you very much. Yes, I think it is a bash shell error. Actually nothing happens at all. Here is what I see: Smittys-MacBook-Pro:sage swood$ hg_sage.apply(trac_14668_bitsets.patch -bash: syntax error near unexpected token `trac_14668_bitsets.patch' Since you didn't say which directory should hold the patches, I just put them in the main directory off Applications; i.e., sage. Could that be part of the problem? Thanks. -- You received this message because you are subscribed to the Google Groups sage-support group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at http://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/groups/opt_out.
[sage-support] Re: My installation doesn't see matroids.all
Try ./sage -b otherwise I'm out of my depth. You can (should be able to) go back to the original revision with ./sage -b main --Stefan. On Thursday, June 20, 2013 12:10:37 PM UTC-4, Smitty Horne wrote: On Thursday, June 20, 2013 9:28:29 AM UTC-5, Smitty Horne wrote: I have installed the Sage program and, as far as I can tell, installed the matroids portion (including patches). But when I try to run the command 'from sage.matroids.all import *', I get an error that says No module named matroids.all. Do any of you have an idea on what I am missing? Thank you very much. Unfortunately, now my sage won't run... I am getting the following error: FYI it was running previously before I ran the -clone mymatroid command. Smittys-MacBook-Pro:sage swood$ ./sage -- | Sage Version 5.9, Release Date: 2013-04-30 | | Type notebook() for the browser-based notebook interface.| | Type help() for help.| -- Traceback (most recent call last): File /Applications/sage/local/bin/sage-ipython, line 6, in module from sage.misc.interpreter import SageTerminalApp File /Applications/sage/local/lib/python2.7/site-packages/sage/misc/interpreter.py, line 67, in module import os, log, re, new, sys File /Applications/sage/local/lib/python2.7/site-packages/sage/misc/log.py, line 65, in module import latex File /Applications/sage/local/lib/python2.7/site-packages/sage/misc/latex.py, line 60, in module from sage.misc.cachefunc import cached_function, cached_method ImportError: dlopen(/Applications/sage/local/lib/python2.7/site-packages/sage/misc/cachefunc.so, 2): Library not loaded: libcsage.dylib Referenced from: /Applications/sage/local/lib/python2.7/site-packages/sage/misc/cachefunc.so Reason: image not found Error in atexit._run_exitfuncs: Traceback (most recent call last): File /Applications/sage/local/lib/python/atexit.py, line 24, in _run_exitfuncs func(*targs, **kargs) File /Applications/sage/local/lib/python2.7/site-packages/sage/misc/temporary_file.py, line 51, in delete_tmpfiles from sage.misc.misc import SAGE_TMP File /Applications/sage/local/lib/python2.7/site-packages/sage/misc/misc.py, line 39, in module import sage.misc.prandom as random File /Applications/sage/local/lib/python2.7/site-packages/sage/misc/prandom.py, line 58, in module from sage.misc.randstate import current_randstate ImportError: dlopen(/Applications/sage/local/lib/python2.7/site-packages/sage/misc/randstate.so, 2): Library not loaded: libcsage.dylib Referenced from: /Applications/sage/local/lib/python2.7/site-packages/sage/misc/randstate.so Reason: image not found Error in sys.exitfunc: Traceback (most recent call last): File /Applications/sage/local/lib/python/atexit.py, line 24, in _run_exitfuncs func(*targs, **kargs) File /Applications/sage/local/lib/python2.7/site-packages/sage/misc/temporary_file.py, line 51, in delete_tmpfiles from sage.misc.misc import SAGE_TMP File /Applications/sage/local/lib/python2.7/site-packages/sage/misc/misc.py, line 39, in module import sage.misc.prandom as random File /Applications/sage/local/lib/python2.7/site-packages/sage/misc/prandom.py, line 58, in module from sage.misc.randstate import current_randstate ImportError: dlopen(/Applications/sage/local/lib/python2.7/site-packages/sage/misc/randstate.so, 2): Library not loaded: libcsage.dylib Referenced from: /Applications/sage/local/lib/python2.7/site-packages/sage/misc/randstate.so Reason: image not found -- You received this message because you are subscribed to the Google Groups sage-support group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at http://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/groups/opt_out.
[sage-support] Fwd: Memory
Dear all, Gordon Royle has the following issue. Any ideas? --Stefan van Zwam. Begin forwarded message: Subject: [sage-matroid] Memory Date: April 22, 2013 2:24:05 AM EDT To: sage-matr...@googlegroups.com Reply-To: sage-matr...@googlegroups.com I'm trying to work with some collections of graphs and matroids, but I can't seem to keep the memory usage under control... For example, I have a test file containing 10 multigraphs that I want to import into sage and then process. gs = [] gs.append(Graph([(0,1,0),(0,1,1),(0,1,2),(0,1,3),(2,3,4),(2,3,5),(2,3,6),(4,5,7),(4,5,8),(4,5,9),(0,1,10),(0,1,11),(0,1,12),(0,1,13),(0,1,14)])) gs.append(Graph([(0,1,0),(0,1,1),(0,1,2),(0,1,3),(2,3,4),(2,3,5),(2,3,6),(4,5,7),(4,5,8),(4,5,9),(0,1,10),(0,1,11),(0,1,12),(0,1,13),(0,2,14)])) and another 8 lines of the same length. The entire file occupies 14Mb of disk space. When I run it through sage, the memory usage of the python2.7 process fluctuates dramatically from the 140Mb of the just started sage, up to over 4Gb before finally settling at 950Mb when the file is fully imported. So somehow, my 14Mb file has blown out to over 800Mb when imported into Sage Given that this file is just a sample for my REAL file which has 4.2 million graphs, I just can't see how to proceed. -- --- You received this message because you are subscribed to the Google Groups sage-matroid group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-matroid+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups sage-support group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at http://groups.google.com/group/sage-support?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
[sage-support] Running Sage notebook outside a servers root directory
Hello everyone, I compiled and installed Sage 5.2 on my homeserver which worked fine and so the commandline version did. Then I tried to make sage available fom the Internet with notebook(). I found some instructions about configuring apache, so access to Sage is carried through an internal proxy, which worked partly fine. Sage IS accessible - I can see the login screen, but the webpage has nothing like CSS or Images and I cannot login, because he tries to look up everything in the root directory of my Webserver. In this case by root directory i mean the kind of root directory you can access on a webpage not the servers root directory. I configured once the virtual host so the documentroot was the directory, sage should be mapped on and the CSS and the Images were found. How can I make Sage accessible on the Internet within a non root directory like http://example.com/sagemath/ without creating a virtual host on a different port or using another Domain? Is there any way of adjusting the (absolute) directory with a single variable somewehere hid in the sourcecode? Some more Information: I'm running Ubuntu Server Sage itself is located in /opt/sagemath which is NOT Apaches Document Root Thanks in advance, I hope someone can help me out. Kind regards -- You received this message because you are subscribed to the Google Groups sage-support group. 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. Visit this group at http://groups.google.com/group/sage-support?hl=en.
[sage-support] Permutation on different domain
Dear all, I can write sage: G = PermutationGroup([('a', 'b'), ('c', 'd')]) but not sage: P = Permutation([('a', 'b'), ('c', 'd')]) nor sage: P = PermutationGroupElement([('a', 'b'), ('c', 'd')]) What is the nicest way to create this permutation in one line, other than going for a Sage dictionary? Also, is there any reason the above constructions don't work, or are they simply not implemented yet? Cheers, Stefan. -- 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: BKZ method: two different outcomes?
Like most lattice basis reduction algorithms, Block Korkin-Zolotarev reduction is not unique, not even in the case of one block: the first vector is a shortest vector in the lattice, the second vector corresponds to a shortest vector in the lattice after projecting onto the orthogonal complement of the first, and so on. If you choose a different shortest vector in the various stages, you end up with a different outcome since the algorithm may select a different shortest vector. -- 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] plot3d and expression evaluation
Hello group, I have encountered a somewhat strange problem in plotting a simple function. It seems to be related to the issues described in the tutorial section Some Common Issues with Functions, but the lambda- function trick does not work here. I have uploaded a worksheet with what I have been trying so far here: http://www.sagenb.org/home/steja/1/ Basically, I am trying to plot this expression: #sage fermi(x,y,d,L) = 1 - 1/( exp( ( max(abs(x),abs(y))-L) /d) + 1) as a function of (x,y) for some different values of d and L (nothing too useful, I invented it as a toy project to get familiar with Sage). I tried the following commands, but none of them works: #sage plot3d(lambda x,y: fermi(x,y,0.2,1),(x,-2,2),(y,-2,2)) #sage def plfermi(x,y): return fermi(x,y,0.2,1) #sage plot3d(plfermi,(-2,2),(-2,2)) Both of these commands do plot something, but the result is wrong. I also tried this: #sage pf(x,y) = fermi(x,y,0.2,1.0) #sage plot(pf,(-2,2),(-2,2)) Here, the result is an error message (which looks like Klingon language to me). Could somebody send some light down my way? I am almost dying to get rid of Mathematica in favor of an open source CAS (because of their #*! § license that always seems to fail when one desperately needs it), but I'm afraid I've still got a long way to go with Sage when I'm not even able to plot a simple function... -- 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: plot3d and expression evaluation
On Mar 12, 5:47 pm, Harald Schilly harald.schi...@gmail.com wrote: I'm not sure but there might be a bug or problem evaluating the expression. Anyways, going the pure python way works: sage: def fermi(x,y,d,L): return 1 - 1/( exp( ( max(abs(x),abs(y))- L) /d) + 1) sage: plot3d(lambda x,y : fermi(x,y,0.2,1), (x,-2,2), (y,-2,2)) Does this look fine? Yes, the pure python way works. But defining the function that way, I loose the ability to perform symbolic manipulations with it, don't I? -- 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: plot3d and expression evaluation
I think I've got a vague idea what happens here... The same thing also happens when I define the max() function myself: sage: def my_max(x,y): sage: if(xy): return x sage: else: return y sage: fermi2(x,y,d,L) = 1 - 1/( exp( ( my_max(abs(x),abs(y))-L) /d) + 1) sage: fermi2 (x, y, d, L) |-- -1/(e^(-(L - abs(y))/d) + 1) + 1 This looks a bit like max(x,y) gets passed the the objects 'abs(x)' and 'abs(y)' and decides, for whatever reason, that 'abs(x)' is not greater than 'abs(y)', so the else-clause gets executed and we are left with abs(y). Does this make sense to you? (I'm just thinking aloud, I got no idea how sage actually does it) Most likely the internal max function is defined in rather the same way (it just returns abs(x) instead of abs(y). ) The bottom line seems to be that it is a very dangerous game to mix symbolic expressions and python functions. Is there some way to control when (and how) Sage evaluates expressions and invokes python functions? Something like saying first evaluate abs(x) and abs(y) and then invoke the python function max() with the result of the evaluation? On Mar 12, 5:49 pm, Harald Schilly harald.schi...@gmail.com wrote: Ah, I got it, the max function is evaluated during the definition of the function, look: sage: fermi(x,y,d,L) = 1 - 1/( exp( ( max(abs(x),abs(y))-L) /d) + 1) sage: fermi (x, y, d, L) |-- -1/(e^(-(L - abs(x))/d) + 1) + 1 especially: sage: max(abs(x),abs(y)) abs(x) There is no y any more! H -- 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] associated_primes broken with term order invlex
Hello, since I changed to version 4.3.2 it seems that calling associated_primes() on an ideal of a polynomial ring that has term order 'invlex' is broken. Example: sage: R.x,y=PolynomialRing(QQ,2,order='invlex') sage: R.ideal(x).associated_primes() ? // Not implemented for this ordering, please change to global ordering. ? leaving primdec.lib::primdecSY Traceback (click to the left of this block for traceback) ... RuntimeError It used to work fine with prior versions. Is this an intended change? Also, it seems that this leaves the spawned singular process in a broken state as all subsequent ideal operations (e.g. simple membership tests) will fail until the worksheet is restarted. Stefan -- 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: Profiling code in Sage
Ah! Running cp.run('Problem3A()') did the job. Nevermind! On Feb 1, 9:07 pm, Stefan stefan.louis.no...@gmail.com wrote: Hi guys, After searching through the newsgroup for any posts on profiling code in Sage, I thought I'd make a post asking about what possible methods are available. (I did come across a post that utilized 'prun', but I couldn't figure out how to get it to work.) Anyway, after running the code: import cProfile as cp cp.run('Problem3A') Where Problem3A is a function that was previously defined, the result is: 2 function calls in 0.000 CPU seconds Ordered by: standard name ncalls tottime percall cumtime percall filename:lineno (function) 1 0.000 0.000 0.000 0.000 string:1(module) 1 0.000 0.000 0.000 0.000 {method 'disable' of '_lsprof.Profiler' objects} (This was done on the Sagenb.org site) Can anyone point me in the right direction for profiling a Python function in Sage? -- 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] cancellation in fraction fields
Hi, I'm working with fraction fields of multivariate polynomials ring with coefficients in Q. My question is, how do I get cancellation between numerator and denominator coefficients to work? Example: R.x,y=PolynomialRing(QQ, 2) F=FractionField(R) f=(x/2)/(y/2) My question is, how do I get the representation of f to simplify to x/y? The reduce method doesn't do it. Stefan -- 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: cancellation in fraction fields
That sort of gets my expressions nicer. It doesn't quite solve the issue with the computation time but works for now. Would it be too difficult to have such fractions normalized automatically to some normal form, e.g. monic denominator polynomial, if the coefficient ring is a field? Thanks, Stefan Am 24.01.2010 um 17:51 schrieb William Stein: On Sun, Jan 24, 2010 at 3:45 PM, Yann yannlaiglecha...@gmail.com wrote: On Jan 24, 9:17 pm, William Stein wst...@gmail.com wrote: Here's a potentially good way to do this right now :-) Define this function: def normalize_denoms(f): n, d = f.numerator(), f.denominator() a = [vector(x.coefficients()).denominator() for x in [n,d]] return (n*a[0])/(d*a[1]) Then: sage: R.x,y=PolynomialRing(QQ, 2) sage: F=FractionField(R) sage: f=(x/2)/(3*y/17) sage: f 1/2*x/(3/17*y) sage: normalize_denoms(f) x/(3*y) I guess you meant: sage: def normalize_denoms(f): n, d = f.numerator(), f.denominator() a = lcm([vector(x.coefficients()).denominator() for x in [n,d]]) return (n*a)/(d*a) We then obtain: sage: R.x,y=PolynomialRing(QQ, 2) sage: F=FractionField(R) sage: f=(x/2)/(3*y/17) sage: f 1/2*x/(3/17*y) sage: normalize_denoms(f) 17*x/(6*y) which seems to be a better result to me... Yes, of course. Thanks. I was getting rid of the denoms at the expense of computing a different fraction! -- William -- 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: Using the simple server API
William, Do you know if anyone is actively maintaining this feature? I see that it would be quite useful for various applications, so I'd like to see it get resolved in one of the upcoming releases. I'd be happy to chip away at the problem, but I'm relatively new to the Sage community and might take me some time to get familiar with the architecture. Thanks! On Dec 18 2009, 2:59 pm, William Stein wst...@gmail.com wrote: On Fri, Dec 18, 2009 at 11:58 AM, Stefan stefan.louis.no...@gmail.com wrote: Hi Robert, Thanks for getting back to me. The error I'm getting is: File /sage/sage/local/lib/python2.6/site-packages/sagenb/simple/ twist.py, line 207, in render U = notebook_twist.notebook.user(username) exceptions.AttributeError: 'NoneType' object has no attribute 'user' This is probably somehow caused by the transition to the new notebook, which is separated completely out from Sage, and which has undergone many changes. William On Dec 18, 2:17 pm, Robert Bradshaw rober...@math.washington.edu wrote: On Dec 18, 2009, at 8:53 AM, Stefan wrote: Hi all, I surfed through the discussion board and through the documentation on trying to figure out how to get thesimpleserver API up and running. I made sure to run 'import sage.server.simple.twist' in my sage prompt. Is there a way to easily test Sage to see if the API is functioning such as entering the address into the address bar: Yes, you should be able to do that. (See the example at the top of the file.) http://localhost:8000/simple/login?username=myusernamepassword=mypas... I get the dreaded Internal Server Error message. What does the terminal window where you started the notebook server say? - 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 athttp://groups.google.com/group/sage-support URL:http://www.sagemath.org -- William Stein Associate 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
[sage-support] Re: Updating 'line3d' without making a fresh call.
It was an ephemeris that was generated outside of Sage. On Jan 10, 8:19 am, rickhg12hs rickhg1...@gmail.com wrote: Sorry not to address your query, but ... Is there a satellite ephemeris propagator for sage? ... or does your data come from outside sage? Cheers, Richard On Jan 7, 8:19 pm, Stefan stefan.louis.no...@gmail.com wrote: Hi all, I'm preparing to make a presentation to a few colleagues at work on the capabilities of Sage. In the presentation, I'm doing a demonstration of Sage's ability to visualize 3D data via that line3d command - in this case, an arbitrary spacecraft ephemeris. However, placing the line3d() call inside of a function that has the interact attribute causes undesirable effects in having to reinitialize Jmol and losing the viewpoint. Is there any way to access the data of a given Jmol object so that you can dynamically update the data used without having to reinitialize the call to Jmol? Thanks! @interact def ephemerisPlot(step=slider(srange(1,len(Data['Time']),1), default = 0)): show(line3d(zip(Data['X'][0:step],Data['Y'][0:step],Data['Z'] [0:step]), color='red')+line3d(zip(Data['X'],Data['Y'],Data ['Z']),opacity=0.1, color='blue')+sphere((Data['X'][step],Data['Y'] [step],Data['Z'][step]), size=200, color='blue')+sphere((0,0,0), size=6378.1, color='white')) -- 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: Updating 'line3d' without making a fresh call.
html(scriptalert('Sage can process Javascript!');/script) :) On Jan 7, 8:25 pm, Jason Grout jason-s...@creativetrax.com wrote: Stefan wrote: Hi all, I'm preparing to make a presentation to a few colleagues at work on the capabilities of Sage. In the presentation, I'm doing a demonstration of Sage's ability to visualize 3D data via that line3d command - in this case, an arbitrary spacecraft ephemeris. However, placing the line3d() call inside of a function that has the interact attribute causes undesirable effects in having to reinitialize Jmol and losing the viewpoint. Is there any way to access the data of a given Jmol object so that you can dynamically update the data used without having to reinitialize the call to Jmol? Not currently, but I would *really* like to have that capability. Well, I suppose you could write custom javascript code which could do that (I think jmol can do things like change things from javascript calls), but Sage does not provide any sort of help with that. Thanks, 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
[sage-support] Re: Sage 4.2.1 under Windows 7 not functioning with VirtualBox either?
Oh boy. I had a bunch of problems with getting the VirtualBox appliance to work in Windows 7. When you import the appliance, prior to starting it, go into the configuration and look at the hard drive configuration. The configuration should be reference the three files that comes with the Sage package. Hope that helps. If you're still having difficulty, let me know! On Dec 15, 1:01 am, Timothy Paysen timothy.pay...@gmail.com wrote: The VirtuaBox incarnation doesn't seem to be able to get to a Sage notebook. It will bring you to the Sage web sit--but nothing more. So--can't even say whether it works well or not--it just doesn't seem to work. -- 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] Preventing admin auto-login for Notebook server
Hey guys, Is there any way to disable the auto-login feature when a user accesses the Notebook server from the machine? Since I'm hosting the notebook server in a VM and have an outside port forwarded to the VM, any users that access the server globally get logged in as admin. Thanks! -- 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: Using the simple server API
Hi Robert, Thanks for getting back to me. The error I'm getting is: File /sage/sage/local/lib/python2.6/site-packages/sagenb/simple/ twist.py, line 207, in render U = notebook_twist.notebook.user(username) exceptions.AttributeError: 'NoneType' object has no attribute 'user' On Dec 18, 2:17 pm, Robert Bradshaw rober...@math.washington.edu wrote: On Dec 18, 2009, at 8:53 AM, Stefan wrote: Hi all, I surfed through the discussion board and through the documentation on trying to figure out how to get the simple server API up and running. I made sure to run 'import sage.server.simple.twist' in my sage prompt. Is there a way to easily test Sage to see if the API is functioning such as entering the address into the address bar: Yes, you should be able to do that. (See the example at the top of the file.) http://localhost:8000/simple/login?username=myusernamepassword=mypas... I get the dreaded Internal Server Error message. What does the terminal window where you started the notebook server say? - 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] Working through the matplotlib image processing tutorial
Hi Mike, Just use plt.savefig('test.png') instead of plt.imshow(img) Then you get the image. Greets! Stefan On Thursday 17 December 2009 03:01:25 pm Walking Randomly wrote: Hello again So I wondered if I could work through the matplotlib image processing tutorial using the SAGE notebook http://matplotlib.sourceforge.net/users/image_tutorial.html and evaluated this code import matplotlib.pyplot as plt import matplotlib.image as mpimg import numpy as np img=mpimg.imread('/home/mike/stinkbug.png') plt.imshow(img) The result was matplotlib.image.AxesImage object at 0x4bb3510 I was expecting to get a picture shown. Was I being reasonable with this expectation or am I missing something? Cheers, Mike -- 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: dense data points in a plot
Hello everyone! Just got an answer from the matplotlib list and it works! Date: Tuesday 15 December 2009 From: Michael Droettboom md...@stsci.edu To: stefan warm...@web.de Which version of matplotlib are you using? This is (I suspect) the result of a known bug in matplotlib that has been fixed since the latest release. In plots with large numbers of points, invisible points are automatically removed to increase performance and reduce file sizes, but this behavior was not fully correct. You can either install the 0.99.x branch from SVN, or, as a workaround, set path.simplify to False in your matplotlibrc, at the expense of performance and file size. Mike Thank you very much! However, sage uses the matplotlibrc from my myhome/.matplotlibrc but than it can't find my Qt4Agg (no problem only using python). ImportError: Qt4 backend requires that PyQt4 is installed. Is this intended, that from within sage the myhome/.matplotlibrc is used? I can of course use the GTKAgg. Thank you, again for the help. sTefan On Tuesday 15 December 2009 04:24:02 pm Marshall Hampton wrote: Can you give an example of where this happens? -M. Hampton On Dec 15, 8:47 am, stefan warm...@web.de wrote: Hi, maybe someone of you knows, I got no reply on the matplot list yet: I want to plot a line with very sharp features and many data points with matplot inside sage. If I plot the data with markers, the features can be seen perfectly. But if I choose the line style just to be '-' (which is also default), the peaks are not shown anymore. If I use something like '-o', the peaks are there, but the line does not fully join the individual markers at the peak. Is the '-' style doing some averaging before plotting or is it a rendering problem? And any suggestions how to get rid of it? Thanks a lot! Stefan -- 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] Portforwarding to Sage via VirtualBox
Hi all, For the last several days, I've been trying to properly configure port forwarding in VirtualBox so that I can have the VM accessible to other machines on the network. After doing research, I came across these sets of commands: VBoxManage.exe setextradata Sage 4.2.1 VBoxInternal/Devices/e1000/0/ LUN#0/Config/http/HostPort 8001 VBoxManage.exe setextradata Sage 4.2.1 VBoxInternal/Devices/e1000/0/ LUN#0/Config/http/GuestPort 8000 VBoxManage.exe setextradata Sage 4.2.1 VBoxInternal/Devices/e1000/0/ LUN#0/Config/http/Protocol TCP (e1000 refers to the virtual Intel adapter that VB uses.) It's my understanding that I should be able to access the Sage Notebook server by viewing http://localhost:8001 - however, this is not the case. Can anyone provide some insight into this problem? Thanks! -- 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: Portforwarding to Sage via VirtualBox
Ah, I got it figured out. In previous attempts, the host OS was Windows 7. I tried it on XP and it works fine. Might just be a firewall issue with Windows 7. Thanks for your support though. On Dec 10, 10:15 am, ma...@mendelu.cz ma...@mendelu.cz wrote: On 10 pro, 16:10, ma...@mendelu.cz ma...@mendelu.cz wrote: and when working on um-bc107.mendelu.cz, then localhost:8000 is also forwarded there. Oops, localhost is not forwarded R. -- 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] Factoring multivariate polynomials with parameters
Hello, I would like to factor multivariate polynomials that have parameters in the coefficient field, for example: K.a=PolynomialRing(QQ,1) K=FractionField(K) R.x,y=PolynomialRing(K,2) Now I would like to factor elements in R, such as x^2-m^2*y^2, which actually works. However, when I ask to have more trivial elements such as x or 1 factored, it fails with a NotImplementedError (for x) or IndexError (list index out of range for 1). What's wrong? Stefan -- 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] Factoring multivariate polynomials with parameters
William, I can factor polynomials with coefficients in QQ fine. Here are the examples I mentioned in greater detail: # define the coefficient field K and R=K[x,y] K.a=PolynomialRing(QQ,1) K=FractionField(K) R.x,y=PolynomialRing(K,2) # the following works: (x^2-y^2).factor() # answer: (x - y) * (x + y) # this one also works: (x^2-a^2*y^2).factor() # answer: (x + (-a)*y) * (x + a*y) # the following two are the simplest ones that fail: x.factor() # raises NotImplementedError R(1).factor() # raises IndexError: list index out of range If x^2-y^2 can be factored correctly, wouldn't I expect that factoring just x is also implemented? Maybe it's also just a bug. If I replace the definition of the ring R by R.x,y,a=PolynomialRing(QQ,3) then all four examples work correctly. Stefan Am 28.11.2009 um 17:17 schrieb William Stein: On Sat, Nov 28, 2009 at 3:06 PM, Stefan Boettner sboet...@tulane.edu wrote: Hello, I would like to factor multivariate polynomials that have parameters in the coefficient field, for example: K.a=PolynomialRing(QQ,1) K=FractionField(K) R.x,y=PolynomialRing(K,2) Now I would like to factor elements in R, such as x^2-m^2*y^2, which actually works. However, when I ask to have more trivial elements such as x or 1 factored, it fails with a NotImplementedError (for x) or IndexError (list index out of range for 1). What's wrong? Please give the simplest explicit example that raise IndexError, as that might be a bug. Regarding NotImplementedError, it means what it sounds like -- the capability you want isn't implemented.That said, can't you just factor over a polynomial ring in x,y,a? -- William -- 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] roots of polynomials (in the Symbolic Ring)
If I define a polynomial f=(x^4+x^2+1)^2 and find the roots via f.roots() I get four roots each with multiplicity one. However, (f^2).roots() yields exactly the same answer: four roots with multiplicity one(!) each. If f is a simpler polynomial, such as f=x^4+1, a correct multiplicity is reported. Stefan --~--~-~--~~~---~--~~ 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] Symbolic Expression
Hello, I'm trying to parse symbolic expressions, but got stuck very quickly. If I say: (x^2).operator() I get: built-in function pow If I say: pow I also get: built-in function pow But if I say: (x^2).operator()==pow I get: False How do I properly test if the topmost operation of an expression is a power, product, sum, whatever? Stefan --~--~-~--~~~---~--~~ 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 URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: Symbolic Expression
That helps for now. Thanks, Stefan Am 15.09.2009 um 22:19 schrieb Nils Bruin: On Sep 15, 6:24 pm, Stefan Boettner sboet...@tulane.edu wrote: Hello, I'm trying to parse symbolic expressions, but got stuck very quickly. If I say: (x^2).operator() I get: built-in function pow If I say: pow I also get: built-in function pow But if I say: (x^2).operator()==pow I get: False How do I properly test if the topmost operation of an expression is a power, product, sum, whatever? The animal seems to be called: sage.symbolic.expression.operator.pow but if you don't want to bother figuring something like that out, you can just cache it from a model equation: pow_as_a_symbolic_operator = (x^2).operator() and whenever you have a symbolic expression you expect is an exponentiation, you can do expr.operator() == pow_as_a_symbolic_operator Mike Hansen has authored a file in the sage library devel/sage/sage/ symbolic/expression_conversions.py that seems to make it easier to traverse an expression tree. You may be able to save yourself some work by inheriting from the classes he provides there and only implement what needs to be done on the leaves. I ran into that file by accident myself. It doesn't seem to be imported by default and I have no experience using it. Be aware: expressions that do not have an operator can be a SymbolicVariable or the method .pyobject() unpacks it: compare SR(x).pyobject() and SR(pi).pyobject(). I am not aware of other possibilities. Nils --~--~-~--~~~---~--~~ 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 URLs: http://www.sagemath.org -~--~~~~--~~--~--~---