Skip to content

Commit b1fdc59

Browse files
authored
Remove pre-conditioners in steadystate (#215)
1 parent 670cb4b commit b1fdc59

File tree

2 files changed

+10
-25
lines changed

2 files changed

+10
-25
lines changed

Project.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "HierarchicalEOM"
22
uuid = "a62dbcb7-80f5-4d31-9a88-8b19fd92b128"
3-
version = "2.9.0"
3+
version = "2.10.0"
44
authors = ["Yi-Te Huang"]
55

66
[deps]
@@ -28,8 +28,8 @@ CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
2828
HierarchicalEOM_CUDAExt = "CUDA"
2929

3030
[compat]
31-
CUDA = "5"
32-
DiffEqCallbacks = "2 - 4"
31+
CUDA = "5.0 - 5.8, 5.9.4 - 5"
32+
DiffEqCallbacks = "4.2.1 - 4"
3333
FastExpm = "1.1"
3434
FillArrays = "1"
3535
IncompleteLU = "0.2"
@@ -42,7 +42,7 @@ ProgressMeter = "1.11.0"
4242
QuantumToolbox = "0.39"
4343
Reexport = "1"
4444
SciMLBase = "2.105"
45-
SciMLOperators = "1.4"
45+
SciMLOperators = "1.11"
4646
SparseArrays = "1"
4747
StaticArraysCore = "1"
4848
julia = "1.10"

src/steadystate.jl

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)