From 12853830316bff2475f6c9d2f2d2d843fb3e01a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Pawela?= Date: Wed, 3 Jul 2024 19:21:45 +0200 Subject: [PATCH] fix `eps` types --- src/linear_algebra_ext.jl | 4 ++-- src/mps/canonise.jl | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/linear_algebra_ext.jl b/src/linear_algebra_ext.jl index 9055125..32c629d 100644 --- a/src/linear_algebra_ext.jl +++ b/src/linear_algebra_ext.jl @@ -26,7 +26,7 @@ end function qr_fact( M::AbstractMatrix{T}, Dcut::Int = typemax(Int), - tol::T = eps(); + tol::T = eps(T); toGPU::Bool = true, kwargs..., ) where {T<:Real} @@ -44,7 +44,7 @@ end function rq_fact( M::AbstractMatrix{T}, Dcut::Int = typemax(Int), - tol::T = eps(); + tol::T = eps(T); toGPU::Bool = true, kwargs..., ) where {T<:Real} diff --git a/src/mps/canonise.jl b/src/mps/canonise.jl index bba1734..178d903 100644 --- a/src/mps/canonise.jl +++ b/src/mps/canonise.jl @@ -28,7 +28,7 @@ function truncate!( ψ::QMps{T}, s::Symbol, Dcut::Int = typemax(Int), - tolS::T = eps(); + tolS::T = eps(T); kwargs..., ) where {T<:Real} @assert s ∈ (:left, :right) @@ -46,12 +46,12 @@ canonise!(ψ::QMps, ::Val{:right}) = _left_sweep!(ψ, typemax(Int)) canonise!(ψ::QMps, ::Val{:left}) = _right_sweep!(ψ, typemax(Int)) function canonise_truncate!( - ψ::QMps, + ψ::QMps{T}, type::Symbol, Dcut::Int = typemax(Int), - tolS = eps(); + tolS::T = eps(T); kwargs..., -) +) where {T<:Real} if type == :right _left_sweep!(ψ, Dcut, tolS; kwargs...) elseif type == :left