Ask Your Question

Erel Segal-Halevi's profile - activity

2019-08-10 08:33:11 -0500 received badge  Notable Question (source)
2019-04-25 14:42:36 -0500 received badge  Notable Question (source)
2018-12-27 00:07:29 -0500 commented question Cannot install SageMath on Ubuntu 16.04: "Maximum recursion depth exceeded"

@nbruin I put all the error messages that I saw. Where can I find more detailed messages?

2018-12-26 11:56:46 -0500 asked a question Cannot install SageMath on Ubuntu 16.04: "Maximum recursion depth exceeded"

I have Ubuntu 16.04. I downloaded the binary file "sage-8.4-Ubuntu_16.04-x86_64.tar.bz2", extracted it with:

tar jxf sage-8.4-Ubuntu_16.04-x86_64.tar.bz2

then went into the folder and ran sage:

cd SageMath

I got the following error:

RecursionError: maximum recursion depth exceeded during compilation
It seems that you are attempting to run Sage from an unpacked source
tarball, but you have not compiled it yet (or maybe the build has not
finished). You should run `make` in the Sage root directory first.
If you did not intend to build Sage from source, you should download
a binary tarball instead. Read README.txt for more information.

I don't think I should run make, since I downloaded a binary version, but I tried anyway and got a similar error:

RecursionError: maximum recursion depth exceeded during compilation
Makefile:31: recipe for target 'base-toolchain' failed
make: *** [base-toolchain] Error 1

I found some notes saying that it might be related to the Python version. I have both 3.7 and 2.7. Should I somehow tell SageMath to use 2.7? How?

Alternatively, is there another possible source for this error?

2018-12-11 22:41:14 -0500 asked a question Verifying inequalities

I would like to give SageMath some inequalities, and then ask it if other inequalities follow from them.

For example, I would like to tell SageMath "a > 2b > 0" and then ask it whether "a - b > b/2" and the answer should be "True", but if I ask whether "a - b > 3b/2" the answer should be "False" (since it is not implied by the given inequalities).

How can I do this?

2018-11-30 20:20:56 -0500 received badge  Famous Question (source)
2018-03-16 16:14:58 -0500 received badge  Famous Question (source)
2018-02-07 15:55:51 -0500 received badge  Popular Question (source)
2017-09-13 15:15:06 -0500 received badge  Notable Question (source)
2017-08-02 16:55:05 -0500 received badge  Notable Question (source)
2017-06-22 21:35:08 -0500 received badge  Popular Question (source)
2017-06-13 15:50:10 -0500 received badge  Popular Question (source)
2017-05-02 17:27:59 -0500 received badge  Popular Question (source)
2017-03-24 20:01:56 -0500 received badge  Popular Question (source)
2017-02-25 12:29:12 -0500 received badge  Popular Question (source)
2017-02-15 12:47:22 -0500 received badge  Famous Question (source)
2016-11-22 01:22:58 -0500 received badge  Nice Question (source)
2016-11-14 03:41:16 -0500 asked a question Using a python 3 class in SageMath

I wrote a class that uses some python 3 features (specifically, functools.lru_cache).

When I try to import it into my SageMath notebook, I get errors, since the notebook runs on Python 2.7.

I read in this FAQ: that the answer to the question "Can I use Sage with Python 3.x?" is: "Currently, no. Sage depends on the SciPy stack of Python numerical and scientific packages. As of 2010, SciPy still uses Python 2.x. So until SciPy is ported to run with Python 3.x and Cython supports Python 3.x, Sage will continue to use Python 2.x."

But, this answer is from 2010. Now it's 2016, and SciPy already supports Python 3.

So, my questions are: * Is it possible now to use SageMath with Python 3 * If not, is there a workaround I can use to import my class to SageMath notebook?

2016-10-24 07:20:11 -0500 received badge  Good Question (source)
2016-10-24 07:20:04 -0500 received badge  Popular Question (source)
2016-10-10 14:45:29 -0500 marked best answer Simplifying a simple rational function

The following code:

simplify((d^(T + 1)-d)/d)


(d^(T + 1) - d)/d

Apparently, this should be simplified to:

d^T - 1

What am I doing wrong?

2016-08-19 06:03:14 -0500 asked a question How to speed up running SageMath programs

