On Fri, Sep 1, 2023 at 4:12 AM Oscar Benjamin <[email protected]> wrote: > > On Fri, 1 Sept 2023 at 06:45, Aaron Meurer <[email protected]> wrote: > > > > I like the idea of using some faster linear algebra as a preprocessor > > to reduce the size of the problem to be solved. You could then take > > the reduced problem and solve it with exact symbolic arithmetic. The > > worst that can happen is you might drop an ansatz that shouldn't have > > been dropped, but you would still always give a symbolically correct > > answer when you do. > > > > If heurisch could support much larger, possibly linearly dependent > > ansatz, then that would open up a lot of possibilities, like for > > instance, trying to use ansatz coming from both sqrt(x) and x/sqrt(x) > > simultaneously. But right now it's way too slow even with just the > > linear system it generates. > > I'm not sure if I've interpreted this point correctly but when > heurisch is slow it is not usually because of the linear algebra part. > Probably that is the easiest part to speed up as well.
Maybe things have changed since the introduction of things like DomainMatrix, but when I benchmarked it years ago this was the case. That and the fact that it was using the dense poly representation with hundreds of variables. > > The slow parts of heurisch are converting back and forth between Expr > and the domains, differentiation, and cancel. > > If heurisch was being rewritten then I think it could be written > without the back and forth conversions. The differentiation could be > handled in the domain representation. The cancellation could be > handled there as well. We could probably merge a lot of the code in risch and heurisch, but loosening the restrictive rigorous code from risch. Actually Risch itself can solve some algebraic integrals if the restrictions are removed (just the nonelementary integral errors would be incorrect). > > I suspect that heurisch was implemented at a time when SymPy did not > have as many of the pieces that it now has that you would want to use > to implement the algorithm within the algebra subsystem rather than > the symbolic subsystem. Yes, heurisch predates the polys module. I integrated it with the polys back in 2012 or 2013, but I didn't really refactor it in any major way. Aaron Meurer > > Possibly the limiting factor for SymPy implementing heurisch in the > ideal way right now is support for symbolic algebraic extensions like > Q(x)[sqrt(x)] within the domain system although polys.agca has > FiniteMonogenicExtension that could represent that. > > -- > Oscar > > -- > 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 view this discussion on the web visit > https://groups.google.com/d/msgid/sympy/CAHVvXxSN%2BVBubjX6i3mq%3DwE7nXZSorg7drnSP_X3-2daxbzE0Q%40mail.gmail.com. -- 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 view this discussion on the web visit https://groups.google.com/d/msgid/sympy/CAKgW%3D6JmY0mA_bfTKggY_%3DtTR74j%2BQ0MkViPeeCs35-yOQihkg%40mail.gmail.com.
