Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More efficient support for tsvd #68

Open
adrilow opened this issue May 17, 2022 · 1 comment
Open

More efficient support for tsvd #68

adrilow opened this issue May 17, 2022 · 1 comment

Comments

@adrilow
Copy link

adrilow commented May 17, 2022

See tensors/factorizations.jl , 415:425

for (c, b) in blocks(t)
        U, Σ, V = _svd!(b, alg)
        Udata[c] = U
        Vdata[c] = V
        if @isdefined Σdata # cannot easily infer the type of Σ, so use this construction
            Σdata[c] = Σ
        else
            Σdata = SectorDict(c=>Σ)
        end
        dims[c] = length(Σ)
    end

This code gets executed unconditionally, independently of the truncation parameter, so the full svd is always computed. Is there a way to only calculate the biggest singular values, until truncdim, without calculating the rest? Similar to what the LowRankApprox.jl package does.

@Jutho
Copy link
Owner

Jutho commented May 17, 2022

Not with the current functionality, tsvd is really supposed to be the counterpart to full svd, but with some more options, and an interface that I find better suited for tensors.

Under the hood, any TensorMap is a block diagonal matrix (depending on how you want to partition the indices in left and right / domain and codomain). Any of the methods in LowRankApprox.jl could be applied to those dense matrices on the diagonal. But for many use of our use cases, the truncation really throws away only a fraction of the singular values, and first computing all of them seems like the most efficient strategy.

Nonetheless, I agree that there are other use cases where methods from LowRankApprox.jl could be useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants