Skip to content

Commit 074af59

Browse files
committed
⚖️ Improve type stability
1 parent e60b45f commit 074af59

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/spectrum.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +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 mutable struct Lanczos{T<:Real,IT<:Int} <: SpectrumSolver
36+
Base.@kwdef struct Lanczos{T<:Real,IT<:Int,SS<:Union{Nothing,<:SteadyStateSolver}} <: SpectrumSolver
3737
tol::T = 1e-8
3838
maxiter::IT = 5000
3939
verbose::IT = 0
40-
steadystate_solver::Union{Nothing,SteadyStateSolver} = nothing
40+
steadystate_solver::SS = nothing
4141
end
4242

4343
@doc raw"""
@@ -164,7 +164,7 @@ function _spectrum(
164164
ωlist::AbstractVector,
165165
A::QuantumObject{Operator},
166166
B::QuantumObject{Operator},
167-
solver::Lanczos;
167+
solver::Lanczos,
168168
)
169169
check_dimensions(L, A, B)
170170

@@ -202,7 +202,7 @@ function _spectrum(
202202
# Tridiagonal matrix elements
203203
αₖ = cT(0)
204204
βₖ = cT(-1)
205-
δₖ = cT(+1)
205+
δₖ = fT(+1)
206206

207207
# Current and up to second-to-last A and B Euler sequences
208208
A₋₂ = vT(ones(cT, Length))

0 commit comments

Comments
 (0)