SymPy can represent sets easily.  We do not have a standard class to couple
sets to variables but it might be useful.  I had to deal with this problem
when making sympy.stats.  Unfortunately I can't recommend the final
implementation.  I'd love to have something cleaner within core sympy.  I
think a first draft might be as simple as a pairing of variables with sets.


On Wed, Jul 24, 2013 at 6:34 AM, Stefan Krastanov <
[email protected]> wrote:

> It depends what exactly you want to do.
>
> If you need it just for typography purposes (e.g. writing something in
> IPython notebook and wanting to print the expression) you are using sympy
> incorrectly. SymPy is not a typography library. (if you insists there are
> hacks to do it)
>
> On the other hand quite frequently you need this for meaningful
> mathematics.
>
> - if you want to work on polynomials and do certain operations (finding
> roots, etc) over a given field, you do this by specifying the field during
> the creation of the polynomial.
>
> - there is some work in progress to be able to do the same for matrices,
> but it is not ready.
>
> - in general, there is the assumption module. It is a bit of a mess,
> because we have an old and a new assumption module and we try to move to
> the new one. If all that you want is for abs(x) to automatically return x
> (or something similar) it suffices to define x as `x=Symbol('x',
> positive=True)`. There are a few other handles like `real` and `integer`.
>
> - if you need something more general or more fancy, we may have it in some
> (possibly unfinished, mostly unused) form, but it goes deeper in SymPy so a
> more precise question will help us give you a more precise answer.
>
>
> On 24 July 2013 13:10, Ben Lucato <[email protected]> wrote:
>
>> We can represent domains on paper quite easily - for instance we can
>> write x < 0, or alternatively x (epsilon symbol) R-, or even x (epsilon
>> symbol) (-infinity, 0)
>>
>> I looked around but couldn't really find that - is there a canonical way
>> to be writing domains in SymPy?
>>
>> --
>> 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 [email protected].
>> To post to this group, send email to [email protected].
>> Visit this group at http://groups.google.com/group/sympy.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>
>  --
> 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 [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/sympy.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sympy.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to