[sage-support] Re: Posets or others

2008-04-16 Thread Mike Hansen
On Wed, Apr 16, 2008 at 5:40 PM, kcrisman <[EMAIL PROTECTED]> wrote: > > Dear Group, > > What support is there for posets and/or totally ordered sets in Sage? > It doesn't seem to be in the Reference manual. Nor is it in the > Python documentation, but it seems like in order to do sorting Pyt

[sage-support] Re: Evaluate matrix

2008-04-20 Thread Mike Hansen
Hi Aleks, You can just treat m as any symoblic expression and call it as a function. sage: x,y = var('x,y') sage: m = matrix([[cos(x),0],[0,-sin(y)]]) sage: m [ cos(x) 0] [ 0 -sin(y)] sage: m(x=1, y=2) [ cos(1) 0] [ 0 -sin(2)] sage: m.variables() (x, y) sage: m(1,2) [ cos(1

[sage-support] Re: Python decorators to implement Maple's "options remember"

2008-04-21 Thread Mike Hansen
Hello, Sage already has two decorators that provide this functionality. @func_persist will remember the computed values across Sage sessions since the results are written to a file @CachedFunction just stores the results in memory Note that all of the arguments to the function whose results you

[sage-support] Re: parenthesis matching in notebook environment

2008-04-22 Thread Mike Hansen
Hi, Do you know a good example of an javascript text editor that does this? If you could search around, that would be most helpful. The biggest concern is probably the impact on performance; it's the same issue with things like syntax highlighting. --Mike On Tue, Apr 22, 2008 at 1:21 AM, pong

[sage-support] Re: How to tell the installation script of setup for Sage not to installed python packages

2008-04-25 Thread Mike Hansen
Sage uses Python 2.5 while your system installation looks like 2.4. --Mike On Fri, Apr 25, 2008 at 6:25 PM, Hector Villafuerte <[EMAIL PROTECTED]> wrote: > > On Fri, Apr 25, 2008 at 7:20 PM, Hector Villafuerte <[EMAIL PROTECTED]> > wrote: > > On Wed, Apr 2, 2008 at 6:36 AM, William Stein <[EM

[sage-support] Re: calling SAGE from C or Mathematica

2008-05-06 Thread Mike Hansen
I think you might have an easier time getting Pythonika ( http://dkbza.org/pythonika.html ) to do what you want. --Mike On Tue, May 6, 2008 at 11:41 PM, Amir <[EMAIL PROTECTED]> wrote: > > > Can I start a Sage session from C? I would need to pass commands, set > and get variables, and cleanly

[sage-support] Re: take Sage formulas into MSWord

2008-05-22 Thread Mike Hansen
On Thu, May 22, 2008 at 12:45 AM, roleic <[EMAIL PROTECTED]> wrote: > > I can do html(latex(sage-output)) > What is the best way to import it into MSWord? I don't have Word, but maybe this might be useful: http://www.chikrii.com/ . There is no way to get latex for the input since it only makes s

[sage-support] Re: take Sage formulas into MSWord

2008-05-22 Thread Mike Hansen
Maybe this? http://ooolatex.sourceforge.net/ --Mike On Thu, May 22, 2008 at 2:04 AM, roleic <[EMAIL PROTECTED]> wrote: > > On May 22, 9:56 am, "Mike Hansen" <[EMAIL PROTECTED]> wrote: >> On Thu, May 22, 2008 at 12:45 AM, roleic <[EMAIL PROTECTED]> wrote:

[sage-support] Re: take Sage formulas into MSWord

2008-05-22 Thread Mike Hansen
> With html(latex(sage-output) we get html code, right? And MSWord is > among other things also a html-editor capable of reading and writing > html. So if I could save the sage html code somehow then I could try > whether MSWord can read and display it... > Now I just tested that and of course...

[sage-support] Re: Notebook insecure by default

2008-05-26 Thread Mike Hansen
This issue came up before and is being tracked here: http://trac.sagemath.org/sage_trac/ticket/2827 --Mike On Mon, May 26, 2008 at 4:09 PM, Greg Landweber <[EMAIL PROTECTED]> wrote: > > Hello, > > I just noticed that as of Sage 3.0.1, the notebook has default > secure=False. While that is all we

[sage-support] Re: using parametric_plot for more than one function

2008-05-29 Thread Mike Hansen
Hi Andrew, You can do this by saving the plots to an object and then adding them together. sage: t = var('t') sage: p1 = parametric_plot( (s), sin(2*t)), 0, 2*pi, rgbcolor=hue(0.6) ) sage: p2 = parametric_plot( (cos(t), cos(3*t)), 0, 2*pi, rgbcolor=hue(0.3) ) sage: (p1+p2).show() One can do thi

[sage-support] Re: bar chart fails in pylab

2008-06-01 Thread Mike Hansen
Hi Thomas, The issue comes from Pylab not knowing how to deal with instances of Sage's RealNumber class. When you do "4.0" from the command line, it gets changed into "RealNumber('4.0')". You can see this with the following commands: sage: preparse('4.0') "RealNumber('4.0')" In order to get P

[sage-support] Re: coercion problem?

2008-06-02 Thread Mike Hansen
Hello, This is definitely not a problem with coercion -- it's a problem with the iterator for G. For example. try this: sage: z = iter(G) sage: z sage: z.next() [0 1] [1 0] sage: z.next() [0 1] [1 1] It takes quite a bit of time to do each .next() which makes me suspect that something silly i

[sage-support] Re: Precision Problems

2008-06-20 Thread Mike Hansen
Hello, > while working a little with sage I encountered some problems sage has > concerning numerical precision at very small numbers. > I hope I can make my point with a little example. > > sage: a=1e-175 > sage: log(a) > -402.952391273958 There are a few issues at hand here. First, you have t

[sage-support] Re: Precision Problems

2008-06-23 Thread Mike Hansen
> Mike's solution is ok for the precision but doesn't work for our > little example log(2+a-2), because it still says - infty and in my > application it doesn't fit either. Doing log(2+a-2) instead of log(2-a-2) should work assuming that you have enough precision to avoid the cancellation problem

[sage-support] Re: group rings question

2008-06-29 Thread Mike Hansen
Hello, Sorry I didn't get in on this sooner -- I've been really busy with things this past week. Anwyays, CombinatorialAlgebra is getting a bit of an update, and the changes are on the sage-combinat patch repository. You can see a working group ring here: http://sage.math.washington.edu:8837/h

[sage-support] Re: matrix, Singular -->SAGE

2008-06-30 Thread Mike Hansen
Hello Gema, You just need to run the following: sage: m.sage_matrix(QQ) [-6 5 4 3 0] [ 6 0 -2 -3 1] [ 6 -1 0 -3 2] [ 6 -1 -2 0 3] [-6 1 2 3 0] or you can replace ZZ with whatever ring you want the matrix to be over. --Mike On Mon, Jun 30, 2008 at 8:31 AM, gema m. <[EMAIL PROTEC

[sage-support] Re: variable number of arguments for a function

2008-06-30 Thread Mike Hansen
Hello, In Python you can use *args and **kwds in the function definition to match optional arguments and keyword arguments; args will be a tuple of the arguments and kwds will be a dictionary for the keyword arguments. For example, look at the behavior of the following function: sage: def f(*ar

[sage-support] Re: Accessing terms in an expression

2008-07-02 Thread Mike Hansen
Hi Phil, I don't think there is an official way to get at the terms, but here is something that works: sage: var('x,y') (x, y) sage: t = x^2 + y^2 sage: type(t) sage: t._operator sage: t._operands [x^2, y^2] sage: t._operands[0] x^2 --Mike On Wed, Jul 2, 2008 at 7:49 PM, phil <[EMAIL PROTECT

[sage-support] Re: Debian Etch: Error trying to plot

2008-07-07 Thread Mike Hansen
Hello, In order to figure things out, I think we need to know a bit more about your install. How did you install Sage? Did you use one of the binaries or did you build from source? What processor is your computer running? --Mike On Mon, Jul 7, 2008 at 3:59 PM, Alejandro Jakubi <[EMAIL PROTEC

[sage-support] Re: NTL installation

2008-07-08 Thread Mike Hansen
Hello, What type of machine are you running this on? --Mike On Jul 6, 6:37 pm, Wim Verleyen <[EMAIL PROTECTED]> wrote: > Hello, > > ranlib ntl.a > make[2]: Leaving directory `/home/purplehat/tmp/sage-3.0.3/spkg/build/ > ntl-5.4.2.p3/src/src' > make[2]: Entering directory `/home/purplehat/tmp/sa

[sage-support] Re: solve doesn't always solve

2008-07-08 Thread Mike Hansen
Hi Stan, I don't think there is any other way to solve an equation such as that in Sage. You can do it using Sage's interface to Maple (if you have it installed / access to it), but it's not as clean as it should be due to bug #3610. sage: var('wcnew,epsln,ysnew,delyu,sumsunew,sunlayersnew,dely

[sage-support] Re: problems building matplotlib on Ubuntu 8.04

2008-07-08 Thread Mike Hansen
Hi Adam, Sorry for the delayed reply. I'm not exactly sure what's going on in your case, but I'll ask Michael Abshoff about it since he probably has a much better idea of what is going on. --Mike On Jul 3, 1:33 pm, Adam Webb <[EMAIL PROTECTED]> wrote: > Hi all, > > I have been having problems

[sage-support] Re: problem with sum()

2008-07-10 Thread Mike Hansen
Hello, > this is probably just a silly Python question, but let me try. I've > designed a little class that has a __add__() method, and it works fine > for expressions like x+y. However, sum() does not work on a list of > such objects ! do I need to do something else ? (in the meanwhile i go > re

[sage-support] Re: problem with sum()

2008-07-10 Thread Mike Hansen
> ah. I try to avoid using __repr__ because i was told that this is > supposed to return a string from which the object can be reconstructed > -- and i certainly don't want to go through all that trouble just for > what i need. Do you know what happens if __repr__ simply returns the > same as __st

[sage-support] Re: Performance problem, and a more basic question.

2008-07-15 Thread Mike Hansen
> Very interesting... but, I think you sent me a copy of my worksheet... > Yours, very sincerely While the name is the same, it's a different worksheet. Anyways, here's the faster code: def NewtonInterpolation(x,y,f): poly=f[0] q=1 s=f[0:len(f)] stride=1 for k in range(len(f

[sage-support] Re: Spam bots

2008-07-15 Thread Mike Hansen
On Tue, Jul 15, 2008 at 4:03 PM, Alec Mihailovs <[EMAIL PROTECTED]> wrote: > > Sage seems to be used for creating spam bots. In particular, the FrontPage > in Maple Wiki was corrupted yesterday from 193.53.87.109 with spam ending > with CategorySage, see > > http://mapleadvisor.com/cgi-bin/moin.cg

[sage-support] Re: Spam bots

2008-07-15 Thread Mike Hansen
> Still, the spam text contained it. I don't think that a bot was searching > for the pages in the wiki and randomly chose that one. My guess is that the spam bot wanted to assign its page to a category, and it can easily find the already existing categories on your wiki from http://mapleadvisor.

[sage-support] Re: Spam bots

2008-07-15 Thread Mike Hansen
On Tue, Jul 15, 2008 at 4:55 PM, Alec Mihailovs <[EMAIL PROTECTED]> wrote: > That could happen, with probability 20%. I guess in the end I'm not sure what you wanted to accomplish with this thread. Are you saying that there is an individual associated to the Sage project that is spamming your wi

[sage-support] Re: Sage and Maple

2008-07-15 Thread Mike Hansen
Hello Alejandro, > I would like to transfer these listings to a text file for a better > analysis of this output. Is there a simple way? If you run maple.trait_names(), you'll get a Python list where each entry is a string of the name. To see how that list is created, you'll want to do sage: m

[sage-support] Re: Sage and Maple

2008-07-15 Thread Mike Hansen
>> Note that the list of completions is cached the very first time it is >> created so you may want to delete it from your ~/.sage/ directory. > > I see a binary file maple_commandlist_cache.sobj. Is this one? Yep, that's the one. --Mike --~--~-~--~~~---~--~~ To

[sage-support] Re: Why standalone Python/Sage scripts take longer to run ?

2008-07-19 Thread Mike Hansen
Hi Shing, You can actually make HTTP calls to the Sage notebook using Robert Bradshaw's simple API. For example, the following is a (condensed) Python script which authenticates with a running Sage notebook. import urllib, re def get_url(url): h = urllib.urlopen(url); data = h.read(); h.clo

[sage-support] Re: Plotting and constant functions

2008-08-21 Thread Mike Hansen
> For example, is there NO WAY to draw a horizontal or vertical line > using parametric_plot? This is one way: sage: def xt(t): return t sage: def yt(t): return 1 sage: parametric_plot((xt,yt), -2, 2) --Mike --~--~-~--~~~---~--~~ To post to this group, send emai

[sage-support] Re: Plotting and constant functions

2008-08-25 Thread Mike Hansen
Hello all, > It would be nice if the plotting functions could be fixed. None of > these techniques works (easily) from the user level. I just put a patch up at #3952 which fixes many of these issues. Now you can do things like sage: plot(2, -2, 2) #horizontal line at y=2 sage: parametric_plot

[sage-support] Re: Plotting functions with asymptotes

2008-08-27 Thread Mike Hansen
Hello, On Tue, Aug 26, 2008 at 8:47 PM, kcrisman <[EMAIL PROTECTED]> wrote: > > There have been tons of great improvements to the plotting making > their way through trac lately. Do any of those changes for ranges > etc. deal with the very weird output one gets for e.g. > > sage: plot((x-1)/(x+2

[sage-support] Re: getting a list of points from a plot (was: Plotting functions with asymptotes)

2008-08-27 Thread Mike Hansen
Hi Dan, On Wed, Aug 27, 2008 at 5:13 PM, Dan Drake <[EMAIL PROTECTED]> wrote: > The "Plotting functions with asymptotes" thread reminded me of something > I've wondered for a while: is it possible to get access to the list of > points that a plot object uses? It's easy enough to make up my own li

[sage-support] Re: Plotting functions with asymptotes

2008-08-28 Thread Mike Hansen
Hello, On Thu, Aug 28, 2008 at 6:47 AM, kcrisman <[EMAIL PROTECTED]> wrote: > > Speaking of asymptotes, any ideas on > http://trac.sagemath.org/sage_trac/ticket/3907 > ? I would be glad to try it, but don't understand enough of how > infinity and _tasteful_ticks work in Sage. > ... > Very good!

[sage-support] Re: convert string to sage expression

2008-08-29 Thread Mike Hansen
Hello, On Fri, Aug 29, 2008 at 4:00 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I want to construct a set of equations using strings. For example: > > for i in range(0,10): > eq1="eq=x^"+str(i)+"-"+str(i) Is there a reason why you wanted to do it using strings? It's a bit cleaner/easier

[sage-support] Re: Infinite sum

2008-08-30 Thread Mike Hansen
On Sat, Aug 30, 2008 at 11:15 AM, Robert Dodier <[EMAIL PROTECTED]> wrote: > Dunno if it matters but maybe you can handle this directly in Maxima. > > foo : sum (1/(k + m)^3, k, 1, inf); > > load (simplify_sum); > simplify_sum (foo); > => -psi[2](m+1)/2 > > ev (%, m=2); > => zeta(3)-9/8 > > ev (

[sage-support] Re: Copying/moving worksheets

2008-09-02 Thread Mike Hansen
> Well, that's the thing; once one downloads the new VMWare image and > tries to put the worksheets back where they belong, one still needs to > look for them by hand, which of course would take an insane amount of > time - unless I'm missing something. So upgrading on VMWare is sort > of like mo

[sage-support] Re: Memoizing methods.

2008-09-03 Thread Mike Hansen
Hi Adrian, I wrote some code to do this a few releases ago. It's the cached_method decorator in Sage. Here's your example: sage: class dog(): : def __init__(self, bark='guau'): : self._bark = bark : @cached_method : def bark(self): : sleep(5) ..

[sage-support] Re: Upgrade to version 3.1.1

2008-09-05 Thread Mike Hansen
Hello, > Okay, here's another big problem that seems to have come with version > 3.1.1: > "Edit a copy" doesn't work any more on published worksheets! Sage > makes a copy, but I can't edit it. This is a big problem, as we're > working with several users. I fixed this a few days ago, and it will

[sage-support] Re: Erratic behaviour with "Evaluate All" in a notebook

2008-09-07 Thread Mike Hansen
Hi Stan, On Wed, Sep 3, 2008 at 2:14 AM, Stan Schymanski <[EMAIL PROTECTED]> wrote: > > Has anyone had time to verify if this is a bug? I suspect that it > could be fixed quite easily and I think that it would be VERY helpful > to be able to do "Evaluate All" reliably in a notebook, as this could

[sage-support] Re: variable names for matrix elements

2008-09-09 Thread Mike Hansen
Hello, On Tue, Sep 9, 2008 at 8:03 PM, phil <[EMAIL PROTECTED]> wrote: > > Is there a way to create a matrix whose elements are variables in a > symbolic ring or polynomial ring without naming all the elements > manually? > For example, I've been doing something like: > vars('x11,x12,x21,x22') >

[sage-support] Re: SnapPeaPython

2008-09-10 Thread Mike Hansen
Hello, On Wed, Sep 10, 2008 at 5:45 PM, hypermonkey2 <[EMAIL PROTECTED]> wrote: > unable to execute gcc: No such file or directory > error: command 'gcc' failed with exit status 1 > > any ideas where this gcc problem comes from? It looks like you don't have gcc installed on your system. --Mike

[sage-support] Re: efficient determinant of matrix over polynomial ring

2008-09-10 Thread Mike Hansen
Hello, On Wed, Sep 10, 2008 at 6:23 PM, phil <[EMAIL PROTECTED]> wrote: > This seems to scale very poorly with the number of variables. > Basically, it's impractical to compute determinants when there are > more than 4 variables. While the problem does become more computationally challenging, a

[sage-support] Re: using "=="

2008-09-16 Thread Mike Hansen
Hi Bob, You can use the bool() function to turn an equation in to a True/False value. sage: q,j = var('q, j') sage: a = (2*j*2^(18*q) + 13*2^(18*q)/27 - 13/27) sage: b = (2^(18*q)*(2*j+0)+13*(2^(18*q)-1)/27) sage: a == b 2*j*2^(18*q) + 13*2^(18*q)/27 - 13/27 == 2*j*2^(18*q) + 13*(2^(18*q) - 1)/2

[sage-support] Re: Is there a way to access the unsimplified form of a symbolic expression?

2008-09-16 Thread Mike Hansen
Hi Jason, > So until hit with an explicit simplify command, symbolic expressions > seem retain at least some information about how they were input. Is > there a way to get the input form of an expression back out? Can I > ever get sage to print something like > > sage: (x - x).some_devious_tric

[sage-support] Re: bug in limit()

2008-09-17 Thread Mike Hansen
Hi Alex, > sage: limit(sin(y[0])/y[0],y[0]=0) > > File "", line 1 > SyntaxError: keyword can't be an expression (, line > 1) > > sage: w=x > sage: limit(sin(w)/w,x=0) > 1 > sage: limit(sin(w)/w,w=0) > sin(x)/x This is because keyword

[sage-support] Re: bug in limit()

2008-09-18 Thread Mike Hansen
On Thu, Sep 18, 2008 at 4:54 PM, Alex Raichev <[EMAIL PROTECTED]> wrote: > > Now, with the above in mind, how do you write a function to evaluate > that sine limit given a variable from the user? We know the following > does not work. > > sage: var('x') > x > sage: def limmy(w): > : retur

[sage-support] Re: can't run a script on when using SAGE on Milnix.org server

2008-09-18 Thread Mike Hansen
On Thu, Sep 18, 2008 at 6:02 PM, pong <[EMAIL PROTECTED]> wrote: > > I have written an animation which runs fine in SAGE on my PC. > However, when I run the same script on Milnix.org server, I got an > error message: > > sh: convert: command not found > > what's the problem? any help? This is bec

[sage-support] Re: problem of using surf in SAGE online server 2

2008-09-20 Thread Mike Hansen
Hello, On Sat, Sep 20, 2008 at 3:47 PM, pong <[EMAIL PROTECTED]> wrote: > > >Thanks for the reply. If I want plot an algebraic curve using > SAGE, what should I do then? Any suggestion? For the above example, I would do something like: sage: var('x1,x2') (x1, x2) sage: implicit_plot(x1^3 -

[sage-support] Re: Suggestions for the notebook

2008-09-22 Thread Mike Hansen
Hi Maike, On Mon, Sep 22, 2008 at 3:04 AM, Maike <[EMAIL PROTECTED]> wrote: > > (2) Thanks that sounds good. I'm not sure how to use #auto though, > where do I put this option? You put %auto as the first line of the cell that you want to auto-evaluate. --Mike --~--~-~--~~--

[sage-support] Re: working with rings

2008-09-22 Thread Mike Hansen
Hello, On Mon, Sep 22, 2008 at 11:34 PM, cesarnda <[EMAIL PROTECTED]> wrote: > > If I do: > > sage: MS = MatrixSpace(IntegerModRing(9), 5,5) > sage: G = MS([[5, 0, 0, 0, 4],[4, 5, 0, 0, 0],[0, 4, 5, 0, 0],[0, 0,4, > 5, 0], [0, 0, 0, 4, 5]]) > sage: G.base_ring() > Ring of integers modulo 9 > > is

[sage-support] Re: Suggestions for the notebook

2008-09-23 Thread Mike Hansen
Hello, On Tue, Sep 23, 2008 at 1:21 AM, Maike <[EMAIL PROTECTED]> wrote: > > Okay that's right. But still, #auto doesn't work together with %hide > or %latex, no matter which order I put these commands in, and I need > this feature for my %latex cells, because they're the ones not being > execute

[sage-support] Re: Storing results of solve() function

2008-09-23 Thread Mike Hansen
Hi Andy, On Tue, Sep 23, 2008 at 12:58 PM, Andy <[EMAIL PROTECTED]> wrote: > > I am programming for a project in sage and I want to make use of the > solve() function. However, I noticed that solve() does not return the > value of the solved variable but only a statement instead. > > For instanc

[sage-support] Re: bug in _fast_float_ with plot in sage 3.2.1?

2008-09-25 Thread Mike Hansen
Hi Stan, On Thu, Sep 25, 2008 at 5:27 AM, Stan Schymanski <[EMAIL PROTECTED]> wrote: > from sage.ext.fast_eval import fast_float > bv1=x^3-2*x^2+3*x > bv2=x^4-2*x^3+3 > bv1p=bv1._fast_float_('x') > bv2p=bv2._fast_float_('x') > plot([bv1p,bv2p],0,1) > > Traceback (click to the left for traceback)

[sage-support] Re: question about DiGraph

2008-09-25 Thread Mike Hansen
Hello, On Thu, Sep 25, 2008 at 9:50 AM, pong <[EMAIL PROTECTED]> wrote: > > I'm still having problem in displaying the label of the edges using > DiGraph. I have read more from this group and tried: > > G=DiGraph({1:{1:['hola','hi'], 2:['two','dos']},2:{1:['one']}}, > loops=True, multiedges=True)

[sage-support] Re: Two Dimensional Plots

2008-09-25 Thread Mike Hansen
Hi Erik, On Thu, Sep 25, 2008 at 5:05 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > I'm working my way through the tutorial and I'm having a problem with > one of them. 2.5.1 at this page http://www.sagemath.org/doc/tut/node18.html > has a circle plot, but I keep getting an ellipse on my s

[sage-support] Re: Bug in plot?

2008-09-26 Thread Mike Hansen
Hi Jason, On Fri, Sep 26, 2008 at 9:05 AM, Jason Bandlow <[EMAIL PROTECTED]> wrote: > A student of mine noticed the following and it looks like a bug to me > (at least with the documentation). > This was a regression caused by the reworking of plot.py in 3.1.2. I've added a patch at http://trac.

[sage-support] Re: Bug in plot?

2008-09-26 Thread Mike Hansen
Hi Jason M., On Fri, Sep 26, 2008 at 10:58 PM, Jason Merrill <[EMAIL PROTECTED]> wrote: > You may want to see http://trac.sagemath.org/sage_trac/ticket/4099 for > reference. I removed documentation for .options and .reset for > several plot related functions, since I assumed these features were

[sage-support] Re: formatting not saved in notebooks

2008-09-29 Thread Mike Hansen
Hello, On Mon, Sep 29, 2008 at 7:00 AM, Stan Schymanski <[EMAIL PROTECTED]> wrote: > As of version 3.1.2, plots are saved correctly in notebooks. Thanks to > those that fixed it. However, I noticed that the formatting of cells > beginning with "%hide %html" is not saved. I need to re-evaluate all

[sage-support] Re: long arithmetic

2008-10-01 Thread Mike Hansen
Hi Bob, On Wed, Oct 1, 2008 at 12:01 PM, Bob Wonderly <[EMAIL PROTECTED]> wrote: > My follow up question pertains to the patch you'all hurried up to > create. I know you didn't apply it on my Mac so how do I take advantage > of it? Do I download the latest version of Sage and install it? The > ve

[sage-support] Re: Matrix inverse with symbols as elements

2008-10-07 Thread Mike Hansen
Hello, On Mon, Oct 6, 2008 at 6:50 PM, SK <[EMAIL PROTECTED]> wrote: > Now, I try and compute X * (X^(-1)). Instead of getting an identity > matrix, I get a complicated matrix in x, y and z. Thinking that the > "^" may be the issue, I tried X * (X.inverse()), but got the same > issue. > > Am I do

[sage-support] Re: Using Sage with a large number of undergraduate students.

2008-10-07 Thread Mike Hansen
Hello, On Tue, Oct 7, 2008 at 1:15 PM, Jason Grout <[EMAIL PROTECTED]> wrote: > To sum up the discussion about what makes things slow, is it a > file-locking bottleneck with the sage server? I don't think anyone has done any serious profiling of the notebook so I think that conclusion is quite a

[sage-support] Re: math range error on sqrt()

2008-10-10 Thread Mike Hansen
Hi John, On Fri, Oct 10, 2008 at 10:36 PM, john_perry_usm <[EMAIL PROTECTED]> wrote: > I'm working with a biologist on some data, and having trouble getting > SAGE to solve quadratic polynomials with complicated coefficients. > Using solve() returns nothing even when there is a solution, perhaps

[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

[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 typ

[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 - 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) load(simpli

[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) > > > 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 e

[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 > e

[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/rings/re

[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 effec

[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-suppor

[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 len(ar

[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) integrate

[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? [Subdirecto

[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

[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

[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 yo

[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 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 count the > numb

[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 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 > written? I will be l

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

2008-12-15 Thread Mike Hansen
Hello, On Mon, Dec 15, 2008 at 11:48 AM, Simon King wrote: > I guess Sonny refers to the original post, where the following > conditions are stated: >> - (a_i,b_i) \neq (a_j,b_j) for i, j different >> - a_i, b_i >= -1 >> - a_i+b_i > 0 > > Are they implicit in your code? I don't see it, I'm afrai

[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 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 compliants: > >

[sage-support] Re: Assigning

2008-12-22 Thread Mike Hansen
On Mon, Dec 22, 2008 at 6:12 AM, Timothy Clemans 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 assign something

[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 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 directly. Well, I

[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 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 think this is

[sage-support] Re: problem running combinatorial functions

2009-01-08 Thread Mike Hansen
Hello, Sorry for coming in late on this. One should really use the Combinations constructor as it is much better behaved as it doesn't use the GAP interface. sage: Combinations([1,2,3,4],2).list() [[1, 2], [1, 3], [1, 4], [2, 3], [2, 4], [3, 4]] sage: Combinations([1,2,3,4],2).count() 6 We sho

[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 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 set containing t

[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 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, -19.6, -11.

[sage-support] Re: Equivalent to matlab's plot(x,y,'ok')

2009-01-15 Thread Mike Hansen
Hello, On Thu, Jan 15, 2009 at 1:54 AM, bgbg. bg wrote: > Hello, > consider the following matlab code: > > x = [1,2,3,4]; > y = [2,3,4,5]; > z = [4,3,2,1]; > figure(1); > plot (x,y, 'ok'); > figure(2); > plot3(x,y,z, 'or'); > > what should I use in sage notebooks in order to achieve similar figu

[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 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 "/home/fabio/programs/source/sage-3.2.1/devel/sage" && hg im

[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 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 post to this gro

[sage-support] Re: sage simplification

2009-01-20 Thread Mike Hansen
Hi Ben, On Tue, Jan 20, 2009 at 1:46 AM, ben 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 --~--~-~--~~~---~--~~ To post

  1   2   3   4   5   >