Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for single sc_ops for faster specific method in ssesolve and smesolve #408

Merged
merged 5 commits into from
Feb 17, 2025

Conversation

albertomercurio
Copy link
Member

@albertomercurio albertomercurio commented Feb 16, 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 current implementation of ssesolve and smesolve only supports sc_ops to be either a Vector or a Tuple.

This constraints the solver to use the non-diagonal noise, as the diagonal one can only be implemented in the case of a single collapse operator. This cannot be inferred automatically, as the solver may depend on the length of sc_ops, creating type instability.

Here I implement the support for a single AbstractQuantumObject, which allows to implement the diagonal noise through multiple dispatch, thus without giving type instabilities.

The performances are 4 times better with respect to using a Vector of length one.

Copy link

codecov bot commented Feb 16, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.20%. Comparing base (3029a54) to head (4029a5b).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #408      +/-   ##
==========================================
+ Coverage   94.16%   94.20%   +0.03%     
==========================================
  Files          46       46              
  Lines        2898     2918      +20     
==========================================
+ Hits         2729     2749      +20     
  Misses        169      169              

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

@albertomercurio albertomercurio merged commit 9e3ddf3 into qutip:main Feb 17, 2025
12 of 14 checks passed
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