You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This algorithm optimizes the given index set (in this case `[1, 2, 3, 4, 5]`) by searching for a maximum absolute value, alternating through the dimensions. If no starting point is given, `[1, 1, ...]` is used.
119
119
120
+
## Combing TCI2 and global pivot search
121
+
The main algorithm for adding new pivots in TCI2 is the 2-site algorithm, which is local.
122
+
The 2-site algorithm alone may miss some regions with high interpolation error.
123
+
124
+
The current TCI2 implementation provides the combination of the 2-site algorithm and a global search algorithm to find such regions.
125
+
This functionality is activated by default.
126
+
In the function [`crossinterpolate2`](@ref), we alternate between a 2-site-update sweep and a global pivot insertion.
127
+
After a 2-site-update sweep, we search for index sets with high interpolation errors (> the given tolerance multiplied by the parameter `tolmarginglobalsearch`) and add them to the TCI2 object, and then we continue with a 2-site-update sweep.
128
+
The number of initial points used in one global search is controlled by the parameter `nsearchglobalpivot`.
129
+
You may consider increasing this number if the global search is not effective (check the number of pivots found and timings of the global search by setting `verbosity` to a higher value!).
130
+
The maximum number of global pivots inserted at once is controlled by the parameter `maxnglobalpivot`.
131
+
132
+
133
+
120
134
## Estiamte true interpolation error by random global search
121
-
Since the TCI update algorithms are local, the true interpolation error is not known. However, the error can be estimated by global searches. This is implemented in the function `estimatetrueerror`:
135
+
Since most of the TCI update algorithms are local, the true interpolation error is not known. However, the error can be estimated by global searches. This is implemented in the function [`estimatetrueerror`](@ref):
Copy file name to clipboardExpand all lines: src/tensorci2.jl
+10-10Lines changed: 10 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -214,7 +214,7 @@ function addglobalpivots2sitesweep!(
214
214
pivotsearch::Symbol=:full,
215
215
verbosity::Int=0,
216
216
ntry::Int=10,
217
-
strictlynested::Bool=true
217
+
strictlynested::Bool=false
218
218
)::Intwhere {F,ValueType}
219
219
ifany(length(tci) .!=length.(pivots))
220
220
throw(DimensionMismatch("Please specify a pivot as one index per leg of the MPS."))
@@ -604,9 +604,9 @@ end
604
604
normalizeerror::Bool=true,
605
605
ncheckhistory=3,
606
606
maxnglobalpivot::Int=5,
607
-
nsearchglobalpivot::Int=0,
607
+
nsearchglobalpivot::Int=5,
608
608
tolmarginglobalsearch::Float64=10.0,
609
-
strictlynested::Bool=true
609
+
strictlynested::Bool=false
610
610
) where {ValueType}
611
611
612
612
Perform optimization sweeps using the TCI2 algorithm. This will sucessively improve the TCI approximation of a function until it fits `f` with an error smaller than `tolerance`, or until the maximum bond dimension (`maxbonddim`) is reached.
@@ -627,7 +627,7 @@ Arguments:
627
627
- `normalizeerror::Bool` determines whether to scale the error by the maximum absolute value of `f` found during sampling. If set to `false`, the algorithm continues until the *absolute* error is below `tolerance`. If set to `true`, the algorithm uses the absolute error divided by the maximum sample instead. This is helpful if the magnitude of the function is not known in advance. Default: `true`.
628
628
- `ncheckhistory::Int` is the number of history points to use for convergence checks. Default: `3`.
629
629
- `maxnglobalpivot::Int` can be set to `>= 0`. Default: `5`.
630
-
- `nsearchglobalpivot::Int` can be set to `>= 0`. Default: `0`.
630
+
- `nsearchglobalpivot::Int` can be set to `>= 0`. Default: `5`.
631
631
- `tolmarginglobalsearch` can be set to `>= 1.0`. Seach global pivots where the interpolation error is larger than the tolerance by `tolmarginglobalsearch`. Default: `10.0`.
632
632
- `strictlynested::Bool` determines whether to preserve partial nesting in the TCI algorithm. Default: `false`.
633
633
- `checkbatchevaluatable::Bool` Check if the function `f` is batch evaluatable. Default: `false`.
@@ -653,7 +653,7 @@ function optimize!(
653
653
normalizeerror::Bool=true,
654
654
ncheckhistory::Int=3,
655
655
maxnglobalpivot::Int=5,
656
-
nsearchglobalpivot::Int=0,
656
+
nsearchglobalpivot::Int=5,
657
657
tolmarginglobalsearch::Float64=10.0,
658
658
strictlynested::Bool=false,
659
659
checkbatchevaluatable::Bool=false
@@ -776,7 +776,7 @@ function sweep2site!(
776
776
sweepstrategy::Symbol=:backandforth,
777
777
pivotsearch::Symbol=:full,
778
778
verbosity::Int=0,
779
-
strictlynested::Bool=true,
779
+
strictlynested::Bool=false,
780
780
fillsitetensors::Bool=true
781
781
) where {ValueType}
782
782
invalidatesitetensors!(tci)
@@ -850,9 +850,9 @@ end
850
850
normalizeerror::Bool=true,
851
851
ncheckhistory=3,
852
852
maxnglobalpivot::Int=5,
853
-
nsearchglobalpivot::Int=0,
853
+
nsearchglobalpivot::Int=5,
854
854
tolmarginglobalsearch::Float64=10.0,
855
-
strictlynested::Bool=true
855
+
strictlynested::Bool=false
856
856
) where {ValueType,N}
857
857
858
858
Cross interpolate a function ``f(\mathbf{u})`` using the TCI2 algorithm. Here, the domain of ``f`` is ``\mathbf{u} \in [1, \ldots, d_1] \times [1, \ldots, d_2] \times \ldots \times [1, \ldots, d_{\mathscr{L}}]`` and ``d_1 \ldots d_{\mathscr{L}}`` are the local dimensions.
@@ -873,9 +873,9 @@ Arguments:
873
873
- `normalizeerror::Bool` determines whether to scale the error by the maximum absolute value of `f` found during sampling. If set to `false`, the algorithm continues until the *absolute* error is below `tolerance`. If set to `true`, the algorithm uses the absolute error divided by the maximum sample instead. This is helpful if the magnitude of the function is not known in advance. Default: `true`.
874
874
- `ncheckhistory::Int` is the number of history points to use for convergence checks. Default: `3`.
875
875
- `maxnglobalpivot::Int` can be set to `>= 0`. Default: `5`.
876
-
- `nsearchglobalpivot::Int` can be set to `>= 0`. Default: `0`.
876
+
- `nsearchglobalpivot::Int` can be set to `>= 0`. Default: `5`.
877
877
- `tolmarginglobalsearch` can be set to `>= 1.0`. Seach global pivots where the interpolation error is larger than the tolerance by `tolmarginglobalsearch`. Default: `10.0`.
878
-
- `strictlynested::Bool=true` determines whether to preserve partial nesting in the TCI algorithm. Default: `true`.
878
+
- `strictlynested::Bool=false` determines whether to preserve partial nesting in the TCI algorithm. Default: `true`.
879
879
- `checkbatchevaluatable::Bool` Check if the function `f` is batch evaluatable. Default: `false`.
0 commit comments