Skip to content

Conversation

@YoshihiroMichishita
Copy link

This PR updates src/tensorci2.jl to add a new constructor for TensorCI2 to inherit the local pivots of the previous search.
We also add the trivial testset to test/test_tensorci2.jl below:

@testset "inherit_local_pivots" begin
        Random.seed!(1234)

        N = 10
        M = rand(Float64, N, N)
        f(v) = M[v[1], v[2]] # 2D function
        localdims = fill(N, 2)
        mbd = 5

        tci, ranks, errors = TCI.crossinterpolate2(Float64, f, localdims; maxbonddim=mbd)
        tci2 = TCI.TensorCI2{Float64}(f, localdims, tci.Iset, tci.Jset)
        @test tci2.maxsamplevalue == tci.maxsamplevalue
    end

@shinaoka
Copy link
Member

Thank you. We can check the consistency between tci.Iset and tci2.Iset (and the same for Jset).

@shinaoka
Copy link
Member

Inherit Iset/Jset from the previous evaluation.

A better description may be "Initialize a TCI2 object with local pivot lists"?
This is because we do not necessarily inherit from a previous result.

@YoshihiroMichishita YoshihiroMichishita changed the title add new constructor for TensorCI2 to inherit Iset/Jset of previous search add new constructor for TensorCI2 to initialize with local pivots list Apr 16, 2025
@YoshihiroMichishita
Copy link
Author

Thank you for your comments.
I updated the test and description.

@shinaoka shinaoka merged commit 1a37ad4 into main Apr 30, 2025
3 checks passed
@shinaoka shinaoka deleted the reuse-local-pivots-in-tensorci2-constructor branch April 30, 2025 11:13
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

Successfully merging this pull request may close these issues.

3 participants