Skip to content

Commit 2ced266

Browse files
committed
start adding truncated svd
1 parent 5ecd860 commit 2ced266

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/tensors/matrixalgebrakit.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,12 @@ function MatrixAlgebraKit.svd_compact!(t::AbstractTensorMap, (U, S, Vᴴ),
130130
return U, S, Vᴴ
131131
end
132132

133+
function MatrixAlgebraKit.svd_trunc!(t::AbstractTensorMap, USVᴴ,
134+
alg::MatrixAlgebraKit.TruncatedAlgorithm)
135+
USVᴴ′ = svd_compact!(t, USVᴴ, alg.alg)
136+
return MatrixAlgebraKit.truncate!(svd_trunc!, USVᴴ′, alg.trunc)
137+
end
138+
133139
function MatrixAlgebraKit.default_svd_algorithm(t::AbstractTensorMap{<:BlasFloat};
134140
scheduler=default_blockscheduler(t),
135141
kwargs...)

0 commit comments

Comments
 (0)