Skip to content

Commit b640d02

Browse files
committed
LA svd comment
1 parent ed45947 commit b640d02

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/factorizations/factorizations.jl

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,14 @@ function LinearAlgebra.eigvals(t::AbstractTensorMap; kwargs...)
4949
end
5050
LinearAlgebra.eigvals!(t::AbstractTensorMap; kwargs...) = eig_vals!(t)
5151

52-
LinearAlgebra.svd(t::AbstractTensorMap; full::Bool = false) =
53-
full ? svd_full(t) : svd_compact(t)
54-
LinearAlgebra.svd!(t::AbstractTensorMap; full::Bool = false) =
55-
full ? svd_full!(t) : svd_compact!(t)
52+
function LinearAlgebra.svd(t::AbstractTensorMap; full::Bool = false)
53+
U, S, Vᴴ = full ? svd_full(t) : svd_compact(t)
54+
return U, diagview(S), adjoint(Vᴴ)
55+
end
56+
function LinearAlgebra.svd!(t::AbstractTensorMap; full::Bool = false)
57+
U, S, Vᴴ = full ? svd_full!(t) : svd_compact!(t)
58+
return U, diagview(S), adjoint(Vᴴ)
59+
end
5660

5761
function LinearAlgebra.svdvals(t::AbstractTensorMap)
5862
tcopy = copy_oftype(t, factorisation_scalartype(svd_vals!, t))

0 commit comments

Comments
 (0)