Skip to content

Commit cca03b4

Browse files
committed
💡 Add steadystate_solver to Lanczos
1 parent f4bf563 commit cca03b4

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/QuantumToolbox.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,14 +115,14 @@ include("time_evolution/time_evolution_dynamical.jl")
115115

116116
# Others
117117
include("correlations.jl")
118-
include("spectrum.jl")
119118
include("wigner.jl")
120119
include("spin_lattice.jl")
121120
include("arnoldi.jl")
122121
include("entropy.jl")
123122
include("metrics.jl")
124123
include("negativity.jl")
125124
include("steadystate.jl")
125+
include("spectrum.jl")
126126
include("visualization.jl")
127127

128128
# deprecated functions

src/spectrum.jl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,11 @@ A solver which solves [`spectrum`](@ref) by using a non-symmetric Lanczos varian
3333
The nonsymmetric Lanczos algorithm is adapted from Algorithm 6.6 in [Saad2011](https://www-users.cse.umn.edu/~saad/eig_book_2ndEd.pdf).
3434
The running estimate is updated via a [Wallis-Euler recursion](https://en.wikipedia.org/wiki/Continued_fraction).
3535
"""
36-
Base.@kwdef struct Lanczos{T<:Real,IT<:Int} <: SpectrumSolver
36+
Base.@kwdef mutable struct Lanczos{T<:Real,IT<:Int} <: SpectrumSolver
3737
tol::T = 1e-8
3838
maxiter::IT = 5000
3939
verbose::IT = 0
40+
steadystate_solver::Union{Nothing,SteadyStateSolver} = nothing
4041
end
4142

4243
@doc raw"""
@@ -172,7 +173,9 @@ function _spectrum(
172173
cT = _CType(L)
173174

174175
# Calculate |v₁> = B|ρss>
175-
ρss = mat2vec(steadystate(L))
176+
ρss =
177+
solver.steadystate_solver === nothing ? mat2vec(steadystate(L)) :
178+
mat2vec(steadystate(L; solver = solver.steadystate_solver))
176179
vₖ = (spre(B) * ρss).data
177180

178181
# Define (possibly GPU) vector type

0 commit comments

Comments
 (0)