Skip to content

Conversation

@albertomercurio
Copy link
Member

@albertomercurio albertomercurio commented Dec 10, 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 support to dense eigen solvers was missing. The simple case eigenstates(H_gpu) was not working due to missing methods for to_dense(::Type{CuSparseMatrix...}). That method was called inside the eigen function in order to force type stability on CPU (see JuliaLang/LinearAlgebra.jl#1498). However, this just gives a weak Union type on Julia > v1.10, which is not a huge problem. However, this creates a type instability in Julia v1.10, but I think it can be kept like this since it is a problem of that version. So I have decided to remove this forcing type conversion and keep the code simpler.

Since this now gives a Union type, while the sparse solver doesn't, I have decided to use Val for the sparse keyword argument, such that the sparse = Val(true) case doesn't return the Union type.

@albertomercurio albertomercurio added the Skip ChangeLog Skip changelog update check in PR label Dec 10, 2025
@codecov
Copy link

codecov bot commented Dec 10, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.92%. Comparing base (3077816) to head (95c39d0).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #609      +/-   ##
==========================================
- Coverage   93.34%   92.92%   -0.42%     
==========================================
  Files          50       50              
  Lines        3621     3620       -1     
==========================================
- Hits         3380     3364      -16     
- Misses        241      256      +15     

☔ 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.

@albertomercurio albertomercurio merged commit 0af6aa1 into qutip:main Dec 18, 2025
19 of 21 checks passed
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