[sage-support] Re: Does the digits method have an inverse?

2008-10-21 Thread Mike Hansen
On Tue, Oct 21, 2008 at 9:35 PM, Jason Merrill [EMAIL PROTECTED] wrote: sage: 1492.digits(10) [2, 9, 4, 1] Now is there an easy way to take this list and get back the integer 1492? I'm not sure if there is a single function that does it, but you can use the following one liner which does

[sage-support] Re: Variable for .sage/ ?

2008-11-03 Thread Mike Hansen
Hi Simon, On Mon, Nov 3, 2008 at 3:37 AM, Simon King [EMAIL PROTECTED] wrote: Is there a variable in Sage pointing to $HOME/.sage/? I mean, analogous to SAGE_ROOT or SAGE_TMP? Or should I infer the path from $HOME, i.e., from os.environ['HOME'] ? The DOT_SAGE environment variable is what

[sage-support] Re: manipulating dictionaries (bug?)

2008-11-04 Thread Mike Hansen
Hi Stan, On Tue, Nov 4, 2008 at 11:51 AM, Stan Schymanski [EMAIL PROTECTED] wrote: Thanks for the clarification. I think I see a bit of a light in the fog. So since lists and dictionaries are immutable objects, any references to them must always refer to the same thing. William had a typo in

[sage-support] Re: Problem finding eigenvalues in sage

2008-11-06 Thread Mike Hansen
I'm not sure how to covert those sqrt expressions into what you want. However, you can see that they are what you're expecting: sage: A = matrix([[-1,-1+I],[1,0]]) sage: evs = A.eigenvalues(); evs [(-sqrt(4*I - 3) - 1)/2, (sqrt(4*I - 3) - 1)/2] sage: map(CC, evs) [-1.00 -

[sage-support] Re: Computing a sum

2008-11-10 Thread Mike Hansen
On Mon, Nov 10, 2008 at 5:36 PM, cesarnda [EMAIL PROTECTED] wrote: Actually this sum can't be done by Maxima, but Derive can do it (even an old version of derive). do you have an idea of how this problem is planning to be solved? Is this the answer you were expecting? (%i6)

[sage-support] Re: question about .extend

2008-11-15 Thread Mike Hansen
Another puzzling thing is that b=[ ] %timeit b.extend([2]) 100 loops, best of 3: 801 ns per loop type(b) type 'list' but then when I run %timeit b+[2] 10 loops, best of 3: 88.9 ms per loop That's much slower, in fact if you simple type b and hit enter... SAGE hangs. This is

[sage-support] Re: Cayley Hamilton

2008-11-17 Thread Mike Hansen
I would do something like this: sage: m = matrix([[var('x%s%s'%(i,j)) for j in range(2)] for i in range(2)]); m [x00 x01] [x10 x11] sage: m.characteristic_polynomial().polynomial(QQ).subs(x=m) [0 0] [0 0] --Mike --~--~-~--~~~---~--~~ To post to this group, send

[sage-support] Re: latex output for real numbers without zeros at the end

2008-11-17 Thread Mike Hansen
On Mon, Nov 17, 2008 at 7:12 AM, Marshall Hampton [EMAIL PROTECTED] wrote: There are a number of interact examples on the wiki (such as the Gram- Schmidt one at http://wiki.sagemath.org/interact/linear_algebra) that work around this problem by casting to a field of low precision, for example

[sage-support] Re: latex output for real numbers without zeros at the end

2008-11-17 Thread Mike Hansen
If a is your real number, and then a._latex_?? will point you in the direction that you need to go. It leads to the _latex_ function for which there really isn't anything deep going on. If all you care about is truncating zeros, then following changes will do: diff -r 07a824fa8f2b

[sage-support] Re: latex output for real numbers without zeros at the end

2008-11-17 Thread Mike Hansen
Hello, On Mon, Nov 17, 2008 at 11:11 PM, Stan Schymanski [EMAIL PROTECTED] wrote: Dear Mike, Thanks a lot for that, this looks very promising. However, after making the suggested change, the behaviour of latex() did not change. Do I need to restart sage for the changes to take effect? You

[sage-support] Re: Question about doc tests

2008-11-18 Thread Mike Hansen
Hi Simon, On Tue, Nov 18, 2008 at 3:09 AM, Simon King [EMAIL PROTECTED] wrote: It still seems to me that it is *less* than undocumented: It is not defined in Sage (commandline), search_src fails, and also it is not defined when I run sage -sh. It is used in sage-doctest and sage-env in

[sage-support] Re: lists, vectors, arrays in equations?

2008-11-19 Thread Mike Hansen
Hi Stan, You should use Python's list comprehensions to do that: sage: f = 2*x^3+1 sage: v = [1,2,3] sage: [f(x=a) for a in v] [3, 17, 55] or you could do sage: map(f, v) [3, 17, 55] --Mike --~--~-~--~~~---~--~~ To post to this group, send email to

[sage-support] Re: lists, vectors, arrays in equations?

2008-11-19 Thread Mike Hansen
And a (not very robust) version which works with keyword arguments too: def threaded(f): from functools import wraps def wrapper(*args, **kwds): n = max(map(len, args) + map(len, kwds.values()) + [0]) if n == 0: return [] new_args = zip(*args) if

[sage-support] Re: bug in integral?

2008-11-19 Thread Mike Hansen
On Wed, Nov 19, 2008 at 8:50 AM, pong [EMAIL PROTECTED] wrote: Maybe someone has reported this already... but looks like there is a bug in integral sage: integral(x*abs(9-x^2), x, -6, 0) 162 The integrand is negative on (-6,0) Yep, these are coming from Maxima: (%i11)

[sage-support] Re: Doc tests for file-producing methods

2008-11-20 Thread Mike Hansen
Hello, On Thu, Nov 20, 2008 at 12:10 PM, Robert Bradshaw [EMAIL PROTECTED] wrote: On Nov 20, 2008, at 12:04 PM, Simon King wrote: Dear Robert, On Nov 20, 8:45 pm, Robert Bradshaw [EMAIL PROTECTED] wrote: a) In what directory should the files be created? [Subdirectories of] SAGE_TMP

[sage-support] Re: Simplification/Rewrite Rules?

2008-11-24 Thread Mike Hansen
On Mon, Nov 24, 2008 at 6:31 PM, Tim Lahey [EMAIL PROTECTED] wrote: I know I could parse the output, but I thought someone might have done it and it sounds like the timeit doctest framework might do it. Where can I find this in the source so I can see how it is doing it? You can do this in

[sage-support] Re: how to pass a symbolic function to python, maxima etc?

2008-11-25 Thread Mike Hansen
Hi Stan, On Tue, Nov 25, 2008 at 4:30 AM, Stan Schymanski [EMAIL PROTECTED] wrote: Dear all, I have asked this question in other contexts but never found an answer, so I thought I start a new thread. I would like to be able to pass a symbolic function derived in sage to python (or maxima

[sage-support] Re: how to pass a symbolic function to python, maxima etc?

2008-11-25 Thread Mike Hansen
Hi, On Tue, Nov 25, 2008 at 6:22 AM, Stan Schymanski [EMAIL PROTECTED] wrote: Hi Mike, This is pretty cool, thanks! Is there something equivalent for passing a function f to python or numpy? I'm not exactly sure what you mean by this so I'll take a guess. Given, your f=a*x^2+b, do you want

[sage-support] Re: symbolic lists

2008-11-27 Thread Mike Hansen
Hi Lance, On Thu, Nov 27, 2008 at 10:45 PM, hbetx9 [EMAIL PROTECTED] wrote: After reviewing this oustanding piece of software, I would like to utilize it to solve some problems I've been working on. However I have one question that the documentation has not provided a solution for. Is

[sage-support] Re: First use of SAGE, eigen* and maxima compute time

2008-12-04 Thread Mike Hansen
Hi Jan, On Thu, Dec 4, 2008 at 1:47 AM, Jan Groenewald [EMAIL PROTECTED] wrote: If anyone has the time to look at and discuss some of these issues that will be much appreciated, and assist in the growth of using SAGE to teach in this institute! I don't have a whole lot of time, but I put

[sage-support] Re: Trying to find partitions of a pair of integers.

2008-12-14 Thread Mike Hansen
Hello, On Sun, Dec 14, 2008 at 4:04 PM, green351 mmamashra...@gmail.com wrote: Hi, This is my first time emailing with a question and my first time trying to use Sage (I'm a complete programming dunce). I'm trying to do the following: Given the tuple (p,q) in Z x Z and integer n I need to

[sage-support] Re: Trying to find partitions of a pair of integers.

2008-12-15 Thread Mike Hansen
Hi Sonny, On Mon, Dec 15, 2008 at 11:19 AM, green351 mmamashra...@gmail.com wrote: This does help, thanks! I have some questions though. Again I'm a total computer programming novice so I don't understand the code you have written. How would I add the extra conditions to what you have

[sage-support] Re: problem in running sage example.sage

2008-12-21 Thread Mike Hansen
Hi, On Sun, Dec 21, 2008 at 5:47 PM, pong wypon...@gmail.com wrote: I have recently switch to running SAGE on a linux system I tried to see if sagetex work by running latex on the example.tex (come with the current distribution sage-3.2.2) However when I then run sage example.sage, it

[sage-support] Re: Assigning

2008-12-22 Thread Mike Hansen
On Mon, Dec 22, 2008 at 6:12 AM, Timothy Clemans timothy.clem...@gmail.com wrote: sage: sage0(var('a b c')) (a, b, c) sage: sage0(a = b/c) b That's not quite right as it creates 'a' in a different session. There are a few variations depending on exactly what you want to do. If you want to

[sage-support] Re: Arbitrary precision in cython

2008-12-22 Thread Mike Hansen
Hello, On Mon, Dec 22, 2008 at 6:10 AM, M. Yurko myu...@gmail.com wrote: Thanks for your help. I tried your first and last suggestions, but they yielded code that was slower than the original python implementation. However, I'll take a look at sage.rings.real_mpfr and try to use mpfr

[sage-support] Re: Convert a SymbolicEquation into a MaximaElement

2008-12-23 Thread Mike Hansen
Hi Blair, On Tue, Dec 23, 2008 at 7:43 AM, bsdz blai...@googlemail.com wrote: Hi, Is it possible to convert a SymbolicEquation into a MaximaElement easily? The opposite to: - maxima('x^2 + y^2 = 0').sage() Something like this: - x, y = var('x y') b = x^2 + y^2 == 0 b.maxima() I

[sage-support] Re: the set containing the empty set

2009-01-09 Thread Mike Hansen
On Fri, Jan 9, 2009 at 3:36 PM, John H Palmieri jhpalmier...@gmail.com wrote: Is this a bug? sage: Set([]) {} sage: Set(Set([])) {} sage: Set([]) == Set(Set([])) True This is because Set takes a list (iterable) for all the of the elements of the set. So, if you want to construct the

[sage-support] Re: Having difficulty using polyfit function

2009-01-10 Thread Mike Hansen
Hello, On Sat, Jan 10, 2009 at 8:29 PM, slybro sntventu...@gmail.com wrote: I am having trouble using the polyfit function. Here are the commands: import numpy as np import scipy as sc vp = np.array([1.0, 5.0, 10.0, 20.0, 40.0, 60.0, 100.0, 200.0, 400.0, 760.0]) T = np.array([-36.7,

[sage-support] Re: filling area between plots

2009-01-16 Thread Mike Hansen
Hello, On Fri, Jan 16, 2009 at 2:26 AM, Fabio Tonti fto...@gmail.com wrote: Probably it's a silly question, but I get this output when trying to apply the patch. Do I need to create a mercurial repository or fetch something else first? ... cd

[sage-support] Re: confusing output? latex(7-(-1)^(1/3))

2009-01-17 Thread Mike Hansen
Hello, On Sat, Jan 17, 2009 at 1:25 PM, William Stein wst...@gmail.com wrote: This bug that you reported is now http://trac.sagemath.org/sage_trac/ticket/5004 I've posted a patch there which should take care of the issue. --Mike --~--~-~--~~~---~--~~ To

[sage-support] Re: sage simplification

2009-01-20 Thread Mike Hansen
Hi Ben, On Tue, Jan 20, 2009 at 1:46 AM, ben m...@matix.co.uk wrote: Are there any functions that are able to do further simplification? You're probably looking for trig_simplify(): sage: a = cos(x)^2 + sin(x)^2 sage: a.trig_simplify() 1 --Mike

[sage-support] Re: SAGE working with Paraview

2009-01-20 Thread Mike Hansen
Hi Johannes, On Tue, Jan 20, 2009 at 2:37 PM, Johannes Reichold reich...@ifd.mavt.ethz.ch wrote: Many thanks for your answer Jaap! Unfortunately, building the experimental cmake failed (see error report below), however I have cmake installed on my system outside of SAGE. I will give it a

[sage-support] Re: functions in list comprehensions

2009-01-23 Thread Mike Hansen
Hello, Sorry to focus on one little question and ignore the big picture, but it's 6:15am :-) Will the pynac symbolics take away all my problems, or will I still have to add this (completely incomprehensible to my students) _fast_float_ thing, and only that if I am persistent enough to find

[sage-support] Re: problem deleting, archiving worksheets

2009-01-24 Thread Mike Hansen
On Sat, Jan 24, 2009 at 6:17 PM, Jason Grout jason-s...@creativetrax.com wrote: I also saw this not being able to delete a worksheet by clicking the boxes next to the worksheet and hitting the delete button also for a bit with 3.3alpha1 on FF3 on Ubuntu. My installation was also messed up,

[sage-support] Re: problem deleting, archiving worksheets

2009-01-24 Thread Mike Hansen
Hello all, I fixed this problem and put a patch up at http://trac.sagemath.org/sage_trac/ticket/5095 . The problem was that the TinyMCE patch made all AJAX requests use jQuery, but the jQuery code was not included on the worksheet listing page. --Mike

[sage-support] Re: New User Confusion over Latex support in sage

2009-01-25 Thread Mike Hansen
Hello, On Sun, Jan 25, 2009 at 11:39 AM, composer314 jeremy.saw...@gmail.com wrote: Here's what I am trying to do: I would like to typeset my Sage expressions into Latex without the intermediate step of copying the Latex generated by the latex( ) function and then pasting it into an

[sage-support] Re: sage 3.2.3: plots being displayed in webbrowser

2009-01-28 Thread Mike Hansen
Hello, On Wed, Jan 28, 2009 at 10:39 PM, hvniekerk huubvanniek...@gmail.com wrote: I haven't done anything in the notebook yet, only from the commandline. The other Sage installations (on Fedora and Debian) just show the graphics in separate windows, as should. Though I noticed the other day

[sage-support] Re: list of functions

2009-01-29 Thread Mike Hansen
Hello, On Thu, Jan 29, 2009 at 1:46 AM, martin Campos Pinto mcp.st...@gmail.com wrote: I get 0 (which is fine), now when I type b = [lambda x:i for i in range(2)] b[0](0) I get 1 ... There must be a simple explanation for this but I can't figure it out. What's wrong ? This is caused by

[sage-support] Re: Evaluate a derivative at one point

2009-02-01 Thread Mike Hansen
Hi Christophe, On Sun, Feb 1, 2009 at 3:08 PM, Christophe Deroulers christophe.deroulers__ggsa...@normalesup.org wrote: Hello, Is there a way in Sage to express the derivative at one point of a formal function? There's currently no way to do this right now. I have a bit of code I started

[sage-support] Re: How can I import a .py -file to Sage?

2009-02-05 Thread Mike Hansen
Hello, On Thu, Feb 5, 2009 at 2:45 PM, Fall In Love with Sage cs.losi...@gmail.com wrote: I tried the code unsuccessfully: a = open([x.replace(',',' ').split() for x in open('/Applications/ sage/test.py').readlines()] a You can do the following to load a .py file into a Sage session:

[sage-support] Re: Sage library for the iPhone

2009-02-07 Thread Mike Hansen
Hello, On Sat, Feb 7, 2009 at 10:43 AM, Andy andrew.richard.how...@gmail.com wrote: Does anyone know if there is a sage library that can be used in iPhone applications? My current bet would be to attempt to use Sage through some sort of Python interpreter, but I was hoping there was a more

[sage-support] Re: Vector from polynomial coefficients -- length

2009-02-13 Thread Mike Hansen
Hello, On Fri, Feb 13, 2009 at 2:36 AM, acd acd4use...@lycos.de wrote: When I try the following in Sage, it fails because leading zeros in the vector are skipped: The leading zeros aren't skipped -- the trailing ones are. For example, sage: R.x = GF(2)[] sage: list(x^4+x^3+1) [1, 0, 0, 1,

[sage-support] Re: odeint solver script works in IPython but gets 'array cannot be safely cast to required type' error in Sage

2009-02-16 Thread Mike Hansen
Hello, This is due to the interaction between numpy/scipy and Sage's datatypes. See my response at http://groups.google.com/group/sage-devel/browse_thread/thread/7038a422a73b2c60/5e6dec20247df698?lnk=gstq=scipy+signal#5e6dec20247df698 --Mike

[sage-support] Re: No remote temporary directory (option server_tmpdir)

2009-02-17 Thread Mike Hansen
Hi Karsten, I know exactly what's going wrong, but basically what it comes down to is that there isn't a way to currently pass what temporary directory to use when using server_pool. If you want to disable the message from appearing, it is the print statement on line 176 of

[sage-support] Re: Automatically displaying the type of an object?

2009-02-17 Thread Mike Hansen
On Tue, Feb 17, 2009 at 5:52 PM, Alasdair amc...@gmail.com wrote: It would be nice - at least for beginners - if there was some way for Sage to automatically return the type of an object along with its value. Would this be hard to implement? It's not too difficult. See my response in this

[sage-support] Re: Automatically displaying the type of an object?

2009-02-17 Thread Mike Hansen
On Tue, Feb 17, 2009 at 6:00 PM, Alasdair amc...@gmail.com wrote: Yes, that works fine - thank you very much! Is there a way of turning such behavior on and off from within Sage? Not automatically. You just need to write a little function that swaps the repr_and_parent hook with

[sage-support] Re: Problem unsing Matrix.invert() / Matrix.inverse()

2009-02-21 Thread Mike Hansen
Hello, If you want to use numerical linear algebra, you should use matrices over the RealDoubleField (RDF) as no one as done work on arbitrary precision numerical linear algebra (which is what is being used when you just use 0.91). sage: M= Matrix([[1,0,0],[0,1,0],[0,0,1]]) sage: M =

[sage-support] Re: I can't load objets in Sage 3.2.3 that were created in Sage 3.1.1

2009-03-01 Thread Mike Hansen
Hi Alex, On Sun, Mar 1, 2009 at 8:20 AM, Alex Lara lrodr...@gmail.com wrote: I'm using Sage 3.2.3. I can't load objects created and saved with Sage 3.1.1. I got the following message:  DeprecationWarning: Your data is stored in an old format. Please use the save() function to store your

[sage-support] Re: I can't load objets in Sage 3.2.3 that were created in Sage 3.1.1

2009-03-01 Thread Mike Hansen
On Sun, Mar 1, 2009 at 9:56 AM, Alex Lara lrodr...@gmail.com wrote: From command line of Sage 3.1.1, I saved some object, and then I could open it with sage 3.2.3. Next I open test.sobj (this was created by a sage program) in sage 3.1.1,  saved it again, and when I tried to open it on sage

[sage-support] Re: Finding the roots of a polynomial

2009-03-05 Thread Mike Hansen
Hello, On Thu, Mar 5, 2009 at 11:24 AM, Bob gotw...@gmail.com wrote: I need to find the roots of this polynomial, where are coefficients are in this matrix: coef=matrix([[1],[-1],[-1],[0]]) First, you should construct a polynomial. A matrix of coefficients is not the preferred way to work

[sage-support] Re: Problems using sagetex package

2009-03-05 Thread Mike Hansen
Hi Alex, On Thu, Mar 5, 2009 at 9:37 PM, Alex Lara lrodr...@gmail.com wrote: Hi Marshall I'm using Ubuntu 8.04, in a laptop Dell inspiron 1420. I installed from source. I have 3.1.1. and 3.2.3. I was checking, maxima does not work at all. I can't do a simple example like: sage: x =

[sage-support] Re: Making pylab.plot() and pylab.show() in Sage

2009-03-07 Thread Mike Hansen
Hi Gus, On Sat, Mar 7, 2009 at 8:26 AM, linuxgus ka8...@amsat.org wrote: In notebook, after importing pylab, running something like pylab.plot([1,2,3],[1,2,3]) pylab.show() does nothing.  Doing it from the command line results in a cryptic message about using matplotlib.use() to declare

[sage-support] Re: Object changes its contents after saved (sage 3.1.1)

2009-03-09 Thread Mike Hansen
On Mon, Mar 9, 2009 at 6:37 PM, Alex Lara lrodr...@gmail.com wrote: Some idea of how to fix this? I don't have a copy of Sage 3.1.1 handy right now since it is so old. In Sage 3.4.rc0, I run your code and get H and G to be the same. --Mike --~--~-~--~~~---~--~~

[sage-support] Re: Object changes its contents after saved (sage 3.1.1)

2009-03-09 Thread Mike Hansen
On Mon, Mar 9, 2009 at 7:24 PM, Justin Walker jus...@mac.com wrote: FWIW, the problem shows in Sage 3.3 (the -1 and -2 entries are interchanged; the rest show in the same order). There is no guarantee on the order of the elements when you iterate through a dictionary. --Mike

[sage-support] Re: Trigonometric simplification

2009-03-10 Thread Mike Hansen
Hi Alexandre, On Tue, Mar 10, 2009 at 4:35 AM, alexandre.mol...@fpms.ac.be alex.mol...@gmail.com wrote: cos(q1)*cos(q2) - sin(q1)*sin(q2) to obtain the following result : cos(q1+q2) ? We don't have the Maxima function trigreduce wrapped in Sage, but you can access it like this: sage: f =

[sage-support] Re: Small problem with limit()

2009-03-12 Thread Mike Hansen
Hello, On Thu, Mar 12, 2009 at 1:36 PM, Jose Guzman n...@neurohost.org wrote: sage: g=9.81 sage: t=var('t') sage: limit(2*g*(t^2-1)/(t-1),t=1)   gives me 39 However, if I simplify the equation and calculate the limit... sage: limit(2*g*(t+1),t=1)   gives me the good value 39.276 This is

[sage-support] Re: Operator precedence.

2009-03-15 Thread Mike Hansen
Hello, On Sun, Mar 15, 2009 at 2:48 PM, Jose Guzman n...@neurohost.org wrote: something strange happened to me today, if I try In [1]: 6*21/18-2^3 Out[1]: 6 However, if I try the following In [2]: 6*21/18-2**3 Out[2]: -1 then the normal operator precedence (parenthesis, exponential,

[sage-support] Re: Korean characters in TinyMCE

2009-03-19 Thread Mike Hansen
Hello, I put up a patch at #5564 which (along with the patches at #4547 and #5211) fixes all of the issues at #2896, #1477, and #4956 for me. It could use some wider testing though. --Mike --~--~-~--~~~---~--~~ To post to this group, send email to

[sage-support] Re: determinants of matrix polynomials

2009-03-19 Thread Mike Hansen
Hi Chris, I'm not sure what other types of matrices you're looking at, but if the matrices are similar to the ones you posted, then one typical approach is to evaluate the matrices at a number of points, take the determinant, and then rebuild the determinant from that data. This work well if

[sage-support] Re: determinants of matrix polynomials

2009-03-19 Thread Mike Hansen
On Mar 19, 6:54 pm, Chris Godsil cgod...@uwaterloo.ca wrote: What algorithm(s) does sage use to compute determinants over QQ[t] or QQ[t,u]? For both of these, it is computing them using minors, which is awful when the matrices are not tiny. Does they work over the ring of definition, or over

[sage-support] Re: Dealing with algebraic elements and rational functions

2009-03-20 Thread Mike Hansen
Hello, On Mar 20, 4:18 am, luisfe lftab...@yahoo.es wrote: Hi all, Mathematically, I have the following field: Q(x,y,z,t,a) Where x,y,z,t are indeterminates and a is an algebraic number over the rationals (lets say degree 4). If I have some elements, let say f,g,h in this field I would

[sage-support] Re: (débutant...) maxima pas trouvé

2009-03-20 Thread Mike Hansen
Bonjour Paul, On Mar 20, 9:00 am, paul.bartho...@gmail.com paul.bartho...@gmail.com wrote: maxima est installé et finctionne bien, mais pas (encore) avec sage. où dois-je chercher le problème ? Voici un exemple, y compris en appellant !maxima... Merci pour toute aide, Paul Je ne parle

[sage-support] Re: 3-D plots of affine varieties

2009-03-21 Thread Mike Hansen
Hello, On Mar 21, 10:13 pm, Minh Nguyen nguyenmi...@gmail.com wrote: Hi folk, I may be missing something here, but when I tried to plot 0 = x^2 + y^2 - z^2 I received an error: What you want is implicit 3d plotting which is not in Sage (yet). See

[sage-support] Re: File string, line 2 Integer(2) ^ IndentationError: unexpected indent

2009-03-22 Thread Mike Hansen
On Mar 22, 5:25 am, tM totesmons...@yahoo.de wrote: I have no idea where the problem is: The problem comes from the difference between str and repr: sage: f = x^2 + 3 sage: repr(f) 'x^2 + 3' sage: str(f) '\n 2\r \nx + 3'

[sage-support] Re: maximum recursion depht exceded

2009-03-22 Thread Mike Hansen
Hello, On Mar 22, 7:16 am, christophe van der putten christophe.v...@gmail.com wrote: Hi, I am a newbie with sage, a want to save in a text file all prime and prime power that are lower than a big number Max=(10^18). i use two loop:  as below and i have the error message maximum recursion

[sage-support] Re: Cython help

2009-04-24 Thread Mike Hansen
Hi Dylan, On Fri, Apr 24, 2009 at 12:47 PM, drupel dylanru...@gmail.com wrote: Hi all, I am new to Sage and I don't quite understand how to convert my code to cython code to speed up my program.  I am doing a lot of symbolic manipulations and using the PolynomialRing object.  Below I have

[sage-support] Re: Cython help

2009-04-24 Thread Mike Hansen
On Fri, Apr 24, 2009 at 1:40 PM, drupel dylanru...@gmail.com wrote: Thanks Mike, Is it possible to do the symbolic computations with Cython? Yes, you can do them from within Cython, but it's not going to give you the speed up that you might think / want. Making code faster is almost entirely

[sage-support] Re: scipy.stats.poisson.pmf doesn't work

2009-04-28 Thread Mike Hansen
Hello, On Tue, Apr 28, 2009 at 12:29 PM, Alden alden.wal...@gmail.com wrote: On two different computers running Ubuntu 9.04, I downloaded and built from source sage 3.4.1.  I also downloaded scipy using the synaptic package manager.  I am under the impression that python and scipy in sage

[sage-support] Re: SageWorld

2009-04-29 Thread Mike Hansen
On Wed, Apr 29, 2009 at 3:00 PM, Serge Salamanka salsa-...@tut.by wrote: Is it a good idea to share objects between python processes with the help of any database ? Can't still find any decent tool for sharing objects. Saving and loading them in Sage seems to be a simple approach for user

[sage-support] Re: Arbitrary precision computations?

2009-04-29 Thread Mike Hansen
On Wed, Apr 29, 2009 at 6:17 PM, Alasdair amc...@gmail.com wrote: Here's my input: h=10.0^(-20) ex=(2.7^h-1)/h and my output: 0.000 How to I coerce Sage to work with arbitrary precision, and to return the correct value, which is about 0.99? Here's one way: sage: R =

[sage-support] Re: using len invokes bad division

2009-05-04 Thread Mike Hansen
On Mon, May 4, 2009 at 12:19 PM, Jaap Spies j.sp...@hccnet.nl wrote: Another Python builtin is pow(), but how is it possible that type(pow(2,9,11)) returns type 'sage.rings.integer_mod.IntegerMod_int' Or am I mistaken? The pow() builtin just calls __pow__ on the first argument in that case,

[sage-support] Re: Location of a file that is loaded

2009-05-13 Thread Mike Hansen
Hello, Looking at the code for load in enlightening. Here's the bit that is relevant for you: ## Load file by absolute filename X = loads(open(filename).read(), compress=compress) try: X._default_filename = os.path.abspath(filename) except AttributeError: pass

[sage-support] Re: Usage Styles and using scipy

2009-05-13 Thread Mike Hansen
On Wed, May 13, 2009 at 3:44 AM, Kevin Horton khorto...@rogers.com wrote: Well done Jason - Thanks! The baffling part is why you don't get this editor when you click the Edit button in a notebook worksheet.  As it sits now, with no obvious visual clue that this editor even exists, most users

[sage-support] Re: cube roots

2009-05-13 Thread Mike Hansen
On Wed, May 13, 2009 at 6:58 PM, Bill Page bill.p...@newsynthesis.org wrote: Can someone explain this apparently inconsistent result? It's just operator precedence: sage: -(2.0^(1/3)) -1.25992104989487 sage: (-2.0)^(1/3) 0.629960524947437 + 1.09112363597172*I --Mike

[sage-support] Re: Substitution with symbolic equations

2009-05-15 Thread Mike Hansen
Hello, On Fri, May 15, 2009 at 5:06 AM, Paul Sargent psa...@gmail.com wrote: Lets give ourselves two symbolic equations: sage: var(a b c d e) sage: e1 = a == b + c sage: e2 = d == e * a Now, lets say I want to know what c is in terms of b, d e. By hand I'd substitute e1 in e2, and then

[sage-support] Re: Why is Sage called a Computer *Algebra* system? What is def of algebra?

2009-05-16 Thread Mike Hansen
On Sat, May 16, 2009 at 11:15 AM, Craig Citro craigci...@gmail.com wrote: Sage does calculus and geometry calculations so I don't understand why the term Computer Algebra System is so prevalent. I would guess for historical reasons. On the front page of sagemath.org, we just use the term

[sage-support] Re: Best way to evaluate a string

2009-05-18 Thread Mike Hansen
On Mon, May 18, 2009 at 5:48 PM, Mike Witt mwg...@gmail.com wrote: Is there a way to evaluate a string in the same way as sage would evaluate it?  Or, to put it another way, maybe I'm just confused about the way 'eval' works (or maybe eval isn't the right function) ... ... sage:

[sage-support] Re: Tab completion seg faults

2009-05-28 Thread Mike Hansen
On Thu, May 28, 2009 at 1:03 PM, William Stein wst...@gmail.com wrote: Yes, it's an option, if it works and somebody can do the work (!= me). William There's a new spkg at http://trac.sagemath.org/sage_trac/ticket/5218 that needs to be reviewed. It's the same as the old one except that it

[sage-support] Re: using sphinx to create a manual

2009-05-30 Thread Mike Hansen
Hello, On Sat, May 30, 2009 at 3:27 PM, simon.k...@uni-jena.de wrote: I am sorry for my newbie question, but doesn't it seem natural that a separate installation of Sphinx shouldn't be needed.? Is Sphinx not included with Sage? He means a new Sphinx document. Something you'd get by running

[sage-support] Re: How to define a constant function

2009-06-03 Thread Mike Hansen
On Wed, Jun 3, 2009 at 10:51 AM, moky moky.m...@gmail.com wrote: = #! /usr/bin/sage -python # -*- coding: utf8 -*- from sage.all import * var('x') f(x)= 8 print f.derivative() === This is a difference between Sage and

[sage-support] Re: How to define a constant function

2009-06-03 Thread Mike Hansen
On Wed, Jun 3, 2009 at 11:00 AM, Minh Nguyen nguyenmi...@gmail.com wrote: You might want to try just putting the code in a some text file whose extension is .sage. For example, I put the following code in a file called demo.sage, not demo.py: The reason why this works is that Sage preparses

[sage-support] Re: A simple question about solve()

2009-06-04 Thread Mike Hansen
On Thu, Jun 4, 2009 at 4:22 PM, fred.ri...@gmail.com fred.ri...@gmail.com wrote: I have the same question about solve(). I have a system of quadratic equations, and i want only the solution real of the system. I tried to define the space for all the variables i used, with assume ()  but

[sage-support] Re: loading in a list or list of lists from a file

2009-06-05 Thread Mike Hansen
Hello, On Fri, Jun 5, 2009 at 7:24 PM, wkehowskiwkehow...@cox.net wrote: Changing data.sage to T[0]=([1, 2, 3, 4], [5, 6, 7], [8, 9, 10, 11], [13, 14]) T[1]=([1, 2, 3, 4], [5, 6, 7], [12], [13, 14]) You should put T = {} at the beginning to define T as a dictionary. --Mike

[sage-support] Re: substitute values into a muttivariate polynomial

2009-06-07 Thread Mike Hansen
This works: sage: n=6 sage: R=PolynomialRing(QQ,n,'z') sage: z=R.gens() sage: g=sum(z[i] for i in range(n)) sage: g.subs(dict((z[i], i) for i in range(n))) 15 --Mike --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To

[sage-support] Re: Help on creating documentation for an spkg

2009-06-09 Thread Mike Hansen
Hello, On Tue, Jun 9, 2009 at 1:57 AM, Simon Kingsimon.k...@uni-jena.de wrote: How can I tell sphinx where the modules-to-be-documented are? Sphinx just tries to import the modules. It reads the docstrings, etc. via introspection. So, they just need to be somewhere where they can be imported

[sage-support] Re: Help on creating documentation for an spkg

2009-06-10 Thread Mike Hansen
On Tue, Jun 9, 2009 at 11:27 PM, simon.k...@uni-jena.de wrote: ... and my problem was that I expected (from the sage manual) that these short .rst files are auto-generated! Aren't they? They're only auto-generated because I put code in builder.py to do so. For something that's not Sage, I

[sage-support] Re: How to substitute n floating values for the n variables of a polynomial in Sage, where n is a variable ?

2009-06-10 Thread Mike Hansen
Hello, On Wed, Jun 10, 2009 at 8:40 AM, faicelfaicelb...@gmail.com wrote: hello The question is : How to substitute n floating values for the n variables of a polynomial in Sage, where n is a variable ? For example, Let P P=x3*x6+x1*x6+x4*x5+x2*x5+x1*x4+x2* Did you leave off

[sage-support] Re: defining a function as a numerical integral

2009-06-10 Thread Mike Hansen
On Wed, Jun 10, 2009 at 9:53 AM, evlu...@gmail.comevlu...@gmail.com wrote: I get this error: Traceback (most recent call last): ,,, TypeError: float() argument must be a string or a number I guess that sage is trying to evaluate the integral before substituting the value for b. Is this

[sage-support] Re: Inheritance from sage.symbolic.expression.Expression

2009-06-12 Thread Mike Hansen
Hello, On Fri, Jun 12, 2009 at 2:09 AM, Nicolasnicolas.fresseng...@gmail.com wrote: Dear Burcin, Just one quick question about patches, I have just changed the expression.pyx file and ran another make (which took not so much time). After you make the change to the file, just run sage -br

[sage-support] Re: Dimensional Analysis or Unit Conversion capability?

2009-06-14 Thread Mike Hansen
On Sun, Jun 14, 2009 at 2:20 PM, David Joynerwdjoy...@gmail.com wrote: +1 I like the as method http://home.scarlet.be/be052320/Unum_tutorial.html#_Toc68111424 as is going to be a keyword in Python 2.6 so this will actually have to be changed. It makes sense to do it before it's in Sage since

[sage-support] Re: notebook.setup() problem

2009-06-15 Thread Mike Hansen
On Mon, Jun 15, 2009 at 9:59 AM, William Steinwst...@gmail.com wrote: It's completely broken.  This is a new bug in Sage-4.0, which was introduced by factoring dsage out from the core sage library, I think by Mike Hansen.  I've opened a blocker ticket for this: http://trac.sagemath.org

[sage-support] Re: bug: no local scope for symbolic variables

2009-06-16 Thread Mike Hansen
On Tue, Jun 16, 2009 at 3:55 PM, Utpal Sarkardoe...@gmail.com wrote: I think global=False would be a nice option, also because there seem to be more differences between a symbolic variable created using var and new_var than just the scope; I noticed that while var creates a symbolic

[sage-support] Re: string conversion

2009-06-17 Thread Mike Hansen
Hello, On Wed, Jun 17, 2009 at 9:13 AM, Mikiethephantom6...@hotmail.com wrote: I cannot use R.x  the period.  The python code is in a script.  I am taking the string from a form and want to convert to a polynomial then factor the expression.  This is from my Twisted API. Here is the exact

[sage-support] Re: not a valid Python identifier

2009-06-23 Thread Mike Hansen
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

[sage-support] Re: changeing sage -b (cython)

2009-07-17 Thread Mike Hansen
Hi Ethan, On Fri, Jul 17, 2009 at 10:41 AM, Ethan Van Andelevlu...@gmail.com wrote: Is it possible to change the version of Cython that sage -b runs? (it uses 11.1, I need the complex support added in 11.2) There is a ticket to update Cython in Sage at

[sage-support] Re: Bug: big complex numbers

2007-09-05 Thread Mike Hansen
Hello, I posted patches to fix this on http://sagetrac.org/sage_trac/ticket/587 . They should be in sage-2.8.3.3 which was released today. sage - upgrade should do the trick. --Mike On Sep 4, 12:17 pm, mabshoff [EMAIL PROTECTED] dortmund.de wrote: On Sep 4, 5:10 pm, Markus Fraczek [EMAIL

[sage-support] Re: Creating compiled code

2007-09-19 Thread Mike Hansen
Hello Simon, You can import the SAGE functionality you need in your module by just importing the appropriate sage modules into your .pyx file. For example, if you want to use the binomial function, just add from sage.rings.arith import binomial to the top of your .pyx file. --Mike On

[sage-support] Re: Question: What's special about 994?

2007-10-10 Thread Mike Hansen
Hello, The issue is that you are passing in x^2 as a function. Since x is defined by default to be a symbolic expression, then x^2 is also a symbolic expression. Furthermore, when you apply it to a value, you also get a symbolic expression. See this: sage: g = x^2 sage: type(g) class

[sage-support] Re: bug in matrix

2007-10-11 Thread Mike Hansen
Hello, Are you running a 64-bit machine? I looked at the code, and the problem seems to come from the fact that it is doing a naive check on the type of the numpy array; it is currently assuming that your float32 array is a float64 array which is why you are getting the strange results you are.

[sage-support] Re: bug in matrix

2007-10-11 Thread Mike Hansen
from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/ -~--~~~~--~~--~--~--- # HG changeset patch # User Mike

  1   2   3   4   >