qojulia / QuantumOptics.jl-documentation

Documentation for QuantumOptics.jl
http://qojulia.org
15 stars 10 forks source link

Missing details about default solver options #15

Open AmitRotem opened 8 months ago

AmitRotem commented 8 months ago

I'm wondering about the choice of default solver options; DP5() for the algorithm, https://github.com/qojulia/QuantumOptics.jl/blob/8012aa8cb224df75dcc0e1301b24c740c616d330/src/timeevolution_base.jl#L14-L18 and for the tolerance, https://github.com/qojulia/QuantumOptics.jl/blob/8012aa8cb224df75dcc0e1301b24c740c616d330/src/timeevolution_base.jl#L59-L66

I can relate to the tolerance choice, as the default in DiffEqBase is quite low in my opinion (reltol=1e-3 & abstol=1e-6). But not sure about the algorithm, why DP5 ? and not Tsit5 (as recommended for non-stiff problems)? or letting DiffEq choose automatically (with alg=nothing)?

The Time-evolution doesn't offer much insight. I would love for the reasoning for this to be documented 🙏

amilsted commented 8 months ago

This is indeed poorly documented...

david-pl commented 8 months ago

I agree that this is poorly documented. For reference, the choice of DP5 is mainly historic. Before using DiffEq, we had our own ODE solver implemented, which used the DP5 algorithm. So when switching to DiffEq, the choice of DP5 seemed natural.

Also, I remember running (the now sorely outdated) benchmarks suite at some point, switching DP5 for Tsit5. While it was better in some tests, it also introduced regressions in others. That said, this was quite a while ago and I'm not sure if it's still the case. We'd need to test this again and ideally update the benchmarks as well. Once we do, it should be documented properly, of course.