Ask Your Question

twch's profile - activity

2020-04-23 21:10:06 -0600 received badge  Famous Question (source)
2020-02-07 12:08:33 -0600 received badge  Good Answer (source)
2020-01-15 15:35:41 -0600 received badge  Nice Question (source)
2018-06-12 16:00:26 -0600 received badge  Notable Question (source)
2018-06-12 16:00:26 -0600 received badge  Popular Question (source)
2018-06-07 09:50:35 -0600 received badge  Nice Question (source)
2017-10-09 09:06:48 -0600 received badge  Good Answer (source)
2017-08-01 05:15:03 -0600 received badge  Notable Question (source)
2015-12-21 21:41:22 -0600 received badge  Famous Question (source)
2015-11-28 15:12:33 -0600 received badge  Taxonomist
2015-10-25 01:32:28 -0600 received badge  Famous Question (source)
2015-05-22 13:53:22 -0600 received badge  Popular Question (source)
2014-11-27 06:49:57 -0600 received badge  Notable Question (source)
2014-08-29 04:23:04 -0600 received badge  Popular Question (source)
2014-06-28 20:15:49 -0600 marked best answer Working with pre-releases


it has been recommended (here) to post patches based on and test them against the most recent pre-release. As they come quite frequently I wanted to know what's the best way to install and work with them:

Do you regularly rebuild them and always work with the current pre-release?

Do you only use them for developing and have an additional stable release for your ordinary work?

What do you do with the older versions? Can one just delete them?


2014-06-28 20:15:43 -0600 marked best answer What tests are useful while reviewing a patch if the patchbot report is already positive?


the sage developer guide lists several tests that should be performed manually during the review process, like a complete doctest, building the documentation and checking coverage. Are all these test necessary and useful, if the patch bot already reported, that the patch has been positively tested against the latest pre-release? Or can some be simply skipped because they are already checked by the bot? What does the bot actually check?

2014-06-28 20:15:37 -0600 marked best answer load animation

Hi, I have the following problem:

I'd like to present some calculations in a sage notebook. At one point I'd like to show an animation, but unfortunately it takes some time until the .show() command plots it. I also do not like to have the animation wiggling araound while I'm presenting the other things before. Hiding the output also doesn't help because I want that it really starts from the beginning on my click and not soemwhere in between.

Is there a possibility to load a saved gif animation? Otherwise is is still possible to open the animation in new window, but it would be neat to have the animation inside the notebook.

2014-06-28 20:15:13 -0600 marked best answer How to add path on sage startup


Is there a possibility to add a user defined path to the standard sage paths? I can add the path by typing

sage: import sys

sage: sys.path.append('mypath')

and everything works fine. But I don't like to do it all the times by hand but rather have the path added as standard.

I thougth about writing a bash wrapper skript but

export PATH=$PATH:mypath

seems to have no effect and be overwritten after sage startup.

2014-06-28 20:14:58 -0600 marked best answer check whether object is matrix


I would like to check whether an object is a sage matrix. I thought that "isinstance" might help, however isinstance is a little bit too sensitive for my purpose as the following example shows:

print type(m1)
print isinstance(m1, sage.matrix.matrix_generic_dense.Matrix_generic_dense)
print type(m1)
isinstance(m1, sage.matrix.matrix_generic_dense.Matrix_generic_dense)


<type 'sage.matrix.matrix_generic_dense.Matrix_generic_dense'>
<type 'sage.matrix.matrix_integer_dense.Matrix_integer_dense'>

I would however like to obtain a function which recognizes a matrix regardless to the types of its entries.


doesn't work either but gives the error: "isinstance() arg 2 must be a class, type, or tuple of classes and types"

So what else can I do?

Thanks for your answers, Tobias

2014-05-07 14:27:34 -0600 received badge  Nice Question (source)
2013-12-06 11:56:03 -0600 received badge  Enthusiast
2013-11-11 07:44:51 -0600 commented question Is there a way to store and sync the files from sage cloud on local hard drive?

I had a similar question( and Wiliams answer about syncing via github coud be of interest for you, though I would really love to sync directly via ssh or something similar.

2013-11-07 00:18:23 -0600 received badge  Critic (source)
2013-11-03 04:23:21 -0600 commented question How to input data in SAGE and deal with them

Maybe also the answers in this ( related questions are helpful.

2013-11-01 03:36:13 -0600 answered a question Why Sage cannot pass a value of variable from one function to another nested function?

You can avoid this problem if you don't use a symbolic function but define a python function:

sage: var('n')
sage: def g(x,k):
sage:    return sum((2/n)*(sin(n*x)*(-1)^(n+1)), n, 1, k)
sage: print g(x,2)
-sin(2*x) + 2*sin(x)
2013-11-01 03:26:21 -0600 received badge  Commentator
2013-11-01 03:26:21 -0600 commented answer Why Sage cannot pass a value of variable from one function to another nested function?

I agree with kcrisman that at first sight the result seems to be ok and only be presented in a different form. But as the example sage: g(x)=(2/n)*(sin(n*x)*(-1)^(n+1)) sage: f(x,k) = sum((2/n)*(sin(n*x)*(-1)^(n+1)), n, 1, k) sage: (f(x,2)-sum(g, n, 1, 2)).full_simplify() doesn't return zero I would call this a bug.

2013-10-21 07:35:22 -0600 marked best answer Accessing cloud via ssh

You currently can't ssh into projects on cloud.sagemath, except by setting up a reverse ssh tunnel (see, e.g., This requires having another server that you control that you can ssh to (and enable ssh reverse tunneling on).

The way I typically solve the problem "sync a folder with some sage scripts on my PC with the cloud" is to put those files under revision control using git, then make a public (or private) github project and push the files there. Then you can push/pull all the files between your cloud.sagemath project, github, and your PC. This has some advantages over using rsync like you suggest in your question above: (1) now there are 3 copies of your scripts, so it is less likely that you'll loose something, (2) you'll never get confused about which version is which, and if you make changes to scripts both in cloud and on your PC, git will automatically merge those changes, (3) it's more secure, e.g., if your cloud.sagemath account were hacked, then only your github project(s) are compromised, rather than your home PC, and vice versa.

As an example, this github repo is actually tied to a cloud project:

-- William

2013-10-18 02:38:48 -0600 asked a question Accessing cloud via ssh


is it possible to log in to the home folder of a cloud-project via ssh? I found this in the FAQ of cloud.sagemath but it didn't help me very much :(

What I really would like to do is to sync a folder with some sage scripts on my PC with the cloud so I'm looking for something like:

rsync --delete -avze ssh ~/Sync/

So if ssh login is not possible also other possibilities to sync folders are welcome.

2013-10-11 02:17:17 -0600 received badge  Notable Question (source)
2013-09-08 00:29:06 -0600 marked best answer Working with pre-releases
  1. I build them only once in a while. And I build a recent prerelease only if needed.
  2. Almost all releases, including prereleases, are quite stable. But I usually keep one version of sage, whether prerelease or release, that I know is stable and that I can use for my work.
  3. Any time I have more than two versions installed, I delete the older ones.
  4. I use ccache, and have moved to a system installation of atlas to reduce build times.