Skip to content

Conversation

@ytdHuang
Copy link
Member

@ytdHuang ytdHuang commented Nov 7, 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

The changes in this PR:

  • Change sesolve default algorithm to Vern7(lazy=false)
  • Change mesolve and mcsolve and other related solver default algorithm to DP5
  • Set default keyword argument tstops for all ODE solvers if the problem is time-dependent.

@ytdHuang ytdHuang marked this pull request as ready for review November 8, 2025 10:20
@ytdHuang
Copy link
Member Author

ytdHuang commented Nov 8, 2025

This PR need to wait for PR #581 to be merged first.

@ytdHuang ytdHuang marked this pull request as draft November 8, 2025 10:30
@ytdHuang ytdHuang marked this pull request as ready for review November 15, 2025 03:35
@albertomercurio
Copy link
Member

The tests are failing

@ytdHuang
Copy link
Member Author

Ok, errors fixed.

The benchmarks show that sesolve is about 1.3 ~ 1.45 times worse than previous, which I think it is acceptable, since we changed its alg=Vern7.

Copy link
Member

@albertomercurio albertomercurio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

I would add some tests that check that tstops are indeed not generated when the propagator is constant. Just to be sure.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'Benchmark Results'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.30.

Benchmark suite Current: 553f6ed Previous: c0270e7 Ratio
Autodiff/sesolve/Reverse (Enzyme) 412546417 ns 309461206 ns 1.33
Time Evolution/time-independent/sesolve 2552871 ns 1737074.5 ns 1.47
Time Evolution/time-dependent/sesolve/QobjEvo 62704184 ns 47184340 ns 1.33
Time Evolution/time-dependent/sesolve/Tuple 62721466 ns 47102182.5 ns 1.33

This comment was automatically generated by workflow using github-action-benchmark.

@albertomercurio albertomercurio merged commit e8a550e into main Nov 17, 2025
27 of 30 checks passed
@ytdHuang ytdHuang deleted the improve-ODE branch November 17, 2025 05:08
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.

3 participants