Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/auxiliary/deprecate.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
# --------------
Expand Down Expand Up @@ -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)
Expand Down
3 changes: 1 addition & 2 deletions src/factorizations/truncation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down