@@ -4,12 +4,12 @@ Solve the steady state of the auxiliary density operators based on `LinearSolve.
44
55# Parameters
66- `M::AbstractHEOMLSMatrix` : the matrix given from HEOM model, where the parity should be `EVEN`.
7- - `alg::SciMLLinearSolveAlgorithm` : The solving algorithm in package `LinearSolve.jl`. Default to `KrylovJL_GMRES(rtol= 1e-12, atol= 1e-14)`.
7+ - `alg::SciMLLinearSolveAlgorithm` : The solving algorithm in package `LinearSolve.jl`. Default to `KrylovJL_GMRES(rtol = 1e-12, atol = 1e-14)`.
88- `verbose::Bool` : To display verbose output or not. Defaults to `true`.
99- `kwargs` : The keyword arguments for the `LinearProblem`
1010
1111# Notes
12- - For more details about `alg`, `kwargs`, and `LinearProblem`, please refer to [`LinearSolve.jl`](http://linearsolve.sciml.ai/stable/)
12+ - For more details about `alg`, `kwargs`, and `LinearProblem`, please refer to [`LinearSolve.jl`](http://linearsolve.sciml.ai/stable/).
1313
1414# Returns
1515- `::ADOs` : The steady state of auxiliary density operators.
@@ -31,29 +31,14 @@ function QuantumToolbox.steadystate(
3131 A = _HandleSteadyStateMatrix (M)
3232 b = sparsevec ([1 ], [1.0 + 0.0im ], size (M, 1 ))
3333
34- if verbose
35- println (" Solving steady state for ADOs by linear-solve method..." )
36- flush (stdout )
37- end
38- if (! haskey (kwargs, :Pl )) && (isa (A, SparseMatrixCSC))
39- if verbose
40- print (" Calculating left preconditioner with ilu..." )
41- flush (stdout )
42- end
43- kwargs = merge ((; kwargs... ), (Pl = ilu (A, τ = 0.01 ),))
44- if verbose
45- println (" [DONE]" )
46- flush (stdout )
47- end
48- end
49-
5034 # solving x where A * x = b
5135 if verbose
52- print (" Solving linear problem ..." )
36+ print (" Solving steady state for ADOs by linear-solve method ..." )
5337 flush (stdout )
5438 end
55- cache = init (LinearProblem (A, _HandleVectorType (M, b)), alg, kwargs... )
56- sol = solve! (cache)
39+
40+ prob = LinearProblem {true} (A, _HandleVectorType (M, b))
41+ sol = solve (prob, alg; kwargs... )
5742 if verbose
5843 println (" [DONE]" )
5944 flush (stdout )
0 commit comments