Skip to content

Commit bfdbf01

Browse files
committed
some final small fixes
1 parent ff9e391 commit bfdbf01

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

src/tensors/factorizations/adjoint.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,12 @@ for f! in (:svd_full!, :svd_compact!, :svd_trunc!)
7878
$f!(adjoint(t), reverse(adjoint.(F)), _adjoint(alg))
7979
return F
8080
end
81+
82+
# disambiguate by prohibition
83+
@eval function initialize_output(::typeof($f!), t::AdjointTensorMap,
84+
alg::DiagonalAlgorithm)
85+
throw(MethodError($f!, (t, alg)))
86+
end
8187
end
8288
# avoid amgiguity
8389
function initialize_output(::typeof(svd_trunc!), t::AdjointTensorMap,

src/tensors/factorizations/matrixalgebrakit.jl

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -128,14 +128,6 @@ function check_input(::typeof(svd_compact!), t::AbstractTensorMap, USVᴴ,
128128
return nothing
129129
end
130130

131-
function check_input(::typeof(svd_vals!), t::AbstractTensorMap, S::SectorDict,
132-
::AbstractAlgorithm)
133-
@check_scalar S t real
134-
V_cod = V_dom = infimum(fuse(codomain(t)), fuse(domain(t)))
135-
@check_space(S, V_cod V_dom)
136-
return nothing
137-
end
138-
139131
function check_input(::typeof(svd_vals!), t::AbstractTensorMap, D, ::AbstractAlgorithm)
140132
@check_scalar D t real
141133
@assert D isa DiagonalTensorMap

test/bugfixes.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
# https://github.com/quantumkithub/TensorKit.jl/issues/201
4848
@testset "Issue #201" begin
4949
function f(A::AbstractTensorMap)
50-
U, S, V, = tsvd(A)
50+
U, S, V, = svd_compact(A)
5151
return tr(S)
5252
end
5353
function f(A::AbstractMatrix)
@@ -60,7 +60,7 @@
6060
@test convert(Array, grad1) grad2
6161

6262
function g(A::AbstractTensorMap)
63-
U, S, V, = tsvd(A)
63+
U, S, V, = svd_compact(A)
6464
return tr(U * V)
6565
end
6666
function g(A::AbstractMatrix)

0 commit comments

Comments
 (0)