Re: Solveset in Symengine

128 views
Skip to first unread message

Harsh Gupta

unread,
Feb 26, 2016, 12:28:07 PM2/26/16
to Akash Trehan, sy...@googlegroups.com, Ondřej Čertík
Hi Akash,

1.) Sets module is clearly is a dependence for the solveset module, the output of solveset of set and the module also make heavy use of a lot of functionalities of Sets including intersection, union and especially imageset. SymPy's set are **very** flexible and we aim to have the capability to represent every set possible. My limited knowledge in C++ tells me that it might be hard to achieve the flexibility set module in it, you should discuss the details with Ondrej and other people involved with Symengine.

2.) We had to go through a lot of discussion to designing the right input and output API, we have tried to document those decisions here https://github.com/sympy/sympy/blob/master/doc/src/modules/solvers/solveset.rst

BTW I don't think solveset is mature enough to be ported to symengine, but porting the sets module to symengine definitely seems like a good idea.

On 26 February 2016 at 13:53, Akash Trehan <akash.t...@gmail.com> wrote:
Hi Harsh

I'm Akash Trehan. 
I'm proposing to implement the solveset module in Symengine this GSoC. I found out that you started solveset in sympy. I wanted some help on certain things,
1) How much of the Sets module is being used for solveset?
2) What were the problems faces in starting a new module?

Thanks,
Akash



--
Harsh
Sent from a GNU/Linux

Akash Trehan

unread,
Feb 26, 2016, 12:56:39 PM2/26/16
to Harsh Gupta, sy...@googlegroups.com, Ondřej Čertík
1) What exactly do you mean by "mature" here?
2) Sets Module would definitely be have to be implemented before solveset is started, atleast a basic version of it.
3) Also what polynomial algorithms would be necessary for solveset?

Aaron Meurer

unread,
Feb 26, 2016, 2:13:52 PM2/26/16
to sy...@googlegroups.com, Harsh Gupta, Ondřej Čertík
On Fri, Feb 26, 2016 at 12:56 PM, Akash Trehan
<akash.t...@gmail.com> wrote:
> 1) What exactly do you mean by "mature" here?
> 2) Sets Module would definitely be have to be implemented before solveset is
> started, atleast a basic version of it.
> 3) Also what polynomial algorithms would be necessary for solveset?

I think at the very least you'd want
https://github.com/sympy/sympy/blob/master/sympy/polys/polyroots.py.
You also need a factorization algorithm to find the roots of higher
degree polynomials that can be factored into smaller degree ones.

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 https://groups.google.com/group/sympy.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sympy/CA%2BMaSckD%3DBwcB3y%3D-NNstRNgx9oYJcYk7pN1LxkdBH6yOAer-g%40mail.gmail.com.
>
> For more options, visit https://groups.google.com/d/optout.

Harsh Gupta

unread,
Feb 26, 2016, 4:01:21 PM2/26/16
to Akash Trehan, sy...@googlegroups.com, Ondřej Čertík
Solveset is only present in the development and it will be available in 1.0 release, I expect the new users to uncover more bugs in solveset. By not being "mature" enough I mean that you can expect to see significant changes in the internal structure of solveset. In the mean time you can focus on getting the building blocks ready in solveset.

Akash Trehan

unread,
Feb 27, 2016, 11:34:18 AM2/27/16
to sympy, akash.t...@gmail.com, ondrej...@gmail.com
Thanks Aaron and Harsh.
I'll discuss these things with Ondrej as well.

Akash Trehan

unread,
Mar 19, 2016, 11:39:38 AM3/19/16
to sympy, akash.t...@gmail.com, ondrej...@gmail.com


On Friday, 26 February 2016 22:58:07 UTC+5:30, Harsh Gupta wrote:
>Hi Akash,

>1.) Sets module is clearly is a dependence for the solveset module, the output of solveset of set and the module also make heavy use of a lot of >functionalities of Sets including intersection, union and especially imageset. SymPy's set are **very** flexible and we aim to have the capability to
I was looking at the code of `imageset` in sympy to see how it computer the function sent to it. So it further calls a function `_eval_imageset` which itself imports `solveset` for solving some expressions. I wanted to ask if some functions of solveset would have to be implemented before starting with the implementation of `ImageSet` in SymEngine?  Can you provide me some references for this?

Harsh Gupta

unread,
Mar 19, 2016, 3:22:29 PM3/19/16
to sy...@googlegroups.com, Akash Trehan, Ondřej Čertík
I was also discussing this Nishant in real life, SymEngine **is not**
a C++ clone of SymPy, rather SymEngine aims to be very fast core for
SymPy and hopefully other Computer Algebra Systems. A major reason for
the success of SymPy is that it is written in Python and which makes
it is easy for someone to understand and extend even if she/he is not
an expert programmer. The issue with python is that it is slow.
Programs also follow something like Pareto principle, 10% of the code
takes 90% of the time and it makes sense to **only** optimize that 10%
of code. You should move that 10% of code in SymEngine and leave the
rest in SymPy. Another test of determining if some code belongs to
SymEngine will be asking the following questions:

* Is this code settled? In the sense that there are no major bug
reports for code from a long time and we aren't expecting any api or
structural changes.
* Does this code do a lot of heavy lifting?
* Is there are lot of code which depends on this part of the code?

If the answer is yes for all three questions only then it is strong
candidate for SymEngine. Though I'm involved in the efforts with
SymEngine, hence I request Ondrej to express his thoughts on my
proposed test.

As far as imageset is concerned, though the solveset depends on it, it
doesn't do a lot of heavy lifting and it mainly serves as a
representation for the solutions. Unless you are planning to implement
solveset in SymEngine, having imageset there won't help much.
> --
> 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 https://groups.google.com/group/sympy.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sympy/31bf572d-d301-40da-93b7-5831f9552566%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.



Harsh Gupta

unread,
Mar 19, 2016, 3:42:30 PM3/19/16
to sy...@googlegroups.com, Akash Trehan, Ondřej Čertík, Nishant Nikhil
As a note to both Akash and Nishant, the most robust solver in SymPy
is the polynomial solver and your main focus should be on it. Some of
the polynomial algorithms are known from centuries and the output is
also uncontroversially a finite set of numbers. Everything else in
solveset works by converting the equation to polynomial one way or the
other.
Reply all
Reply to author
Forward
0 new messages