Skip to content

Conversation

@albertomercurio
Copy link
Member

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 blocking pull request have been merged. So we can simplify a bit the code.

@albertomercurio albertomercurio added the Skip ChangeLog Skip changelog update check in PR label May 28, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR simplifies the time evolution setup in QuantumToolbox.jl by removing deprecated conditional branches and reducing special case handling in operator promotion. Key changes include:

  • Removal of the conditional branch for the :sensealg key in both sesolve and mesolve functions.
  • Simplification of the operator promotion logic in quantum_object_evo by eliminating redundant special cases.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/time_evolution/sesolve.jl Removed deprecated condition and related TODO comment for handling :sensealg in ODEProblem setup.
src/time_evolution/mesolve.jl Removed deprecated condition and related TODO comment for handling :sensealg in ODEProblem setup.
src/qobj/quantum_object_evo.jl Removed special cases for _promote_to_scimloperator with MatrixOperator and ScaledOperator.
Comments suppressed due to low confidence (3)

src/time_evolution/sesolve.jl:78

  • Since the branch for handling :sensealg was removed, consider deleting the corresponding TODO comment to keep the code clean.
# TODO: Remove this when https://github.com/SciML/SciMLSensitivity.jl/issues/1181 is fixed

src/time_evolution/mesolve.jl:99

  • Similarly, the TODO comment in mesolve.jl addressing the :sensealg condition is now obsolete and can be removed for clarity.
# TODO: Remove this when https://github.com/SciML/SciMLSensitivity.jl/issues/1181 is fixed

src/qobj/quantum_object_evo.jl:443

  • Ensure that the removal of these specialized promotion functions does not affect expected operator behavior; consider adding tests for AddedOperator promotion to validate the new simplified logic.
function _promote_to_scimloperator(α::Number, data::MatrixOperator)

@codecov
Copy link

codecov bot commented May 28, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.16%. Comparing base (a1d1627) to head (e407191).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #477      +/-   ##
==========================================
+ Coverage   94.08%   94.16%   +0.07%     
==========================================
  Files          49       49              
  Lines        3042     3032      -10     
==========================================
- Hits         2862     2855       -7     
+ Misses        180      177       -3     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ytdHuang ytdHuang merged commit 9fff016 into qutip:main May 29, 2025
18 of 19 checks passed
@ytdHuang ytdHuang changed the title Simplify QobEvo creation and time evolution Simplify QobjEvo creation and time evolution May 29, 2025
matteosecli pushed a commit to matteosecli/QuantumToolbox.jl that referenced this pull request Jun 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Skip ChangeLog Skip changelog update check in PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants