'DOP853' in solve_ivp_random

56 views
Skip to first unread message

Sheng-wey Chiow

unread,
Dec 18, 2022, 2:36:51 AM12/18/22
to pylcp
Hi,

Is there a reason why method 'DOP853' was not implemented in solve_ivp_random, while the comments suggest it should? I imported it in integration_tools.py together with RK45 and defined in the method block, and it seems to work..

Thanks,
Sheng-wey

Barker, Daniel S. (Fed)

unread,
Dec 20, 2022, 3:20:44 PM12/20/22
to Sheng-wey Chiow, pylcp

Hi Sheng-wey,

 

The solve_ivp_random method supports use of any integrator that is implemented in the underlying scipy solve_ivp function integrators. You would just need to change the ‘method’ keyword argument to the appropriate string, but you’ve already discovered this. I think there is a minor bug where our METHODS list does not have ‘DOP853’ included, but the functions themselves support it (I use it all the time). I’ll look into fixing this in the next release.

 

We have not changed the default solve_ivp_random integrator to ‘DOP853’ (rather that ‘RK45’) because the scipy solve_ivp random documentation suggests ‘RK45’ as a default and we have not run enough simulations that specifically test the relative performance of the various integrators.

 

What I can say with some confidence is that for most OBE calculations, the default tolerances of the underlying integrators are insufficient. Specifically, the default ‘rtol = 1e-3’ and ‘atol =1e-6’ can (though not always) lead to nonsense if your Hamiltonian has a large number of states or you’re interested in dynamics that occur on length/time scales comparable to the wavelength/the natural decay rate. In situations where you need to reduce rtol or atol by 1 to 3 orders of magnitude, the ‘DOP853’ integrator should give you results faster (though I’m not sure exactly how much faster). However, in the tests that I have run, I have not seen it give me different results than ‘RK45’.

 

I hope that helps,

 

Daniel

--
You received this message because you are subscribed to the Google Groups "pylcp" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pylcp+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pylcp/8a86703f-4bcf-44c8-985e-842ce2dbafccn%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sheng-wey Chiow

unread,
Dec 20, 2022, 3:50:47 PM12/20/22
to Barker, Daniel S. (Fed), pylcp
Thanks, Daniel. Divergence of probability using default settings was the reason for trying other methods. And thanks for pointing out that rtol=1e-3 is not sufficient for RK45. Now all makes sense. - Sheng-wey
Reply all
Reply to author
Forward
0 new messages