Ask Your Question

burningbright's profile - activity

2020-11-21 11:11:53 +0100 received badge  Notable Question (source)
2020-10-11 03:45:20 +0100 received badge  Famous Question (source)
2020-10-11 03:45:20 +0100 received badge  Notable Question (source)
2020-10-11 03:45:20 +0100 received badge  Popular Question (source)
2018-03-09 22:15:23 +0100 received badge  Popular Question (source)
2017-02-22 08:00:35 +0100 received badge  Notable Question (source)
2017-02-22 08:00:35 +0100 received badge  Popular Question (source)
2016-02-12 23:54:30 +0100 received badge  Famous Question (source)
2015-06-06 00:33:04 +0100 received badge  Famous Question (source)
2014-02-08 10:20:09 +0100 received badge  Notable Question (source)
2014-01-20 19:07:13 +0100 received badge  Notable Question (source)
2013-08-01 19:32:56 +0100 commented answer notebook version login

Oddly, "" still thinks I'm running sage 10.4. But I can get in using my account and it doesn't really seem to matter.

2013-08-01 19:23:22 +0100 commented answer notebook version login

I moved my pre-existing .sage to .sage_old. Deleted the entire sage-5.10 folder, reinstalled it fresh from the tarball and let it make a new .sage area. However, I still get the same error message: the notebook looks for firefox at the old location and bombs. So as a kludge for now, I added a symbolic link at the old location of firefox, pointing to the new location. This works, and at least I don't have to ask IT to wipe my entire account back to defaults. And I can indeed get to my old notebooks with notebook(.../.sage_old/sage_notebook.sagenb"), so I'm happy. "Symbolic links - the duct tape of Linux".

2013-08-01 14:52:50 +0100 commented answer notebook version login

And it looks like I should back up $HOME/.sage/sage_notebook.sagenb first to hopefully get back the notebooks I neglected to explicitly save to .sws format ...

2013-08-01 14:35:29 +0100 commented answer notebook version login

This gives the same error. Yes, all I really want is to get the local notebook working again. Reading more closely, the notebook command is looking for firefox in its install location on the old box, not the new box. I think I need to delete the entire $HOME/.sage area (which contains a number of files from the older install) and reinstall sage from scratch again. Not sure if this explains all of these issues - will report my results.

2013-08-01 12:45:20 +0100 asked a question notebook version login

I'm moving to a new linux box. Old box had Sage 5.4. Installed Sage 5.10 on the new box. When I type

sage -notebook

the text says to open my web browser to http://localhost:8080. Doing this in Firefox, I get a login page. It says 'Sign into the Sage Notebook 5.10'. My standard sagenb login name and password do not work. To check this, I opened another tab on the browser and went to This gives a similar looking page, except now it says "Sign into the Sage Notebook 5.4' instead of 'Sage 5.10'. And the Sage logo on the top left says Sage 5.4 instead of 5.10. Here my standard sagenb name and password DO work. I can see several old notebooks I must have created when learning Sage.

One issue may be that, since the IT staff moved over my old home directory, I still have my original settings. I checked my $HOME/.tcshrc, for example, but there is nothing here related to the browser. (I did change SAGE_ROOT to point to the new sage install and sourced the file - the "sage" command itself works fine).

So why does still point me to 5.4? And why can't I log onto the 5.10 version? Checked the FAQ section, etc. Thanks.

2013-07-25 17:32:47 +0100 received badge  Popular Question (source)
2013-03-27 15:38:58 +0100 received badge  Popular Question (source)
2012-10-15 20:15:10 +0100 asked a question interface to MPFI

Thanks to the Sage team for providing an interface to the MPFI package for arbitrary precision interval arithmetic. It looks like the MPFI version used in Sage is 1.5.1, the most recent. Reading the included info file, there are references to additional functionality such as extended interval division, which would be useful for implementing extended interval Newton and related numerical methods. I can't tell if this is available in MPFI 1.5.1 and does not yet have a wrapper in Sage (not complaining!), or will only be "available soon" in MPFI as the file states.

Since I can't find any information at any MPFI site (Mon français n'est pas très bon), does anyone know if or when the extended interval arithmetic functions will be implemented in MPFI? And this looks like it would be quite a job to get into Sage as well. For example, currently:

      [-infinity .. +infinity]

The extended interval division of this would be the (sharper bound) union of two intervals:

     [-infinity .. -1] <union> [1 .. +infinity]

which would seem to require a data structure to hold multiple RIF objects. A numerical algorithm can then detect this split, perform iterations on both parts, and (ideally) find all solutions to the original problem without multiple starting points. This could get messier in higher dimensions since multiple intervals now become multiple boxes, cubes, and hypercubes.

I see that MPFI or something does solve systems of equations over RIF:

      A = matrix([[RIF(2,2.1), RIF(1,1.1)],[RIF(1,1.1),RIF(2,2.0)]]); A
      [2.1? 1.1?]
      [1.1?    2]

      b = vector([RIF(1,1.1),RIF(1,1.1)]); b
      (1.1?, 1.1?)

      x = A\b
      (0.230244068953746, 0.426562500000001)
      (0.259218749999999, 0.447175285884964)

which is very nice, but also breaks down if the determinant of the matrix is an interval that includes 0, resulting in all infinities for the solution. There is an entire area of numerical linear algebra now devoted to solving these problems, which I'm interested in implementing. I might be able to handle the extended interval arithmetic with my own generalized Python classes, but it's better to use whatever standards are being developed.

