Definite "getting started" document for assumptions

276 views
Skip to first unread message

Amit Saha

unread,
Mar 13, 2015, 6:02:33 PM3/13/15
to sy...@googlegroups.com
Hi,

From a sympy user's perspective, which is the "getting started"
document for the current assumptions implementation? Couple of things
I am looking for:

- When I create a Symbol object, what is the default list of
assumptions about it? How do I find it?
- What are all the possible assumptions for a Symbol?

I think there is a "new" assumptions implementation in the works -
what are the main changes that are going to happen?


Thanks and apologies if I missed to look at the right places.

Best,
Amit.


--
http://echorand.me

Aaditya Nair

unread,
Mar 14, 2015, 1:26:10 AM3/14/15
to sy...@googlegroups.com
By default, the only assumption that Symbol object assumes is commutative (which is True).
Rest all are taken as None (i.e. not defined or cannot be determined).

You can list all the assumptions defined for a symbol x by 
      `x.assumptions0` .
or, 
if you want to check for each assumption you can do:
x.is_<assumption>

To know all possible assumptions read form Line 32 to Line 116 of this: https://github.com/sympy/sympy/blob/master/sympy/core/assumptions.py#L32

Yes, there is a *new* assumptions system that is underway. But it is far from complete. This blog gives a pretty good explanation of what the new assumptions system is going to be.

Amit Saha

unread,
Mar 14, 2015, 7:07:14 PM3/14/15
to sy...@googlegroups.com
On Sat, Mar 14, 2015 at 3:26 PM, Aaditya Nair <aaditya...@gmail.com> wrote:
> By default, the only assumption that Symbol object assumes is commutative
> (which is True).
> Rest all are taken as None (i.e. not defined or cannot be determined).
>
> You can list all the assumptions defined for a symbol x by
> `x.assumptions0` .
> or,
> if you want to check for each assumption you can do:
> x.is_<assumption>
>
> To know all possible assumptions read form Line 32 to Line 116 of this:
> https://github.com/sympy/sympy/blob/master/sympy/core/assumptions.py#L32
>
> Yes, there is a *new* assumptions system that is underway. But it is far
> from complete. This blog gives a pretty good explanation of what the new
> assumptions system is going to be.

Thank you. Exactly what I was looking for.



>
>
>
> On Saturday, 14 March 2015 03:32:33 UTC+5:30, Amit Saha wrote:
>>
>> Hi,
>>
>> From a sympy user's perspective, which is the "getting started"
>> document for the current assumptions implementation? Couple of things
>> I am looking for:
>>
>> - When I create a Symbol object, what is the default list of
>> assumptions about it? How do I find it?
>> - What are all the possible assumptions for a Symbol?
>>
>> I think there is a "new" assumptions implementation in the works -
>> what are the main changes that are going to happen?
>>
>>
>> Thanks and apologies if I missed to look at the right places.
>>
>> Best,
>> Amit.
>>
>>
>> --
>> http://echorand.me
>
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sympy+un...@googlegroups.com.
> To post to this group, send email to sy...@googlegroups.com.
> Visit this group at http://groups.google.com/group/sympy.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sympy/487c49bd-5933-4477-a257-c90722c0f103%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
http://echorand.me

Aaron Meurer

unread,
Mar 15, 2015, 1:47:37 PM3/15/15
to sy...@googlegroups.com
The main design difference with the new assumptions is that the
assumptions are stored separate from the expressions, like
Q.positive(x). I would not recommend using them unless you know what
you are doing, though, because currently almost nothing in SymPy
actually looks at them.

Aaron Meurer
> --
> You received this message because you are subscribed to the Google Groups "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sympy+un...@googlegroups.com.
> To post to this group, send email to sy...@googlegroups.com.
> Visit this group at http://groups.google.com/group/sympy.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/CANODV3ndZcv6sVnttbiJzYBKg7T%2BxX2GYS90buwsbPC92%3DoCSw%40mail.gmail.com.

Amit Saha

unread,
Apr 15, 2015, 4:48:24 PM4/15/15
to sy...@googlegroups.com
On Mon, Mar 16, 2015 at 3:47 AM, Aaron Meurer <asme...@gmail.com> wrote:
> The main design difference with the new assumptions is that the
> assumptions are stored separate from the expressions, like
> Q.positive(x). I would not recommend using them unless you know what
> you are doing, though, because currently almost nothing in SymPy
> actually looks at them.

Thanks Aaron.

I roughly understand why assumptions are needed. In my mind: so that
sympy knows what the numerical values the symbol can assume. Is that a
right way of thinking about it?

Is there a document somewhere describing assumptions in general - not
related to SymPy but in symbolic math that someone knows of?


Thanks,
Amit.


--
http://echorand.me

Joachim Durchholz

unread,
Apr 16, 2015, 3:37:24 AM4/16/15
to sy...@googlegroups.com
> I roughly understand why assumptions are needed. In my mind: so that
> sympy knows what the numerical values the symbol can assume. Is that a
> right way of thinking about it?

It's one (correct) way of thinking about it.
Another way would be: "The set of rules that restrict the values the
symbol can assume". That's the perspective with the focus on the
information that SymPy can use.
Reply all
Reply to author
Forward
0 new messages