File tree Expand file tree Collapse file tree 4 files changed +12
-7
lines changed Expand file tree Collapse file tree 4 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -22,8 +22,9 @@ function integrate(
22
22
f,
23
23
a:: Vector{ValueType} ,
24
24
b:: Vector{ValueType} ;
25
- tolerance= 1e-8 ,
26
- GKorder:: Int = 15
25
+ GKorder:: Int = 15 ,
26
+ normalizeerror= false ,
27
+ kwargs...
27
28
) where {ValueType}
28
29
if iseven (GKorder)
29
30
error (" Gauss--Kronrod order must be odd, e.g. 15 or 61." )
@@ -50,7 +51,9 @@ function integrate(
50
51
ValueType,
51
52
F,
52
53
localdims;
53
- tolerance
54
+ nsearchglobalpivot= 10 ,
55
+ normalizeerror,
56
+ kwargs...
54
57
)
55
58
56
59
return sum (tci2) / normalization
Original file line number Diff line number Diff line change @@ -684,14 +684,15 @@ function optimize!(
684
684
end
685
685
686
686
sweep2site! (
687
- tci, f, 1 ;
687
+ tci, f, 2 ;
688
688
iter1 = 1 ,
689
689
abstol= abstol,
690
690
maxbonddim= maxbonddim,
691
691
pivotsearch= pivotsearch,
692
692
strictlynested= strictlynested,
693
693
verbosity= verbosity,
694
- sweepstrategy= sweepstrategy
694
+ sweepstrategy= sweepstrategy,
695
+ fillsitetensors= true
695
696
)
696
697
if verbosity > 0 && length (globalpivots) > 0
697
698
nrejections = length ([p for p in globalpivots if abs (evaluate (tci, p) - f (p)) > abstol])
Original file line number Diff line number Diff line change @@ -27,6 +27,8 @@ import Random
27
27
end
28
28
29
29
@testset " Integrate 10d function" begin
30
+ Random. seed! (1234 )
31
+
30
32
function f (x)
31
33
return 1000 * cos (10 * sum (x .^ 2 )) * exp (- sum (x)^ 4 / 1000 )
32
34
end
Original file line number Diff line number Diff line change @@ -3,8 +3,7 @@ using Random
3
3
using Zygote
4
4
using Optim
5
5
6
- @testset " tensor train" begin
7
- g (v) = 1 / (sum (v .^ 2 ) + 1im )
6
+ @testset " tensor train" for g in [v -> exp (exp (1im * sum (v))), v -> 1 / (sum (v .^ 2 ) + 1im )]
8
7
localdims = (6 , 6 , 6 , 6 )
9
8
tolerance = 1e-8
10
9
allindices = CartesianIndices (localdims)
You can’t perform that action at this time.
0 commit comments