2012-09-28 17:39:30 +0100 received badge  Scholar (source)
2012-09-28 17:39:30 +0100 marked best answer print LaTeX in notebook from script

I think you need to upgrade your version of Sage. Many of the commands in your script work for me, either with Sage on my own computer or with sagenb on line. For example,

def show_all():
  y = var('y')
  x = 2.0*y**2
  print MathJax()(x)

prints x nicely four times.

For decimal expansions, you can force the coefficient to have lower precision:

def show_all():
  y = var('y')
  x = 2.0*y**2
  a = RDF(2.0)
  a = a.n(digits=3)
  x = a*y**2

For me, this prints "2.00000000000000y^2" and "2.00y^2" (formatted nicely).

2012-09-28 17:39:19 +0100 commented answer print LaTeX in notebook from script

I'm using Sage version 5.2. Will post an update when I get 5.3 installed. Thanks.

2012-09-27 19:35:22 +0100 asked a question print LaTeX in notebook from script

I've read through

but still can't seem to find the equivalent to using "view" or "pretty-print" to display equations at LaTeX in a notebook cell when running a Python script from the notebook. (I do have "Typeset" checked at the start of the notebook.) For example, suppose my file has a function:

def show_all(self):
  y = var('y')
  x = 2.0*y**2
  print JSMath()(x)
  print JSMath().eval(x)
  print html(JSMath()(x))
  print html(JSMath().eval(x))

Running this function from a notebook cell returns lines of the form either

  \newcommand{\Bold}[1]{\mathbf{#1}}2.0 \, y^{2}


  \newcommand{\Bold}[1]{\mathbf{#1}}2.0 \, y^{2}

But I just want a nice LaTeX display of 2y**2 equivalent to typing (from a notebook cell)


which returns

2.00000000000000y2 (prettier than this of course)

So I'm still missing the right combination of LaTeX library functions. As a follow-up question, is dealing with LaTeX macros the only way to get the "2.00000000000" in the above to display as 2.0, 2.00, etc.?

2012-09-18 14:25:37 +0100 answered a question another "how to debug" issue

These days, my solution is just to write code under sage in pure python (.py), not .sage files, and avoid the obfuscation of the Sage pre-processor. This way my code is always immediately exportable out of the sage environment (with import statements as necessary).

2012-08-23 11:28:58 +0100 answered a question Tk development library for matplotlib backend

Thanks for the link. The rpm's were close but did not match my exact box. I had to go to our IT staff to get the precisely correct rpm. Still waiting for one distribution to rule them all.

2012-08-20 18:01:12 +0100 asked a question Tk development library for matplotlib backend

I am following the instructions at to install the backend TkAgg for Sage's matplotlib. However, there is a missing step since the instructions assume that the Tk development libraries are already installed.

I am installing on a Red Hat Enterprise box behind a corporate firewall, so I am looking for a file to download with a name something like tk8.5-dev.tar. From there I can configure and make. I cannot find any such download on the web using Google or Bing. I can find downloads in the form of a .deb Debian package at (which I believe is a binary file and so not usable on my system), but no source code tarball or rpm.

The answer to this question at is specific to another flavor of Linux (use apt-get), which does me no good. Other questions on this site such as just point back to the FAQ or the install page I referenced above.

Not trying to be nasty, but can I emphasize that solutions in the FAQ and the instructions should be as general as possible, and not only for one kind of system. All Linux varieties can work with tarballs. And please, I don't want to start a flame war on what's the best distro. Thanks.

2011-12-14 17:29:38 +0100 commented answer another "how to debug" issue

Yes, avoiding the global namespace in even my highest level code files would solve the problem of interference from the workspace. I do try to use modular code and classes as much as possible, but currently there's still a lot of junk in my main routine, which is then treated like global variables when other code is subsequently called. Something to thing about. Variable isolation would help with other common code development bugs, such as forgetting to initialize a variable in code because it runs using a pre-existing variable in the workspace.

2011-12-14 12:12:15 +0100 received badge  Nice Question (source)
2011-12-14 10:40:49 +0100 received badge  Supporter (source)
2011-12-14 10:39:36 +0100 answered a question another "how to debug" issue

Good advice.

Using %debug after the bug occurs does not help, still can't get any more information. Have not tried a trace.

Another approach I will try is to use ipython's "who" and look for a variable name used in both files.

Thanks to all.

2011-12-13 15:51:42 +0100 received badge  Student (source)
2011-12-13 15:38:50 +0100 asked a question another "how to debug" issue

I primarily use Sage for numerical computation, working with numpy, scipy, gsl, R, etc. as well as my own interfaces to external software. Symbolic computing won't do much good on the types of problems I'm working on. I use Sage to have access to a wider variety of plotting options, as well as the wrappers and glue code. If it were possible, I would turn off symbolic computing completely as unnecessary overhead.

I've recently discovered that when running program 1 (say aaa.sage) followed by program 2 (bbb.sage), I get the not unusual error TypeError: unable to simplify to float approximation

So I know I just need a float() somewhere to convert a symbolic value. If I exit Sage and start again, each program runs fine alone. It's only when the one is executed after the other that the error occurs. (I assume there's a way to clear the workspace without exiting, but I can't currently find it in the documentation).

The problem is Sage does not say where the error occurs. We've all seen the standard generic error pointing to: exec(preparse_file(open(fpath).read()) + "\n", globals)

I now have large files of developed code and don't know how to find the offending line without laborious use of print statements. Any suggestions?