Skip to content

Conversation

@albertomercurio
Copy link
Member

@albertomercurio albertomercurio commented Nov 14, 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 previous implementation was handling the left and right preconditioners externally. However, this can be directly done in the solver definition, simplifying the syntax.

@albertomercurio albertomercurio marked this pull request as ready for review November 14, 2025 17:28
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 refactors the SteadyStateLinearSolver to use LinearSolve's internal preconditioner methods instead of handling preconditioners externally. The Pl and Pr parameters are removed from the solver struct, and preconditioners are now defined directly within the algorithm specification.

Key changes:

  • Removed Pl and Pr fields from SteadyStateLinearSolver struct
  • Changed default algorithm from KrylovJL_GMRES() to KrylovJL_GMRES(; precs = (A, p) -> (ilu(A, τ = 0.01), I))
  • Removed external preconditioner application logic from _steadystate and _steadystate_fourier functions
  • Updated LinearProblem constructor calls to use LinearProblem{true} for optimization

Reviewed Changes

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

File Description
src/steadystate.jl Simplified SteadyStateLinearSolver struct by removing preconditioner fields; updated default algorithm to include built-in preconditioner; removed manual preconditioner application logic
docs/src/users_guide/steadystate.md Updated example code to reflect removal of Pl and Pr parameters
CHANGELOG.md Added entry documenting the change to use LinearSolve's internal preconditioner methods

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ytdHuang
Copy link
Member

@TendonFFF

Can you also apply the same thing for HEOM ?

@ytdHuang ytdHuang merged commit 720304d into qutip:main Nov 15, 2025
26 of 29 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