Ask Your Question
1

Symbolic Equation 0=0

asked 2020-08-01 18:48:43 +0100

StevenClontz gravatar image

updated 2020-08-01 18:49:50 +0100

What's the "correct" way to create the symbolic equation $0=0$ in Sage?

(In particular, 0==0 returns True, so that's a non-starter.)

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2020-08-01 22:33:59 +0100

rburing gravatar image

updated 2020-08-01 22:42:10 +0100

The value of 0 == 0 is True because 0 is an Integer and equality of Integers is defined that way. To construct the symbolic equation $0=0$, you need the value 0 as a symbolic expression, so that == will construct a symbolic equation:

sage: SR.zero() == SR.zero()
0 == 0

Here SR is the name of the Symbolic Ring, and the zero() method of any ring returns its zero. You can also convert the integer 0 to a symbolic expression:

sage: SR(0) == 0
0 == 0
edit flag offensive delete link more

Comments

1

Awesome, thank you! The key insight I lacked was how to create a "symbolic zero", and various permutations of Google searches never sent me here: https://doc.sagemath.org/html/en/reference/calculus/sage/symbolic/ring.html (https://doc.sagemath.org/html/en/refe...)

StevenClontz gravatar imageStevenClontz ( 2020-08-02 00:01:52 +0100 )edit

you can get the same result with:

sage: SR(0)==0
0 == 0
Emmanuel Charpentier gravatar imageEmmanuel Charpentier ( 2020-08-02 15:15:47 +0100 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2020-08-01 18:48:43 +0100

Seen: 564 times

Last updated: Aug 01 '20