[DISCUSSION] Solvers

193 views
Skip to first unread message

Jogi Miglani

unread,
Mar 4, 2019, 4:20:39 AM3/4/19
to sympy
Hello,

As we know that the work for solvers i.e replacing solve with solveset is being in progress from last four years. A lot of work has been done during this period by Harsh Gupta(@hargup), Amit Kumar(@aktech), Kshitij Saraogi(@kshitij10496), Shekhar Rajak(@Shekharrajak) and Yathartha Joshi(@Yathartha22). I want to summarize whats left to be done. I want to work on this project as I had quite a good experience with solvers and had implemented solving specific type of exponential equation recently. 

Mainly three things are left to be done and the order in which it should be done:

1. Transolve :
    * Lambert Solver - It has been implemented and need to be passed some tests which i am working on now.
    * Modular Equation - I went through #13178 . It would be good to have more discussion on how to implement this and the equations which come under this.
    * Extending transolve to complex domain - needs discussion and proper plan of implementation.

2. Set Infrastructure(Image Set) : Many of the things depend on this in solveset. So I think this should be the next task done after transolve above.

3. Extending nonlinsove for trigonometric/transcedental equations.

First of we I think we should discuss about Transolve to complete. 
For lambert solver I think @Yathartha22, you should tell here that whats exactly left to be done so that all can give suggestions. 
For handling modular equations - @smichr, @asmeurer What do you think how should we approach this?
Example
This problem is expected to return {100}
n = symbols('n', integer=True)
a = 742938285
z = 1898888478
m = 2**31 - 1
x = 20170816
solveset(x – Mod(a**n*z, m), n, S.Integers)
Above can be implemented in sympy as suggested by @smichr
a = 742938285
z = 1898888478
m = 2**31 - 1
x = 20170816
arg = x*invert(z, m)  
n = discrete_log(m, arg, a) 

What do you think @smichr, @asmeurer here? Should we define (in the solveset module) an _invert (modulo m) function by the model of _invert_real and _invert_complex?

Suggestions on rest of the points can also be given here.

I request to mentors to please give suggestions and have a discussion on this to proceed further.

Yathartha Joshi

unread,
Mar 10, 2019, 8:45:58 AM3/10/19
to sympy
Hi Jogi,

Sorry for the late reply, it has been a busy week for me.
Thanks for your interest in this project. I definitely want `solveset` to overtake `solve` as quickly as we can. 

- Regarding `transolve`, yeah the Lambert solver needs to be completed. There were few bivariate type equations that weren't able to pass in my PR #14972. I will add more comments there, and update you soon.

- Regarding the modular equations, I think it will be a good idea to have `invert_modular`, I also liked the approach that is implemented in #14284, but some of the work needs to be done in terms of generalisation.

- For set infrastructure, a good place to start with would be #11188 and #12011 and #16033 (@oscargus made the PR recently you can probably work along with him).

- Also as I try to recollect now, there were some discussions on to include BigUnion and BigIntersection. Refer: #9815, and some discussions in #14566. It definitely needs a discussion on their addition. Probably you can add your thoughts on this.

Apart from this, there are a lot of issues and PR's that are undone. I suggest you start off by fixing them one by one. Also, feel free to ask any of your doubts here. I will try to reply you as soon as I can.

Cheers!
Yathartha Joshi
Message has been deleted

Jogi Miglani

unread,
Mar 11, 2019, 3:46:23 PM3/11/19
to sy...@googlegroups.com
Thank you so much Yathartha for giving the latest updates.

I am planning to complete the lambert first. I had added some reviews and comments over your PR for lambert. Please review them and let me know what you think. And i will focus on modular equations and set infrastructure after this.

I went through most of the issues and PRs. Many of them are related to the project. I think it can be covered side by side as my work proceeds. I will be updating you about my work.

Sincerely,
Jogi Miglani

On Sun, Mar 10, 2019 at 7:15 PM Nabanita Dash <dashna...@gmail.com> wrote:
I also wanted to work on solvers,can you please lead me the way to start. 

--
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/43a1c00f-3659-4a3c-a96b-9f136d06058a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
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/CAAXyjUpRfnh9GXwTqZVNnJyjXeNo40g3bzfwUYa4fnvTevWUzw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

kunal sharma

unread,
Mar 13, 2019, 3:59:47 PM3/13/19
to sympy
Hello everyone
My name is Kunal Sharma and I am willing to work on replacing solve with solveset. As Jogi Miglani(@jmig5776) has already discussed about the functions that need to be implemented to do so I would like to share my views on some of the topics.

1. Transolve: A lot of work has been done by Yathartha Joshi(@Yathartha22), transolve can now solve logarithmic and exponential equations, but it still have some more functions that need to be implemented.

2. ImageSet:  Looking at the issue #16031, improving ImageSet is quite necessary. Also it's a vast topic on it's own so a discussion would be beneficial, and as Jogi Miglani said above, it need to be improved after Transolve (or maybe hand in hand).

I am going through the docs for _transolve and solve(_tsolve and bivariate.py) and trying to understand the logic behind the algorithm. I do have some doubts @hargup, @aktech, @kshitij10496, @Shekharrajak and @Yathartha22, @smichr, @asmeurer. So should I be asking them here only or on the gitter channel.

Yathartha Joshi

unread,
Mar 14, 2019, 10:58:57 AM3/14/19
to sympy
Yes Kunal, this is where you should be asking the doubts, in gitter, there is a chance of the conversation being lost and also here it will be helpful to other people to add their viewpoints.
Jogi, the plan looks good, go ahead with it, I will try to review and clear doubts as much as I can, I might be slow to respond please bear with me :)
 
Cheers and Keep Contributing!
Yathartha Joshi

Kunal Sharma

unread,
Mar 20, 2019, 6:59:47 AM3/20/19
to sympy
I was trying to implement modular equations in solveset, issue #13178. Looking at the PR #14284, most of the work has already been done by @ishanaj, but it looks like that the work has stalled. I would like to help in merging the PR. So should I just make a new PR with imrovements that are asked by @normalhuman

Yathartha Joshi

unread,
Mar 20, 2019, 8:47:24 AM3/20/19
to sympy
Yeah, you can but if you wish to use the code written by someone else, then you should cherry-pick the commits and then continue your work. In this way the authorship is maintained.

Cheers!
Yathartha Joshi

Jogi Miglani

unread,
Mar 20, 2019, 9:32:15 AM3/20/19
to sy...@googlegroups.com
I had also tried a different approach i.e more general for handling modular equations locally. That was facing some issue. I will also be making a PR to get more of your suggestions. More tests I will be adding to it.

--
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.

Jogi Miglani

unread,
Apr 8, 2019, 5:39:52 AM4/8/19
to sy...@googlegroups.com
I have shared draft of my proposal with Sympy. Its in PDF format . Mentors please check it out and let me know about your suggestions - https://github.com/sympy/sympy/wiki/GSoC-2019-Current-Applications
Reply all
Reply to author
Forward
0 new messages