2022-06-06 14:54:52 +0200 | received badge | ● Popular Question (source) |
2022-06-06 14:54:52 +0200 | received badge | ● Notable Question (source) |
2021-07-25 17:40:22 +0200 | received badge | ● Notable Question (source) |
2021-03-10 22:35:34 +0200 | received badge | ● Popular Question (source) |
2020-10-14 17:08:06 +0200 | received badge | ● Notable Question (source) |
2017-06-09 20:02:43 +0200 | received badge | ● Popular Question (source) |
2016-11-24 07:32:50 +0200 | received badge | ● Popular Question (source) |
2016-10-01 16:20:59 +0200 | received badge | ● Guru (source) |
2016-10-01 16:20:59 +0200 | received badge | ● Great Answer (source) |
2016-02-02 17:37:58 +0200 | received badge | ● Famous Question (source) |
2015-01-13 22:08:36 +0200 | received badge | ● Taxonomist |
2014-06-29 03:15:05 +0200 | marked best answer | How to save a list to a file, with sage objects in it? Hi, I am trying to save intermediate step of my calculation into a file, so that next time I can read the file to resume the calculation. Say, I need to save How to save s to a file? I tried two ways: (1) Standard python module pickle cannot save sage objects, thus fails (2) I converted s to a python object: Now I can use s.save('file_name'). However, there is a bug that I cannot load using load('file_name') RuntimeError: unknown function 'a' in archive It is a known bug: http://trac.sagemath.org/sage_trac/ti... . Unfortunately I am not expert enough to fix that bug, and I really want to get my work done before waiting for the fix. Is there any other way to save the list s currently? In the bug report it is mentioned that an older version of Pynac doesn't have this bug. If there is no other work around, is it possible to downgrade Pynac within sage or I have to downgrade the whole sage? Thanks! |
2014-06-29 03:15:05 +0200 | marked best answer | How to robustly simplify an object (including a number) Hi, When writing a package, I met the following problem: Say, I want the variable 'a' to be an expression, which is passed to the package by user. Then I want to call a.simplify() to simplify the expression. However, as an input, a could naturally be the following cases: a.simplify() will work on 1, but not work on 2 or 3, which crashes the whole package. I could do something as But this really seems like a workaround instead of something formal. Is there a better way to handle this case? Thanks! |
2014-04-30 20:45:13 +0200 | received badge | ● Notable Question (source) |
2013-07-23 22:59:46 +0200 | received badge | ● Nice Question (source) |
2013-04-01 14:39:06 +0200 | received badge | ● Popular Question (source) |
2012-03-07 21:55:43 +0200 | received badge | ● Great Answer (source) |
2012-03-07 21:55:43 +0200 | received badge | ● Guru (source) |
2012-01-09 07:56:29 +0200 | commented answer | Does or will Sage support the Visual Python module? Alternatively, I like to do things the other way round. Write a Python (2.x) package and use "from sage import *" to use sage functions. Then it should work with everything. |
2012-01-07 03:57:32 +0200 | received badge | ● Nice Answer (source) |
2012-01-06 12:44:22 +0200 | answered a question | Min and functions You can at least do it in another way: But concerning your original post, it really looks like a bug. I am not expert enough. If it is indeed a bug, we should report it. |
2012-01-05 05:13:22 +0200 | received badge | ● Necromancer (source) |
2012-01-04 15:26:21 +0200 | received badge | ● Nice Answer (source) |
2012-01-04 08:01:50 +0200 | answered a question | How to do mul(function, i=1..n); like in Maple? I agree with @Daniel Krenn that this is a problem that range() is a function in python, not the level of sage. Thus range(var('n')) does not work. I also met similar cases recently. Thus I believe this case is not rare and it would great if someone improve the situation to have something more consistent. How I solved the problem is use a workaround: sum over a list instead of sum directly. The code is as follows: It takes me a long time to test H(121,4). I can run H(21, 4) or other a few small numbers, but they always return 1. I am not sure is it the desired answer. But at least it returns something. Could I also suggest something: when asking a question, it would be better to isolate the problem into as simple case as possible. Then it may be easier for other people to debug and you can get better and quicker answers. For example, with the definition of S, the following already gives an error: |
2012-01-02 13:15:59 +0200 | received badge | ● Commentator |
2012-01-02 13:15:59 +0200 | commented answer | subs_expr with e^t @kcrisman : Thanks for the suggestion. I will try to make a patch to the doc. |
2012-01-02 11:57:40 +0200 | received badge | ● Good Answer (source) |
2012-01-02 11:26:17 +0200 | received badge | ● Nice Answer (source) |
2012-01-02 08:55:29 +0200 | answered a question | subs_expr with e^t Use a wild card (a variable that matches everything) to do complicated subs_expr. I would suggest this technique to be written in sage tutorials. It is very useful to me. |
2011-12-28 08:58:01 +0200 | commented answer | CLI System Requirements Archlinux is another option. Because archlinux package is .tar.xz (with pkgbuild though), one can unzip it to anywhere. It has sage as well. |
2011-12-28 06:00:03 +0200 | received badge | ● Enlightened (source) |
2011-12-28 06:00:03 +0200 | received badge | ● Good Answer (source) |
2011-12-22 13:04:25 +0200 | commented question | "Evaluate All" keyboard shortcut It would be nice to have such a feature. Currently I hold shift and press as many enters as number of cells :-) |
2011-12-22 08:04:16 +0200 | commented answer | Is it possible to edit the content of an expression by hand? @DSM: Thank you very much! I think as long as it seems an open question, I cannot expect a better answer before Sage is improved. Thus I mark this answer as the correct solution. I think both (1) and (2) are fine enough work arounds for my purpose. Also, I am very glad to find I have learnt how to use the star operator in Python from your post:-) |
2011-12-22 08:00:27 +0200 | marked best answer | Is it possible to edit the content of an expression by hand? Here are several non-answers, in random order of craziness and/or workingness (which isn't a word, but you know what I mean.) All of them are dangerous and/or will break in many important cases. I'm posting them more as possible directions to follow up than as anything that anyone would actually use. (1) If you're willing to live with a DeprecationWarning, the following should do most of what you want: After which the D operator kind of works: (2) You could simply define a print function to make sure that you get the output in a form you can re-enter (i.e. one with diffs). Here I'll cheat a little and use the existing maxima printing: (3) You can play games with FDerivativeOperator's repr, but I couldn't get this to work because of the way Expressions print. Namely: I can change the name that the operator itself has, but that doesn't seem to be used along the Expression printing path. I always get lost in the code at this point, so this is kind of a wash. But I feel like something along these lines should work, even though it doesn't seem to. If I actually needed to do something like this I would probably use a variant of (2). I can't help but wonder if there isn't a better way to accomplish ... (more) |
2011-12-22 07:59:48 +0200 | commented question | Is it possible to edit the content of an expression by hand? @kcrisman: Thanks for your comment. I met a few inconvenient cases where a general function is treated very differently from a variable. Seems I am a stranger here who always use a general function to produce troubles :-) |
2011-12-21 23:14:08 +0200 | received badge | ● Autobiographer |
2011-12-21 23:06:22 +0200 | edited question | Is it possible to edit the content of an expression by hand? Hi, Is it possible to edit an expression by hand? I know some terms in my calculation are not important and want to delete them by hand before the next step. However, I didn't find a way to do that. To be explicit, is there a function to print the sage output in terms of an input form (like the Mathematica InputForm[] function), so I can edit and evaluate it again? For example, I want to delete the "+1" in the output and save the "D[0](f)(t)^2 + 2*D[0](f)(t)" in another variable. Is it possible to do that? Directly write doesn't make sense. Sage says 'D' is not defined. |
2011-12-21 22:55:20 +0200 | answered a question | How do I understand the result of symbolic integrals Incomplete Gamma function and the Ei function are indeed related. See the following pages for example. http://en.wikipedia.org/wiki/Exponent... http://en.wikipedia.org/wiki/Incomple... In this sense, the result of the integration is correct. There is indeed a subtly of brunch cut. Maxima / Sage defines the brunch cut of the function differently from Mathematica. I tested the Maxima result "-1/x + Ei(x) - gamma(-1, -x)" is indeed continuous on the complex plane (i.e. the result has no problem). But the same function in Mathematica is not continuous. |
2011-12-21 22:35:00 +0200 | commented question | Is it possible to edit the content of an expression by hand? BTW, I asked a similar question two days ago without answer. I feel my question maybe not clear. Thus here I ask again. I deleted the original question in order not to pollute the forum. Thank you! |