diff --git a/src/auxiliary/deprecate.jl b/src/auxiliary/deprecate.jl index 5853cad01..a37c40531 100644 --- a/src/auxiliary/deprecate.jl +++ b/src/auxiliary/deprecate.jl @@ -56,7 +56,8 @@ Base.@deprecate insertunit(P::ProductSpace, args...; kwargs...) insertleftunit(a # truncations const TruncationScheme = MatrixAlgebraKit.TruncationStrategy @deprecate truncdim(d::Int) truncrank(d) -@deprecate truncbelow(ϵ::Real) trunctol(ϵ) +@deprecate truncbelow(ϵ::Real) trunctol(; atol = ϵ) +@deprecate truncerr(ϵ::Real) truncerror(ϵ) # factorizations # -------------- @@ -131,7 +132,7 @@ function rightnull(t::AbstractTensorMap, p::Index2Tuple; kwargs...) return rightnull!(permutedcopy_oftype(t, factorisation_scalartype(rightnull, t), p); kwargs...) end function leftnull!(t::AbstractTensorMap; kwargs...) - Base.depwarn("`left_null!` is deprecated, use `left_null!` instead", :leftnull!) + Base.depwarn("`leftnull!` is deprecated, use `left_null!` instead", :leftnull!) haskey(kwargs, :alg) || return left_null!(t; kwargs...) alg = kwargs[:alg] kind = _kindof(alg) diff --git a/src/factorizations/truncation.jl b/src/factorizations/truncation.jl index a2faaf50a..5799ff3c6 100644 --- a/src/factorizations/truncation.jl +++ b/src/factorizations/truncation.jl @@ -165,14 +165,13 @@ function MAK.findtruncated_svd(values::SectorDict, strategy::TruncationByOrder) I = keytype(values) truncdim = SectorDict{I, Int}(c => length(d) for (c, d) in values) totaldim = sum(dim(c) * d for (c, d) in truncdim; init = 0) - while true + while totaldim > strategy.howmany next = _findnexttruncvalue(values, truncdim; strategy.by, strategy.rev) isnothing(next) && break _, cmin = next truncdim[cmin] -= 1 totaldim -= dim(cmin) truncdim[cmin] == 0 && delete!(truncdim, cmin) - totaldim <= strategy.howmany && break end return SectorDict(c => Base.OneTo(d) for (c, d) in truncdim) end