I am writing a SageMath program that I want to run from within the editor (I use Atom editor, with a plugin that enables me to run sage). Whenever I run a script, it takes about 1.5 seconds, even if the script only writes "hello world". In contrast, when I run the same script using Python, it takes only 0.04 seconds.

is there a way to run SageMath scripts faster?

2016-06-23 05:21:34 -0500 commented answer Finding an assignment that satisfies a set of inequalities

I read the manual about linear programming, but, apparently it talks about maximization problems. I am not interested in maximization - I only want to find a single assignment that satisfies the inequalities. Can you show me how to solve a simple example, e.g, "find x and y such that x<y and y<3"?

2016-06-23 03:12:33 -0500 received badge  Popular Question (source)
2016-06-06 14:44:08 -0500 received badge  Notable Question (source)
2016-05-18 18:42:12 -0500 received badge  Popular Question (source)
2016-05-18 18:42:12 -0500 received badge  Notable Question (source)
2016-04-16 08:49:51 -0500 received badge  Popular Question (source)
2016-03-20 08:34:01 -0500 received badge  Nice Question (source)
2016-03-16 12:04:02 -0500 commented answer Checking if two inequalities are equivalent

So I have to tell it explicitly that $x>y$ is equivalent to $x-y>0$? And then tell it again that $y>z$ is equivalent to $y-z>0$, etc.?

2016-03-14 00:40:50 -0500 marked best answer output.txt not updated

I made some calculations in the SageMath notebook and got a message "WARNING: Output truncated! " with a link to "full_output.txt".

Then, I made some changes and ran the same calculation again. I got a similar message, but when I clicked the link, I saw the old full_output.txt file - without my changes.

How can I tell SageMath notebook to stop caching the file and create a fresh file?

2016-03-13 08:06:41 -0500 asked a question Checking if two inequalities are equivalent

I ask:

var("x y")
print (x>y)==(y<x)
print (x>y)==(x-y>0)

and get:


So Sage recognizes the equivalence in the first pair but not in the second pair. Is there a way to handle this?

2016-03-13 07:30:23 -0500 commented answer solve_ineq returns strange output

Thanks! How do I check this in a condition? I can use something like:

if s[1][1].operator() == (x>y).operator():

but this requires x and y to be defined... is there a better way?

2016-03-13 04:40:27 -0500 asked a question solve_ineq returns strange output

I ask:

var("x y")
ineq = [x==y,  y<=0]
s = solve_ineq(ineq,[x]) 

and get:

[[x == y, y], [x == y, -y > 0]]

I understand the second set, but not the first. What does it mean when the inequality is just "y"?

A related question: how do I differentiate between inequalities with "==" or ">" and inequalities without?

Currently, when I ask:

print type(s[0][0])
print type(s[0][1])

I get the same result:

<type 'sage.symbolic.expression.Expression'>
<type 'sage.symbolic.expression.Expression'>
2016-03-13 03:59:52 -0500 asked a question Finding an assignment that satisfies a set of inequalities

I have the following simple set of inequalities:

ineq = [x<y, y<3]

I would like to find an assignment that satisfies this set of inequalities. In this case there is one such assignment:

x=1, y=2

In general there may be many assignments; I only need to find one. Is there a way to do this in SageMath?

2016-03-13 03:27:08 -0500 asked a question Simplifying an inequality

I ask:

ineq = (x+2<y+2)

and get:

x + 2 < y + 2

How can I get Sage to simplify this inequality to:

x < y


2016-03-12 23:57:36 -0500 asked a question Solving a simple system of inequalities

I asked:


and got:

[[y < z, x < y]]

What should I do to get the expected inequality:

x < z


2016-03-07 23:20:33 -0500 commented question How to clear the cache in SageMath worksheet?

This seems to work. Thanks!

2016-03-07 22:38:25 -0500 received badge  Citizen Patrol (source)
2016-03-07 02:50:30 -0500 asked a question How to clear the cache in SageMath worksheet?

In the SageMath worksheet, in some of the cells I have:

  load ("myfile.sage")
  [run some functions from myfile.sage]

Sometimes it is loaded correctly, but sometimes, when I make some changes to myfile.sage, save and click "evaluate", I do not see the changes. It looks as if the old version of "myfile.sage" is kept somewhere, and the worksheet does not load the new version.

Is there a cache and how can I disable it?