Skip to content

Conversation

@albertomercurio
Copy link
Member

@albertomercurio albertomercurio commented Feb 18, 2025

Checklist

Thank you for contributing to QuantumToolbox.jl! Please make sure you have finished the following tasks before opening the PR.

  • Please read Contributing to Quantum Toolbox in Julia.
  • Any code changes were done in a way that does not break public API.
  • Appropriate tests were added and tested locally by running: make test.
  • Any code changes should be julia formatted by running: make format.
  • All documents (in docs/ folder) related to code changes were updated and able to build locally by running: make docs.
  • (If necessary) the CHANGELOG.md should be updated (regarding to the code changes) and built by running: make changelog.

Request for a review after you have completed all the tasks. If you have not finished them all, you can also open a Draft Pull Request to let the others know this on-going work.

Description

For the sesolve, mcsolve, and mesolve functions, we were using the tolerances given in QuTiP. However, QuTiP uses adams as default algorithm, which has a different behavior than Tsit5.

Here I slightly change the structure of the default ODE and SDE options tolerances. I make a dinstinction between pure and mixed states dynamics. Indeed, pure states dynamics generally require smaller tolerances, but this is not needed for density matrices evolutions.

This would allow to have better performances in mesolve, still having an accurate evolution.

@codecov
Copy link

codecov bot commented Feb 18, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.20%. Comparing base (7d58e46) to head (47dac8c).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #415   +/-   ##
=======================================
  Coverage   94.20%   94.20%           
=======================================
  Files          46       46           
  Lines        2918     2918           
=======================================
  Hits         2749     2749           
  Misses        169      169           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ytdHuang
Copy link
Member

ytdHuang commented Feb 19, 2025

Hmm

but this looks a bit weird for the users ?

Wouldn't it be better to just follow the same tolerance with qutip ?

@albertomercurio
Copy link
Member Author

As soon as the solver is different, having different tolerances is fine. Even with the same tolerances we can have different results. Moreover, in the future I'm planning to implement the AutoAbsTol callback, which dynamically changes the abstol depending on the dynamics. So their behavior is different anyhow.

@albertomercurio
Copy link
Member Author

I'm closing it as it is better to keep the tolerances as simple as possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants