File tree Expand file tree Collapse file tree 2 files changed +12
-5
lines changed Expand file tree Collapse file tree 2 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -56,10 +56,11 @@ function tensortrain(tci)
56
56
return TensorTrain (tci)
57
57
end
58
58
59
- function recompress! (
60
- tt:: AbstractTensorTrain{V} ;
61
- tolerance:: Float64 = 1e-12 , maxbonddim= typemax (Int),
62
- method:: Symbol = :LU
59
+ function compress! (
60
+ tt:: AbstractTensorTrain{V} ,
61
+ method:: Symbol = :LU ;
62
+ tolerance:: Float64 = 1e-12 ,
63
+ maxbonddim= typemax (Int)
63
64
) where {V}
64
65
function factorize (A:: Matrix{V} )
65
66
if method === :LU
Original file line number Diff line number Diff line change @@ -25,9 +25,15 @@ using Optim
25
25
26
26
for method in [:LU , :CI , :SVD ]
27
27
ttcompressed = deepcopy (tt)
28
- TCI. recompress ! (ttcompressed; maxbonddim= 5 , tolerance = 1e-2 , method )
28
+ TCI. compress ! (ttcompressed, method ; maxbonddim= 5 )
29
29
@test TCI. rank (ttcompressed) <= 5
30
30
end
31
+
32
+ for method in [:LU , :CI , :SVD ]
33
+ ttcompressed = deepcopy (tt)
34
+ TCI. compress! (ttcompressed, method; tolerance= 1.0 )
35
+ @test TCI. rank (ttcompressed) <= TCI. rank (tt)
36
+ end
31
37
end
32
38
33
39
@testset " batchevaluate" begin
You can’t perform that action at this time.
0 commit comments