[sage-support] Re: how to controll precision when show'ing formulas?
On Jun 22, 2009, at 6:01 AM, kcrisman wrote: I want that show(function) would give me just 1 precision digit after comma how could I achieve this? You can use Python's string formatting:http://docs.python.org/ library/stdtypes.html#string-formatting To get floating-point numbers to display with one decimal point, do something like this: sage: '%.2f' % pi '3.14' sage: '%.1f' % pi '3.1' sage: '%.6f' % pi '3.141593' See the Python documentation I linked to above for more details. Dan It should be pointed out that for a while, maybe a couple releases at some point this past fall, something related to the OP's question was the default behavior - that is, floats only showed up to their last non-zero digit. I think it was a patch from robertwb, but I'm not sure, and in any case it no longer is the case. Does anybody know what happened to that? I would really like that back, at least in things like interacts, but even if it was jettisoned for good reasons, it would be nice to know what happened. Pre-pynac, all floating point numbers that were part of a symbolic expression were 53-bit. Now that they can be arbitrary precision (they are in fact wrapped Sage RealNumbers) the number of digits printed gives an indication of how many digits of precision are known. - 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 URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Is it possible to disable maxima automated simplification ?
I am in the writing of a program that deals with rather lengthy symbolic expressions involving unknown functions and differentiation. When running commands like derivatives, it seems that maxima automatically runs into place to simplify the obtained expressions. (This is consistent with the documentation) In interactive sessions, this is perfectly good, but for my application, it has two major problems : - things are slowed down a lot because maxima tries to simplify long expressions which cannot be much simplified - worse : maxima often crashes which renders the whole program difficult to use My solution would be to disable maxima automated simplification but I cannot figure out if this is possible in sage or how to do it (I am using sage.4.0.1 on Fedora 10) Thanks Nicolas --~--~-~--~~~---~--~~ 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: Is it possible to disable maxima automated simplification ?
On Tue, Jun 23, 2009 at 9:40 AM, Nicolasnicolas.fresseng...@gmail.com wrote: I am in the writing of a program that deals with rather lengthy symbolic expressions involving unknown functions and differentiation. When running commands like derivatives, it seems that maxima automatically runs into place to simplify the obtained expressions. (This is consistent with the documentation) In interactive sessions, this is perfectly good, but for my application, it has two major problems : - things are slowed down a lot because maxima tries to simplify long expressions which cannot be much simplified - worse : maxima often crashes which renders the whole program difficult to use My solution would be to disable maxima automated simplification but I cannot figure out if this is possible in sage or how to do it (I am using sage.4.0.1 on Fedora 10) Please provide a much more precise example than what you've given above (which is no examples at all). -- 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 URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Fwd: misprint
-- Forwarded message -- From: Ron Evans rev...@math.ucsd.edu Date: Tue, Jun 23, 2009 at 3:42 AM Subject: misprint To: William Stein wst...@gmail.com I probably shouldn't be bothering you with trivialities, but the last word on the first line is misspelled. rje http://www.sagemath.org/doc/reference/dsage.html -- William Stein Associate 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 URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: EC search problem
On Jun 22, 7:59 pm, adam mohamed adam.hariv...@googlemail.com wrote: Hi, Thanks for the very quick response. I will try that tomorrow. Now I understand the problem that we met when running the same code in a linux machine. I am doing this search for cryptographic applications, so I am dealing with primes from the size of 170 bit Length. I would like the 2-sylow of E( F_p) to be Z/4Z and #E( F_p) = 4*L with L prime. Reinier Broker did his PhD about EC with prescribed order and we will would like to find out if his algorithms have been implemented in Sage? Hello Adam, No, as far as I know Sage has nothing implemented for finding curves with prescribed order or structure. John Regards, Adam On Mon, Jun 22, 2009 at 6:31 PM, William Stein wst...@gmail.com wrote: On Mon, Jun 22, 2009 at 5:35 PM, harivolaadam.hariv...@googlemail.com wrote: Hi all, I am running a small script on a windows xp machine and some time I am getting this error message: /usr/local/sage/local/bin/sage-sage: line 348: 19954 Killed python $@ You're probably running out of memory (=RAM). Try editing the file sage_vmx.vmx and increase the amount of RAM that is made available to the vmware machine running Sage. The default amount is very small. I don't get the meaning of that. By the way, does someone know an efficient way in Sage to search for EC with prescribed order ( I need curves over a big prime field with rational points of order 4 and cofactor 4 ). Thanks. Be way more precise. How big is big prime field? Do you want #E(F_p) = 4*n with n odd? Do you require that #E(E_p)[2] = 4 too? William Best wishes -- William Stein Associate 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 URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] jsmol black screen advances
Hi all, I have been working successfully with the last version binary version of Sage on Arch Linux. And old problem was solved now and was related with the empty jsmol screen for plots. It seems that it was related with the java version on Linux. With openjdk6 I got the problem but with jre is solved. However if there is a tab open that is pointing to a notebook which has jmol stuff there and the notebook interface was not launched, for example if you open a saved navigation session on firefox and then you launch sage you get a jsmol error. Something like this: http://pastebin.com/f7b447e94 But there are other java script programs that doesn't run well on other tabs. Seems a reported problem in other places too: http://wiki.jmol.org/index.php/Troubleshooting/Applet http://jmol.sourceforge.net/jslibrary/#jmolInitialize http://www.mail-archive.com/jmol-us...@lists.sourceforge.net/msg08200.html If this happen is just matter of restarting the browser (having the precaution of running first the sage notebook interface). At least that work in my case. I imagine that is possible to get the browser restarted or a message to the user to make that by him/her-self in that cases. Cheers, Offray --~--~-~--~~~---~--~~ 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] how to solve a matrix equation
Hello, I'm trying to solve a matrix Lyapunov equation A*X+X*A^T=-I, where A is given by: [ 0 0 0 0 1 -1 0 0] [ 0 0 0 0 0 1 -1 0] [ 0 0 0 0 0 0 1 -1] [ 0 0 0 0 0 0 0 1] [-1 0 0 0 a1 0 0 0] [ 1 -1 0 0 0 a2 0 0] [ 0 1 -1 0 0 0 a3 0] [ 0 0 1 -1 0 0 0 a4] with a1,a2,a3,a4 variables, I is dentity matrix, and X defined as [x11 x12 x13 x14 x15 x16 x17 x18] [x12 x22 x23 x24 x25 x26 x27 x28] [x13 x23 x33 x34 x35 x36 x37 x38] [x14 x24 x34 x44 x45 x46 x47 x48] [x15 x25 x35 x45 x55 x56 x57 x58] [x16 x26 x36 x46 x56 x66 x67 x68] [x17 x27 x37 x47 x57 x67 x77 x78] [x18 x28 x38 x48 x58 x68 x78 x88] with defined variables xij After couple of tries, I found out that sage accepts the following command solve(A*X+X*A.transpose()+I,X.arguments()) but the result: [[x11 == r239, x12 == r235, x13 == r245, x14 == -a4^2*r228 - (a2*r228 - r237 + r242 - r246)*a4 - r228 + r231 + r245, x15 == r251, x16 == r243, x17 == r241, x18 == -a2*r228 - a4*r228 + r237 - r242 + r246, x22 == r252, x23 == -a4*r246 + r226 - r228 + r250, x24 == r250, x25 == r249, x26 == r248, x27 == r247, x28 == r246, x33 == -a4*r240 + r225 - r226 + r244, x34 == r244, x35 == -(r228 + r231)*a4 - a1*r231 - a2*r228 + r237 + r238 - r242 + r246, x36 == r242, x37 == -a3*r226 - a4*r226 + r236 + r240 - r246, x38 == r240, x44 == a4^2*r225 + 1/2*(2*r240 + 1) *a4 + r225 + r244, x45 == r238, x46 == r237, x47 == r236, x48 == a4*r225 + r240 + 1/2, x55 == r234, x56 == r233, x57 == r232, x58 == r231, x66 == r230, x67 == r229, x68 == r228, x77 == r227, x78 == r226, x88 == r225]] is not exactly what I expected. Any hints? On a related matter, is there a reason why cholesky_decomposition method does not compute the exact solution in case of an exact input matrix (say, from QQbar)? In the help it says that the implementation uses standard recursion, with which one can compute the exact solution. Thanks, Ivica --~--~-~--~~~---~--~~ 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] Sage installation problem: Symbol not found: _iconv
Hi, I downloaded Sage for Mac OS X 10.5 and extracted it. However, when I try to run it I get the output appended below. Running %upgrade does not fix this. Any advice on how to get it running? Cheers, Oliver -- | Sage Version 4.0.2, Release Date: 2009-06-18 | | Type notebook() for the GUI, and license() for information.| -- --- ImportError Traceback (most recent call last) /Volumes/Data/sage/local/lib/python2.5/site-packages/IPython/ ipmaker.pyc in force_import(modname) 64 reload(sys.modules[modname]) 65 else: --- 66 __import__(modname) 67 68 /Volumes/Data/sage/local/bin/ipy_profile_sage.py in module() 5 preparser(True) 6 7 import sage.all_cmdline 8 sage.all_cmdline._init_cmdline(globals()) 9 /Volumes/Data/sage/local/lib/python2.5/site-packages/sage/ all_cmdline.py in module() 12 try: 13 --- 14 from sage.all import * 15 from sage.calculus.predefined import x 16 preparser(on=True) /Volumes/Data/sage/local/lib/python2.5/site-packages/sage/all.py in module() 71 72 from sage.rings.all import * --- 73 from sage.matrix.all import * 74 75 # This must come before Calculus -- it initializes the Pynac library. /Volumes/Data/sage/local/lib/python2.5/site-packages/sage/matrix/ all.py in module() 1 2 3 from matrix_space import MatrixSpace, is_MatrixSpace 4 from constructor import matrix, Matrix, random_matrix, diagonal_matrix, identity_matrix, block_matrix, block_diagonal_matrix, jordan_block, zero_matrix 5 from matrix import is_Matrix 6 from berlekamp_massey import berlekamp_massey 7 /Volumes/Data/sage/local/lib/python2.5/site-packages/sage/matrix/ matrix_space.pyc in module() 38 import matrix_modn_sparse 39 --- 40 import matrix_mod2_dense 41 #import matrix_mod2_sparse 42 ImportError: dlopen(/Volumes/Data/sage/local/lib/python2.5/site- packages/sage/matrix/matrix_mod2_dense.so, 2): Symbol not found: _iconv Referenced from: /Volumes/Data/sage/local/lib//libgd.2.dylib Expected in: flat namespace Error importing ipy_profile_sage - perhaps you should run %upgrade? WARNING: Loading of ipy_profile_sage failed. --~--~-~--~~~---~--~~ 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: Sage installation problem: Symbol not found: _iconv
On Tue, Jun 23, 2009 at 10:36 AM, Oliveroliver.afr...@gmail.com wrote: Hi, I downloaded Sage for Mac OS X 10.5 and extracted it. Intel or PowerPC? What was the exact name of the dmg you However, when I try to run it I get the output appended below. Running %upgrade does not fix this. Any advice on how to get it running? Cheers, Oliver -- | Sage Version 4.0.2, Release Date: 2009-06-18 | | Type notebook() for the GUI, and license() for information. | -- --- ImportError Traceback (most recent call last) /Volumes/Data/sage/local/lib/python2.5/site-packages/IPython/ ipmaker.pyc in force_import(modname) 64 reload(sys.modules[modname]) 65 else: --- 66 __import__(modname) 67 68 /Volumes/Data/sage/local/bin/ipy_profile_sage.py in module() 5 preparser(True) 6 7 import sage.all_cmdline 8 sage.all_cmdline._init_cmdline(globals()) 9 /Volumes/Data/sage/local/lib/python2.5/site-packages/sage/ all_cmdline.py in module() 12 try: 13 --- 14 from sage.all import * 15 from sage.calculus.predefined import x 16 preparser(on=True) /Volumes/Data/sage/local/lib/python2.5/site-packages/sage/all.py in module() 71 72 from sage.rings.all import * --- 73 from sage.matrix.all import * 74 75 # This must come before Calculus -- it initializes the Pynac library. /Volumes/Data/sage/local/lib/python2.5/site-packages/sage/matrix/ all.py in module() 1 2 3 from matrix_space import MatrixSpace, is_MatrixSpace 4 from constructor import matrix, Matrix, random_matrix, diagonal_matrix, identity_matrix, block_matrix, block_diagonal_matrix, jordan_block, zero_matrix 5 from matrix import is_Matrix 6 from berlekamp_massey import berlekamp_massey 7 /Volumes/Data/sage/local/lib/python2.5/site-packages/sage/matrix/ matrix_space.pyc in module() 38 import matrix_modn_sparse 39 --- 40 import matrix_mod2_dense 41 #import matrix_mod2_sparse 42 ImportError: dlopen(/Volumes/Data/sage/local/lib/python2.5/site- packages/sage/matrix/matrix_mod2_dense.so, 2): Symbol not found: _iconv Referenced from: /Volumes/Data/sage/local/lib//libgd.2.dylib Expected in: flat namespace Error importing ipy_profile_sage - perhaps you should run %upgrade? WARNING: Loading of ipy_profile_sage failed. -- William Stein Associate 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 URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: how to solve a matrix equation
na...@math.hr wrote: Hello, I'm trying to solve a matrix Lyapunov equation A*X+X*A^T=-I, where A is given by: [ 0 0 0 0 1 -1 0 0] [ 0 0 0 0 0 1 -1 0] [ 0 0 0 0 0 0 1 -1] [ 0 0 0 0 0 0 0 1] [-1 0 0 0 a1 0 0 0] [ 1 -1 0 0 0 a2 0 0] [ 0 1 -1 0 0 0 a3 0] [ 0 0 1 -1 0 0 0 a4] with a1,a2,a3,a4 variables, I is dentity matrix, and X defined as [x11 x12 x13 x14 x15 x16 x17 x18] [x12 x22 x23 x24 x25 x26 x27 x28] [x13 x23 x33 x34 x35 x36 x37 x38] [x14 x24 x34 x44 x45 x46 x47 x48] [x15 x25 x35 x45 x55 x56 x57 x58] [x16 x26 x36 x46 x56 x66 x67 x68] [x17 x27 x37 x47 x57 x67 x77 x78] [x18 x28 x38 x48 x58 x68 x78 x88] with defined variables xij After couple of tries, I found out that sage accepts the following command solve(A*X+X*A.transpose()+I,X.arguments()) 1. I is the complex number I; you probably want identity_matrix(8) 2. To solve the matrix, you need to express it as a set of equations (and use X.variables, not X.arguments) solve([(A*X+X*A.transpose()+identity_matrix(8))[i,j]==0 for i in range(8) for j in range(8)], X.variables()) 3. The above command takes at least a minute (I killed it after that): sage: A=matrix([[ 0 ,0 ,0 ,0 ,1 ,-1 ,0 ,0],[ 0 ,0 ,0 ,0 ,0 ,1 ,-1 ,0],[ 0 ,0 ,0 ,0 ,0 ,0 ,1 ,-1],[ 0 ,0 ,0 ,0 ,0 ,0 ,0 ,1],[-1 ,0 ,0 ,0 ,a1 ,0 ,0 ,0],[ 1 ,-1 ,0 ,0 sage: X=matrix(8, [var('x'+str(i)+str(j)) for i in range(1,9) for j in range(1,9)]) sage: [(A*X+X*A.transpose()+identity_matrix(8))[i,j]==0 for i in range(8) for j in range(8)] [x15 - x16 + x51 - x61 + 1 == 0, x16 - x17 + x52 - x62 == 0, x17 - x18 + x53 - x63 == 0, x18 + x54 - x64 == 0, a1*x15 - x11 + x55 - x65 == 0, a2*x16 + x11 - x12 + x56 - x66 == 0, a3*x17 + x12 - x13 + x57 - x67 == 0, a4*x18 + x13 - x14 + x58 - x68 == 0, x25 - x26 + x61 - x71 == 0, x26 - x27 + x62 - x72 + 1 == 0, x27 - x28 + x63 - x73 == 0, x28 + x64 - x74 == 0, a1*x25 - x21 + x65 - x75 == 0, a2*x26 + x21 - x22 + x66 - x76 == 0, a3*x27 + x22 - x23 + x67 - x77 == 0, a4*x28 + x23 - x24 + x68 - x78 == 0, x35 - x36 + x71 - x81 == 0, x36 - x37 + x72 - x82 == 0, x37 - x38 + x73 - x83 + 1 == 0, x38 + x74 - x84 == 0, a1*x35 - x31 + x75 - x85 == 0, a2*x36 + x31 - x32 + x76 - x86 == 0, a3*x37 + x32 - x33 + x77 - x87 == 0, a4*x38 + x33 - x34 + x78 - x88 == 0, x45 - x46 + x81 == 0, x46 - x47 + x82 == 0, x47 - x48 + x83 == 0, x48 + x84 + 1 == 0, a1*x45 - x41 + x85 == 0, a2*x46 + x41 - x42 + x86 == 0, a3*x47 + x42 - x43 + x87 == 0, a4*x48 + x43 - x44 + x88 == 0, a1*x51 - x11 + x55 - x56 == 0, a1*x52 - x12 + x56 - x57 == 0, a1*x53 - x13 + x57 - x58 == 0, a1*x54 - x14 + x58 == 0, 2*a1*x55 - x15 - x51 + 1 == 0, a1*x56 + a2*x56 - x16 + x51 - x52 == 0, a1*x57 + a3*x57 - x17 + x52 - x53 == 0, a1*x58 + a4*x58 - x18 + x53 - x54 == 0, a2*x61 + x11 - x21 + x65 - x66 == 0, a2*x62 + x12 - x22 + x66 - x67 == 0, a2*x63 + x13 - x23 + x67 - x68 == 0, a2*x64 + x14 - x24 + x68 == 0, a1*x65 + a2*x65 + x15 - x25 - x61 == 0, 2*a2*x66 + x16 - x26 + x61 - x62 + 1 == 0, a2*x67 + a3*x67 + x17 - x27 + x62 - x63 == 0, a2*x68 + a4*x68 + x18 - x28 + x63 - x64 == 0, a3*x71 + x21 - x31 + x75 - x76 == 0, a3*x72 + x22 - x32 + x76 - x77 == 0, a3*x73 + x23 - x33 + x77 - x78 == 0, a3*x74 + x24 - x34 + x78 == 0, a1*x75 + a3*x75 + x25 - x35 - x71 == 0, a2*x76 + a3*x76 + x26 - x36 + x71 - x72 == 0, 2*a3*x77 + x27 - x37 + x72 - x73 + 1 == 0, a3*x78 + a4*x78 + x28 - x38 + x73 - x74 == 0, a4*x81 + x31 - x41 + x85 - x86 == 0, a4*x82 + x32 - x42 + x86 - x87 == 0, a4*x83 + x33 - x43 + x87 - x88 == 0, a4*x84 + x34 - x44 + x88 == 0, a1*x85 + a4*x85 + x35 - x45 - x81 == 0, a2*x86 + a4*x86 + x36 - x46 + x81 - x82 == 0, a3*x87 + a4*x87 + x37 - x47 + x82 - x83 == 0, 2*a4*x88 + x38 - x48 + x83 - x84 + 1 == 0] sage: solve([(A*X+X*A.transpose()+identity_matrix(8))[i,j]==0 for i in range(8) for j in range(8)], X.variables()) The above is just a system of linear equations, though, so you should be able to express it as B*y=v for some matrix B and symbolic vector y and vector v, and then use B.solve_right() (and B.right_kernel() if you want the full set of solutions) and Sage's linear algebra to solve it. See http://sagenb.org/home/pub/594/ for an example of how to do this for this problem. Note that I didn't make any progress on the solution since getting the echelon form of the matrix seems to take way too long. Does anyone know why finding the echelon form of C in the above worksheet is not fast? It's a 64x64 symbolic matrix. 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 URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: EC search problem
Hi All, I solve the problem with the memory, thanks to William. But, now when I impose some strict conditions so that I have to toss say 100 times in order to hope for some curves to pop up, I am getting different kind of errors. I have attached the code and the error message I got hereby. Maybe my code is too naive that why I am having this problem. What I don't get is why the code seems to do well when the conditions are less restrictive but once I change a little bit, them Sage is not happy! Maybe one has to implement Reinier algorithms in order to avoid these kind of problems. Is this doable in Sage now? Best wishes, Adam On Tue, Jun 23, 2009 at 1:14 PM, John Cremona john.crem...@gmail.comwrote: On Jun 22, 7:59 pm, adam mohamed adam.hariv...@googlemail.com wrote: Hi, Thanks for the very quick response. I will try that tomorrow. Now I understand the problem that we met when running the same code in a linux machine. I am doing this search for cryptographic applications, so I am dealing with primes from the size of 170 bit Length. I would like the 2-sylow of E( F_p) to be Z/4Z and #E( F_p) = 4*L with L prime. Reinier Broker did his PhD about EC with prescribed order and we will would like to find out if his algorithms have been implemented in Sage? Hello Adam, No, as far as I know Sage has nothing implemented for finding curves with prescribed order or structure. John Regards, Adam On Mon, Jun 22, 2009 at 6:31 PM, William Stein wst...@gmail.com wrote: On Mon, Jun 22, 2009 at 5:35 PM, harivolaadam.hariv...@googlemail.com wrote: Hi all, I am running a small script on a windows xp machine and some time I am getting this error message: /usr/local/sage/local/bin/sage-sage: line 348: 19954 Killed python $@ You're probably running out of memory (=RAM). Try editing the file sage_vmx.vmx and increase the amount of RAM that is made available to the vmware machine running Sage. The default amount is very small. I don't get the meaning of that. By the way, does someone know an efficient way in Sage to search for EC with prescribed order ( I need curves over a big prime field with rational points of order 4 and cofactor 4 ). Thanks. Be way more precise. How big is big prime field? Do you want #E(F_p) = 4*n with n odd? Do you require that #E(E_p)[2] = 4 too? William Best wishes -- William Stein Associate 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 URLs: http://www.sagemath.org -~--~~~~--~~--~--~--- Traceback (most recent call last): File stdin, line 1, in module File /home/notebook/sage_notebook/worksheets/admin/1/code/6.py, line 9, in module A.append(elliptic_curves_search(_sage_const_100 )) File /home/notebook/sage_notebook/worksheets/admin/1/code/5.py, line 27, in elliptic_curves_search S = P.division_points(n_1) File /usr/local/sage/local/lib/python2.5/site-packages/sage/schemes/elliptic_curves/ell_point.py, line 820, in division_points g = E.division_polynomial(m) File /usr/local/sage/local/lib/python2.5/site-packages/sage/schemes/elliptic_curves/ell_generic.py, line 1835, in division_polynomial f = self.division_polynomial_0(m,x) File /usr/local/sage/local/lib/python2.5/site-packages/sage/schemes/elliptic_curves/ell_generic.py, line 1655, in division_polynomial_0 g_mplus2 = self.division_polynomial_0(m+2, x, cache) File /usr/local/sage/local/lib/python2.5/site-packages/sage/schemes/elliptic_curves/ell_generic.py, line 1646, in division_polynomial_0 g_mplus3 = self.division_polynomial_0(m+3, x, cache) File /usr/local/sage/local/lib/python2.5/site-packages/sage/schemes/elliptic_curves/ell_generic.py, line 1655, in division_polynomial_0 g_mplus2 = self.division_polynomial_0(m+2, x, cache) File /usr/local/sage/local/lib/python2.5/site-packages/sage/schemes/elliptic_curves/ell_generic.py, line 1655, in division_polynomial_0 g_mplus2 = self.division_polynomial_0(m+2, x, cache) File /usr/local/sage/local/lib/python2.5/site-packages/sage/schemes/elliptic_curves/ell_generic.py, line 1646, in division_polynomial_0 g_mplus3 = self.division_polynomial_0(m+3, x, cache) File /usr/local/sage/local/lib/python2.5/site-packages/sage/schemes/elliptic_curves/ell_generic.py, line 1646, in division_polynomial_0 g_mplus3 = self.division_polynomial_0(m+3, x, cache) File /usr/local/sage/local/lib/python2.5/site-packages/sage/schemes/elliptic_curves/ell_generic.py, line 1646, in division_polynomial_0 g_mplus3 =
[sage-support] Re: API up
Try it now. If someone puts an integral in that Sage can't caluclate it locks up my server. I am working on a fix. On Jun 18, 6:02 pm, Erik Lane erikl...@gmail.com wrote: The gif link is broken. Tries to use a private address. 192.168.1.101 That doesn't work with my computer, of course. I don't have IE8 so I can't comment on that. On Thu, Jun 18, 2009 at 4:13 PM, David Joynerwdjoy...@gmail.com wrote: On Thu, Jun 18, 2009 at 2:38 PM, Mikiethephantom6...@hotmail.com wrote: How fast was it and did it work with IE8? It was fast for me but sorry, I don't use windows. On Jun 18, 11:37 am, David Joyner wdjoy...@gmail.com wrote: Cool! On Thu, Jun 18, 2009 at 12:46 PM, Mikiethephantom6...@hotmail.com wrote: I have my API running on a host. Not real pretty yet, but it seems to work. Please, test. http://pirsqrt.com:7316 Thanx- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ 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: Sage installation problem: Symbol not found: _iconv
Intel. The binary name was sage-4.0.2-OSX10.5-Intel-i386-Darwin.dmg On Jun 23, 2:10 pm, William Stein wst...@gmail.com wrote: On Tue, Jun 23, 2009 at 10:36 AM, Oliveroliver.afr...@gmail.com wrote: Hi, I downloaded Sage for Mac OS X 10.5 and extracted it. Intel or PowerPC? What was the exact name of the dmg you However, when I try to run it I get the output appended below. Running %upgrade does not fix this. Any advice on how to get it running? Cheers, Oliver -- | Sage Version 4.0.2, Release Date: 2009-06-18 | | Type notebook() for the GUI, and license() for information. | -- --- ImportError Traceback (most recent call last) /Volumes/Data/sage/local/lib/python2.5/site-packages/IPython/ ipmaker.pyc in force_import(modname) 64 reload(sys.modules[modname]) 65 else: --- 66 __import__(modname) 67 68 /Volumes/Data/sage/local/bin/ipy_profile_sage.py in module() 5 preparser(True) 6 7 import sage.all_cmdline 8 sage.all_cmdline._init_cmdline(globals()) 9 /Volumes/Data/sage/local/lib/python2.5/site-packages/sage/ all_cmdline.py in module() 12 try: 13 --- 14 from sage.all import * 15 from sage.calculus.predefined import x 16 preparser(on=True) /Volumes/Data/sage/local/lib/python2.5/site-packages/sage/all.py in module() 71 72 from sage.rings.all import * --- 73 from sage.matrix.all import * 74 75 # This must come before Calculus -- it initializes the Pynac library. /Volumes/Data/sage/local/lib/python2.5/site-packages/sage/matrix/ all.py in module() 1 2 3 from matrix_space import MatrixSpace, is_MatrixSpace 4 from constructor import matrix, Matrix, random_matrix, diagonal_matrix, identity_matrix, block_matrix, block_diagonal_matrix, jordan_block, zero_matrix 5 from matrix import is_Matrix 6 from berlekamp_massey import berlekamp_massey 7 /Volumes/Data/sage/local/lib/python2.5/site-packages/sage/matrix/ matrix_space.pyc in module() 38 import matrix_modn_sparse 39 --- 40 import matrix_mod2_dense 41 #import matrix_mod2_sparse 42 ImportError: dlopen(/Volumes/Data/sage/local/lib/python2.5/site- packages/sage/matrix/matrix_mod2_dense.so, 2): Symbol not found: _iconv Referenced from: /Volumes/Data/sage/local/lib//libgd.2.dylib Expected in: flat namespace Error importing ipy_profile_sage - perhaps you should run %upgrade? WARNING: Loading of ipy_profile_sage failed. -- 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 URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: Sage installation problem: Symbol not found: _iconv
On Tue, Jun 23, 2009 at 4:01 PM, Oliveroliver.afr...@gmail.com wrote: Intel. The binary name was sage-4.0.2-OSX10.5-Intel-i386-Darwin.dmg If you have XCode installed, what happens if you do ./sage -f libm4ri-20090617 -- 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 URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: Sage installation problem: Symbol not found: _iconv
Hi William, I do have XCode installed. I ran the command you suggested from the sage directory. It appeared to compile successfully (see output appended below). However, I still get the same error when running sage. Again, %upgrade does not fix it. Any idea what is causing this error? I'm not familiar enough with Python to know... Cheers, Oliver [my_computer]% sage -f libm4ri-20090617 Force installing libm4ri-20090617 Calling sage-spkg on libm4ri-20090617 You must set the SAGE_ROOT environment variable or run this script from the SAGE_ROOT or SAGE_ROOT/local/bin/ directory. libm4ri-20090617 Machine: Darwin asosx27.physics.ox.ac.uk 9.7.0 Darwin Kernel Version 9.7.0: Tue Mar 31 22:52:17 PDT 2009; root:xnu-1228.12.14~1/RELEASE_I386 i386 Deleting directories from past builds of previous/current versions of libm4ri-20090617 Extracting package /Volumes/Data/sage/spkg/standard/ libm4ri-20090617.spkg ... -rw-r--r--@ 1 kingo wheel 107 19 Jun 18:06 /Volumes/Data/sage/spkg/ standard/libm4ri-20090617.spkg Finished extraction sage: After decompressing the directory libm4ri-20090617 does not exist This means that the corresponding .spkg needs to be downloaded again. http://www.sagemath.org//packages/optional/libm4ri-20090617.spkg -- libm4ri-20090617.spkg . lots of stuff Successfully installed libm4ri-20090617 Now cleaning up tmp files. Making Sage/Python scripts relocatable... Making script relocatable Finished installing libm4ri-20090617.spkg On Jun 23, 3:07 pm, William Stein wst...@gmail.com wrote: On Tue, Jun 23, 2009 at 4:01 PM, Oliveroliver.afr...@gmail.com wrote: Intel. The binary name was sage-4.0.2-OSX10.5-Intel-i386-Darwin.dmg If you have XCode installed, what happens if you do ./sage -f libm4ri-20090617 -- 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 URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: Sage installation problem: Symbol not found: _iconv
On Tue, Jun 23, 2009 at 4:20 PM, Oliveroliver.afr...@gmail.com wrote: Hi William, I do have XCode installed. I ran the command you suggested from the sage directory. It appeared to compile successfully (see output appended below). However, I still get the same error when running sage. Again, %upgrade does not fix it. Any idea what is causing this error? I'm not familiar enough with Python to know... Maybe try export MAKE=make -j3 ./sage -ba which will take an hour. If that doesn't work, just build Sage from source. 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 URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: poly matrices
On Tue, Jun 23, 2009 at 4:30 PM, William Steinwst...@gmail.com wrote: 2009/6/23 Emmanuel Thomé emmanuel.th...@gmail.com: I wonder what happens here: tiramisu ~ $ sage -- | Sage Version 4.0, Release Date: 2009-05-29 | | Type notebook() for the GUI, and license() for information. | -- sage: p=3 sage: n=1000 sage: K=GF(p) sage: KP.x=PolynomialRing(K) sage: MS=MatrixSpace(K,n,n); sage: A=MS.random_element() sage: MSP=MatrixSpace(KP,n,n); sage: time xI=x*MSP.identity_matrix() CPU times: user 17.37 s, sys: 0.15 s, total: 17.52 s Wall time: 17.54 s sage: time xI=diagonal_matrix([x for i in range(n)]) CPU times: user 32.18 s, sys: 0.14 s, total: 32.33 s Wall time: 32.34 s sage: time xI.determinant() got fed up before it finishes... Type xl.determinant?? to see: .. # fall back to very very stupid algorithm -- expansion by minors. # TODO: surely there is something much better, even in total generality... # this is ridiculous. d = self._det_by_minors(self._ncols) self.cache('det', d) return d Sorry, but it almost goes without saying... implement it and post a patch! --~--~-~--~~~---~--~~ 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: poly matrices
2009/6/23 Emmanuel Thomé emmanuel.th...@gmail.com: I wonder what happens here: tiramisu ~ $ sage -- | Sage Version 4.0, Release Date: 2009-05-29 | | Type notebook() for the GUI, and license() for information. | -- sage: p=3 sage: n=1000 sage: K=GF(p) sage: KP.x=PolynomialRing(K) sage: MS=MatrixSpace(K,n,n); sage: A=MS.random_element() sage: MSP=MatrixSpace(KP,n,n); sage: time xI=x*MSP.identity_matrix() CPU times: user 17.37 s, sys: 0.15 s, total: 17.52 s Wall time: 17.54 s sage: time xI=diagonal_matrix([x for i in range(n)]) CPU times: user 32.18 s, sys: 0.14 s, total: 32.33 s Wall time: 32.34 s sage: time xI.determinant() got fed up before it finishes... Type xl.determinant?? to see: .. # fall back to very very stupid algorithm -- expansion by minors. # TODO: surely there is something much better, even in total generality... # this is ridiculous. d = self._det_by_minors(self._ncols) self.cache('det', d) return d 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 URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] trigonometric equation
How to find symbolic solution for a generic equation of this kind A*sin(x)+B*cos(x)+C=0 Thanks Renzo --~--~-~--~~~---~--~~ 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: Build on Pardus 2009 beta of sage 4.0.2 (from source)
The package xorg-proto is also required to provide the X11 headers. On Jun 23, 9:41 am, Scott scotta_2...@yahoo.com wrote: The installation of the linux-headers package with pisi under Pardus Linux 2009Beta solved the above problem. --~--~-~--~~~---~--~~ 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: how to controll precision when show'ing formulas?
You can use Python's string formatting sage: '%.2f' % pi '3.14' as I said -- I use now string formatting via html http://ftp.akl.lt/users/jurgis/etc/formule_show_precision--how.png but I have to repeat the whole formula structure -- and this is inconvenient. any more proposals? :) could smb make a feature request on trac? as I see kcrisman has similar request. ps.: I don't have track account (and probably won't use it much) http://wiki.sagemath.org/TracGuidelines --~--~-~--~~~---~--~~ 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: multiplying matrices/inverses
In the third one, try using the polynomial quotient ring with modulus x^2 + x + 1; the reason you aren't getting the output you expect is because x^3 - 1 is reducible over QQ, and QQ[x] / (x^3 - 1) isn't an integral domain. See below. (Or you could use number field arithmetic; Sage has a special optimised set of routines specifically for doing linear algebra over cyclotomic fields.) sage: R.x = QQ[] sage: S.y = R.quotient(x^2 + x + 1) sage: M = matrix([[(y^i)^j for j in range(3)] for i in range(3)]) sage: M [ 1 1 1] [ 1 y -y - 1] [ 1 -y - 1 y] sage: N = M.matrix_from_rows([0,2,1]) sage: M * N [3 0 0] [0 3 0] [0 0 3] David --~--~-~--~~~---~--~~ 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: multiplying matrices/inverses
On Jun 23, 12:34 pm, davidloeffler dave.loeff...@gmail.com wrote: In the third one, try using the polynomial quotient ring with modulus x^2 + x + 1; the reason you aren't getting the output you expect is because x^3 - 1 is reducible over QQ, and QQ[x] / (x^3 - 1) isn't an integral domain. See below. Thanks. Ironically, I of course used that x^2+x+1 = 0 to do this by hand, but I guess the quotient rings aren't aware of their zero- divisors. (Or you could use number field arithmetic; Sage has a special optimised set of routines specifically for doing linear algebra over cyclotomic fields.) I probably won't need the optimized part, but that will probably be better than just trying symbolic or CC matrices - what I really want is the nice-looking end result recognizing zero as zero and 1 as 1, because I already know the outcome of the computation. Thanks also for that suggestion. - kcrisman --~--~-~--~~~---~--~~ 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: Sage installation problem: Symbol not found: _iconv
That didn't work, so I built from source. It now works. Thanks for the help! On Jun 23, 3:23 pm, William Stein wst...@gmail.com wrote: On Tue, Jun 23, 2009 at 4:20 PM, Oliveroliver.afr...@gmail.com wrote: Hi William, I do have XCode installed. I ran the command you suggested from the sage directory. It appeared to compile successfully (see output appended below). However, I still get the same error when running sage. Again, %upgrade does not fix it. Any idea what is causing this error? I'm not familiar enough with Python to know... Maybe try export MAKE=make -j3 ./sage -ba which will take an hour. If that doesn't work, just build Sage from source. 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 URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: Build on Pardus 2009 beta of sage 4.0.2 (from source)
Pardus is an independent linux distro that does not use apt-get, yum or portage for packagemanagement. It is based in Turkey and has some ties to thier academic and military institutions. The package manager is pisi . This command installed the header files required by sage sudo pisi install xorg-proto linux-headers Ranlib, gcc, m4 and make were not in the default installation of Pardus 2009 Beta sudo pisi install binutils gcc m4 make Sage took about 3 hours to build. V/R Scott --~--~-~--~~~---~--~~ 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] Possible bug in typesetting
In a worksheet, input: R.a,b=PolynomialRing(QQ) T.x=LaurentSeriesRing(R) a*x+b*x With typesetting off, the output is (a+b)*x With typesetting on, it gives a+bx If T.x=PowerSeriesRing(R), it gives (a+b)x in both cases Is it a bug, or am I missing something? --~--~-~--~~~---~--~~ 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] graphviz installation problem in 4.0.1
Hello, I successfully built sage-4.0.1 on my laptop (Linux Mint ver. 6 Felicia for AMD_64) and also managed to install other packages (e.g. ginv, gnuplotpy) using 'sage -i pkg name'. But I hit a snag with graphviz-2.16.1.p0: --(snip from install.log)-- make[3]: Entering directory `/usr/local/sage-4.0.1/spkg/build/ graphviz-2.16.1.p0/src/cmd/dot' gcc -DHAVE_CONFIG_H -I. -I../.. -I../../lib/common -I../../lib/gvc - I../../lib/pathplan -I../../lib/graph -I../../lib/cdt -I/usr/local/ sage-4.0.1/local/include -I/usr/local/sage-4.0.1/local/include -g -O2 -Wno-unknown-pragmas -Wstrict-prototypes -Wpointer-arith -Wall -ffast- math -MT dot.o -MD -MP -MF .deps/dot.Tpo -c -o dot.o dot.c mv -f .deps/dot.Tpo .deps/dot.Po /bin/bash ../../libtool --tag=CC --mode=link gcc -g -O2 -Wno- unknown-pragmas -Wstrict-prototypes -Wpointer-arith -Wall -ffast-math -L/usr/local/sage-4.0.1/local/lib -L/usr/local/sage-4.0.1/local/lib -o dot dot.o ../../lib/gvc/libgvc.la mkdir -p .libs gcc -g -O2 -Wno-unknown-pragmas -Wstrict-prototypes -Wpointer-arith - Wall -ffast-math -o .libs/dot dot.o -L/usr/local/sage-4.0.1/local/ lib ../../lib/gvc/.libs/libgvc.so /usr/local/sage-4.0.1/spkg/build/ graphviz-2.16.1.p0/src/lib/graph/.libs/libgraph.so /usr/local/ sage-4.0.1/spkg/build/graphviz-2.16.1.p0/src/lib/cdt/.libs/libcdt.so / usr/local/sage-4.0.1/spkg/build/graphviz-2.16.1.p0/src/lib/ pathplan/.libs/libpathplan.so -lm /usr/local/sage-4.0.1/spkg/build/ graphviz-2.16.1.p0/src/libltdl/.libs/libltdl.so -ldl -lz -Wl,--rpath - Wl,/usr/local/sage-4.0.1/local/lib creating dot gcc -DHAVE_CONFIG_H -I. -I../.. -I../../lib/common -I../../lib/gvc - I../../lib/pathplan -I../../lib/graph -I../../lib/cdt -I/usr/local/ sage-4.0.1/local/include -I/usr/local/sage-4.0.1/local/include -g -O2 -Wno-unknown-pragmas -Wstrict-prototypes -Wpointer-arith -Wall -ffast- math -MT dot_builtins.o -MD -MP -MF .deps/dot_builtins.Tpo -c -o dot_builtins.o `test -f '../../lib/gvc/dot_builtins.c' || echo './'`../../lib/gvc/dot_builtins.c mv -f .deps/dot_builtins.Tpo .deps/dot_builtins.Po gcc -DHAVE_CONFIG_H -I. -I../.. -I../../lib/common -I../../lib/gvc - I../../lib/pathplan -I../../lib/graph -I../../lib/cdt -I/usr/local/ sage-4.0.1/local/include -I/usr/local/sage-4.0.1/local/include -g -O2 -Wno-unknown-pragmas -Wstrict-prototypes -Wpointer-arith -Wall -ffast- math -MT no_demand_loading.o -MD -MP -MF .deps/no_demand_loading.Tpo - c -o no_demand_loading.o `test -f '../../lib/gvc/no_demand_loading.c' || echo './'`../../lib/gvc/no_demand_loading.c mv -f .deps/no_demand_loading.Tpo .deps/no_demand_loading.Po make[3]: *** No rule to make target `../../plugin/pango/ libgvplugin_pango.la', needed by `dot_builtins'. Stop. make[3]: Leaving directory `/usr/local/sage-4.0.1/spkg/build/ graphviz-2.16.1.p0/src/cmd/dot' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/usr/local/sage-4.0.1/spkg/build/ graphviz-2.16.1.p0/src/cmd' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/usr/local/sage-4.0.1/spkg/build/ graphviz-2.16.1.p0/src' make: *** [all] Error 2 Error building Graphviz --(end snip)-- Any thoughts on how to resolve? Your help / suggestions are much appreciated! --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 URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] not a valid Python identifier
I am using a Python script that starts a twisted server. And have several Sage functions defined. Thus the Sage preparser is not available. Here is the the function for integrating def Integrate3a(exp1,exp2): s1=type(exp1);print s1 R1 = integrate(exp1,exp2) return R1 The values are coming in as strings and I am converting them to calculus type. It is kind of working, but when I put 2*x^2-x or 2*x**2-x I get not a valid Python identifier. What is real strange is If I put x-2*x^2 it works. Is there anyway to get the Sage preparser to work in the Python script. Thanx --~--~-~--~~~---~--~~ 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: not a valid Python identifier
Hi, On Tue, Jun 23, 2009 at 1:33 PM, Mikiethephantom6...@hotmail.com wrote: The values are coming in as strings and I am converting them to calculus type. It is kind of working, but when I put 2*x^2-x or 2*x**2-x I get not a valid Python identifier. What is real strange is If I put x-2*x^2 it works. Is there anyway to get the Sage preparser to work in the Python script. Your best bet for that type of thing is to pass the string into SR which will parse the expression. sage: SR('2*x^2-x') 2*x^2 - x sage: SR('2*x**2-x') 2*x^2 - x sage: SR('x-2*x^2') -2*x^2 + x To access the preparser, you can do something like: sage: sage.misc.preparser.preparse('x^2') 'x**Integer(2)' Note that you get a string back. You need to eval() that to get an object back. Note that there are security risks using eval(). That's why it's safer to use the parser in SR. --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 URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: not a valid Python identifier
Mike, worked great. If you are ever near Colorado Springs you have a free lunch. On Jun 23, 3:07 pm, Mike Hansen mhan...@gmail.com wrote: Hi, On Tue, Jun 23, 2009 at 1:33 PM, Mikiethephantom6...@hotmail.com wrote: The values are coming in as strings and I am converting them to calculus type. It is kind of working, but when I put 2*x^2-x or 2*x**2-x I get not a valid Python identifier. What is real strange is If I put x-2*x^2 it works. Is there anyway to get the Sage preparser to work in the Python script. Your best bet for that type of thing is to pass the string into SR which will parse the expression. sage: SR('2*x^2-x') 2*x^2 - x sage: SR('2*x**2-x') 2*x^2 - x sage: SR('x-2*x^2') -2*x^2 + x To access the preparser, you can do something like: sage: sage.misc.preparser.preparse('x^2') 'x**Integer(2)' Note that you get a string back. You need to eval() that to get an object back. Note that there are security risks using eval(). That's why it's safer to use the parser in SR. --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 URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: poly matrices
William Stein wrote: On Tue, Jun 23, 2009 at 4:30 PM, William Steinwst...@gmail.com wrote: 2009/6/23 Emmanuel Thomé emmanuel.th...@gmail.com: I wonder what happens here: tiramisu ~ $ sage -- | Sage Version 4.0, Release Date: 2009-05-29 | | Type notebook() for the GUI, and license() for information.| -- sage: p=3 sage: n=1000 sage: K=GF(p) sage: KP.x=PolynomialRing(K) sage: MS=MatrixSpace(K,n,n); sage: A=MS.random_element() sage: MSP=MatrixSpace(KP,n,n); sage: time xI=x*MSP.identity_matrix() CPU times: user 17.37 s, sys: 0.15 s, total: 17.52 s Wall time: 17.54 s sage: time xI=diagonal_matrix([x for i in range(n)]) CPU times: user 32.18 s, sys: 0.14 s, total: 32.33 s Wall time: 32.34 s sage: time xI.determinant() got fed up before it finishes... Type xl.determinant?? to see: .. # fall back to very very stupid algorithm -- expansion by minors. # TODO: surely there is something much better, even in total generality... # this is ridiculous. d = self._det_by_minors(self._ncols) self.cache('det', d) return d Sorry, but it almost goes without saying... implement it and post a patch! Or finish the patch here: http://trac.sagemath.org/sage_trac/ticket/3048 That patch implements generic LU decomposition and then uses that to do determinants and solving matrix equations. This makes determinants, ahem, *vastly* faster. To finish this, I think it would be sufficient to: 1. change the default pick of 'partial' pivoting to only happen in the case of CDF and RDF or RR or CC fields. Currently it is broken on symbolic matrices because the symbolic ring is inexact. 2. Maybe change the name lu_decomposition to just lu 3. In using LU decomposition for solving, there was some question about the echelon form for some matrices (e.g., matrices over ZZ) being faster than this generic LU algorithm. So sometimes you probably want to use Sage's super-fast echelon implementations for certain matrices instead of this generic LU algorithm. I don't know what matrix types you'd want to prefer echelon form for, though. 4. Write necessary doctests and documentation. 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 URLs: http://www.sagemath.org -~--~~~~--~~--~--~---