Closed jofrevalles closed 1 year ago
You have to provide the left_inds. Current implementation doesn’t work without specifying indices.
Right now it does not work even when left_inds
are specified:
julia> using Tensors
julia> using LinearAlgebra
julia> tensor = Tensor(rand(Complex{Float64}, 4, 4), (:l, :r))
4×4 Tensor{ComplexF64, 2, Matrix{ComplexF64}}:
0.571712+0.0823416im 0.224218+0.731893im 0.280031+0.675686im 0.873721+0.505655im
0.533186+0.15338im 0.786835+0.137324im 0.74039+0.462276im 0.845743+0.84615im
0.755815+0.298562im 0.0352349+0.695124im 0.952211+0.00878195im 0.751377+0.107136im
0.541379+0.124625im 0.809924+0.193885im 0.786122+0.0119519im 0.84552+0.654829im
julia> svd(tensor; left_inds=(labels(tensor)[1],))
ERROR: UndefVarError: uuid4 not defined
Stacktrace:
[1] svd(t::Tensor{ComplexF64, 2, Matrix{ComplexF64}}; left_inds::Tuple{Symbol}, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ Tensors ~/.julia/packages/Tensors/T8F9j/src/Numerics.jl:60
[2] top-level scope
@ REPL[19]:1
Here it seems we are just missing using UUIDs
, which is not even in the Project.toml
of Tensors.jl
.
Moreover, I think that we should throw an error if we do not specify left_inds
, and we should move it to be an argument instead of a keyword argument.
Summary
The
svd
function is not working for a givenTensor
. Also, we lack tests for this function.Example