From 12d2ddd534b2c63db07a7f4565f3144affcdda4a Mon Sep 17 00:00:00 2001 From: Boris De Vos Date: Tue, 16 Dec 2025 11:07:16 +0100 Subject: [PATCH 1/3] specify method --- src/algorithms/toolbox.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/algorithms/toolbox.jl b/src/algorithms/toolbox.jl index bf10f06d..65917b1a 100644 --- a/src/algorithms/toolbox.jl +++ b/src/algorithms/toolbox.jl @@ -151,7 +151,7 @@ function marek_gap(above::InfiniteMPS; tol_angle = 0.1, kwargs...) return marek_gap(spectrum; tol_angle) end -function marek_gap(spectrum; tol_angle = 0.1) +function marek_gap(spectrum::Vector{T}; tol_angle = 0.1) where {T <: Number} # Remove 1s from the spectrum inds = findall(abs.(spectrum) .< 1 - 1.0e-12) length(spectrum) - length(inds) < 2 || @warn "Non-injective mps?" @@ -187,7 +187,7 @@ function correlation_length(above::InfiniteMPS; kwargs...) return 1 / ϵ end -function correlation_length(spectrum; kwargs...) +function correlation_length(spectrum::Vector{T}; kwargs...) where {T <: Number} ϵ, = marek_gap(spectrum; kwargs...) return 1 / ϵ end From b88c9b2aa7f5b32fbbe634894b43c41dcce997c2 Mon Sep 17 00:00:00 2001 From: Boris De Vos Date: Tue, 16 Dec 2025 11:39:39 +0100 Subject: [PATCH 2/3] check spacetype --- src/algorithms/toolbox.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/algorithms/toolbox.jl b/src/algorithms/toolbox.jl index 65917b1a..ce74cf16 100644 --- a/src/algorithms/toolbox.jl +++ b/src/algorithms/toolbox.jl @@ -94,7 +94,7 @@ function transfer_spectrum( init = randomize!( similar( above.AL[1], left_virtualspace(below, 1), - ℂ[typeof(sector)](sector => 1)' * left_virtualspace(above, 1) + spacetype(above)(sector => 1)' * left_virtualspace(above, 1) ) ) From 50d2c945dcf4ae5cdae33b2f323b6e76115041f6 Mon Sep 17 00:00:00 2001 From: Boris De Vos Date: Tue, 16 Dec 2025 13:50:16 +0100 Subject: [PATCH 3/3] be happy with anything that acts like a vector --- src/algorithms/toolbox.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/algorithms/toolbox.jl b/src/algorithms/toolbox.jl index ce74cf16..f309c5b0 100644 --- a/src/algorithms/toolbox.jl +++ b/src/algorithms/toolbox.jl @@ -151,7 +151,7 @@ function marek_gap(above::InfiniteMPS; tol_angle = 0.1, kwargs...) return marek_gap(spectrum; tol_angle) end -function marek_gap(spectrum::Vector{T}; tol_angle = 0.1) where {T <: Number} +function marek_gap(spectrum::AbstractVector{T}; tol_angle = 0.1) where {T <: Number} # Remove 1s from the spectrum inds = findall(abs.(spectrum) .< 1 - 1.0e-12) length(spectrum) - length(inds) < 2 || @warn "Non-injective mps?" @@ -187,7 +187,7 @@ function correlation_length(above::InfiniteMPS; kwargs...) return 1 / ϵ end -function correlation_length(spectrum::Vector{T}; kwargs...) where {T <: Number} +function correlation_length(spectrum::AbstractVector{T}; kwargs...) where {T <: Number} ϵ, = marek_gap(spectrum; kwargs...) return 1 / ϵ end