@@ -5,18 +5,8 @@ const OFA = OrthogonalFactorizationAlgorithm
5
5
import LinearAlgebra: svd!, svd
6
6
const SVDAlg = Union{SVD,SDD}
7
7
8
- Base. @deprecate (svd (t:: AbstractTensorMap , leftind:: IndexTuple , rightind:: IndexTuple ;
9
- trunc:: TruncationScheme = notrunc (), p:: Real = 2 , alg:: SVDAlg = SDD ()),
10
- tsvd (t, leftind, rightind; trunc= trunc, p= p, alg= alg))
11
- Base. @deprecate (svd (t:: AbstractTensorMap ;
12
- trunc:: TruncationScheme = notrunc (), p:: Real = 2 , alg:: SVDAlg = SDD ()),
13
- tsvd (t; trunc= trunc, p= p, alg= alg))
14
- Base. @deprecate (svd! (t:: AbstractTensorMap ;
15
- trunc:: TruncationScheme = notrunc (), p:: Real = 2 , alg:: SVDAlg = SDD ()),
16
- tsvd (t; trunc= trunc, p= p, alg= alg))
17
-
18
8
"""
19
- tsvd(t::AbstractTensorMap, leftind::Tuple , rightind::Tuple ;
9
+ tsvd(t::AbstractTensorMap, ( leftind, rightind)::Index2Tuple ;
20
10
trunc::TruncationScheme = notrunc(), p::Real = 2, alg::Union{SVD, SDD} = SDD())
21
11
-> U, S, V, ϵ
22
12
@@ -47,12 +37,12 @@ algorithm that computes the decomposition (`_gesvd` or `_gesdd`).
47
37
Orthogonality requires `InnerProductStyle(t) <: HasInnerProduct`, and `tsvd(!)`
48
38
is currently only implemented for `InnerProductStyle(t) === EuclideanProduct()`.
49
39
"""
50
- function tsvd (t:: AbstractTensorMap , p1 :: IndexTuple , p2 :: IndexTuple ; kwargs... )
51
- return tsvd! (permute (t, (p1, p2 ); copy= true ); kwargs... )
40
+ function tsvd (t:: AbstractTensorMap , (p₁, p₂) :: Index2Tuple ; kwargs... )
41
+ return tsvd! (permute (t, (p₁, p₂ ); copy= true ); kwargs... )
52
42
end
53
43
54
44
"""
55
- leftorth(t::AbstractTensorMap, leftind::Tuple , rightind::Tuple ;
45
+ leftorth(t::AbstractTensorMap, ( leftind, rightind)::Index2Tuple ;
56
46
alg::OrthogonalFactorizationAlgorithm = QRpos()) -> Q, R
57
47
58
48
Create orthonormal basis `Q` for indices in `leftind`, and remainder `R` such that
@@ -73,12 +63,12 @@ Orthogonality requires `InnerProductStyle(t) <: HasInnerProduct`, and
73
63
`leftorth(!)` is currently only implemented for
74
64
`InnerProductStyle(t) === EuclideanProduct()`.
75
65
"""
76
- function leftorth (t:: AbstractTensorMap , p1 :: IndexTuple , p2 :: IndexTuple ; kwargs... )
77
- return leftorth! (permute (t, (p1, p2 ); copy= true ); kwargs... )
66
+ function leftorth (t:: AbstractTensorMap , (p₁, p₂) :: Index2Tuple ; kwargs... )
67
+ return leftorth! (permute (t, (p₁, p₂ ); copy= true ); kwargs... )
78
68
end
79
69
80
70
"""
81
- rightorth(t::AbstractTensorMap, leftind::Tuple , rightind::Tuple ;
71
+ rightorth(t::AbstractTensorMap, ( leftind, rightind)::Index2Tuple ;
82
72
alg::OrthogonalFactorizationAlgorithm = LQpos()) -> L, Q
83
73
84
74
Create orthonormal basis `Q` for indices in `rightind`, and remainder `L` such that
@@ -101,12 +91,12 @@ Orthogonality requires `InnerProductStyle(t) <: HasInnerProduct`, and
101
91
`rightorth(!)` is currently only implemented for
102
92
`InnerProductStyle(t) === EuclideanProduct()`.
103
93
"""
104
- function rightorth (t:: AbstractTensorMap , p1 :: IndexTuple , p2 :: IndexTuple ; kwargs... )
105
- return rightorth! (permute (t, (p1, p2 ); copy= true ); kwargs... )
94
+ function rightorth (t:: AbstractTensorMap , (p₁, p₂) :: Index2Tuple ; kwargs... )
95
+ return rightorth! (permute (t, (p₁, p₂ ); copy= true ); kwargs... )
106
96
end
107
97
108
98
"""
109
- leftnull(t::AbstractTensor, leftind::Tuple , rightind::Tuple ;
99
+ leftnull(t::AbstractTensor, ( leftind, rightind)::Index2Tuple ;
110
100
alg::OrthogonalFactorizationAlgorithm = QRpos()) -> N
111
101
112
102
Create orthonormal basis for the orthogonal complement of the support of the indices in
@@ -127,12 +117,12 @@ Orthogonality requires `InnerProductStyle(t) <: HasInnerProduct`, and
127
117
`leftnull(!)` is currently only implemented for
128
118
`InnerProductStyle(t) === EuclideanProduct()`.
129
119
"""
130
- function leftnull (t:: AbstractTensorMap , p1 :: IndexTuple , p2 :: IndexTuple ; kwargs... )
131
- return leftnull! (permute (t, (p1, p2 ); copy= true ); kwargs... )
120
+ function leftnull (t:: AbstractTensorMap , (p₁, p₂) :: Index2Tuple ; kwargs... )
121
+ return leftnull! (permute (t, (p₁, p₂ ); copy= true ); kwargs... )
132
122
end
133
123
134
124
"""
135
- rightnull(t::AbstractTensor, leftind::Tuple , rightind::Tuple ;
125
+ rightnull(t::AbstractTensor, ( leftind, rightind)::Index2Tuple ;
136
126
alg::OrthogonalFactorizationAlgorithm = LQ(),
137
127
atol::Real = 0.0,
138
128
rtol::Real = eps(real(float(one(scalartype(t)))))*iszero(atol)) -> N
@@ -155,12 +145,12 @@ Orthogonality requires `InnerProductStyle(t) <: HasInnerProduct`, and
155
145
`rightnull(!)` is currently only implemented for
156
146
`InnerProductStyle(t) === EuclideanProduct()`.
157
147
"""
158
- function rightnull (t:: AbstractTensorMap , p1 :: IndexTuple , p2 :: IndexTuple ; kwargs... )
159
- return rightnull! (permute (t, (p1, p2 ); copy= true ); kwargs... )
148
+ function rightnull (t:: AbstractTensorMap , (p₁, p₂) :: Index2Tuple ; kwargs... )
149
+ return rightnull! (permute (t, (p₁, p₂ ); copy= true ); kwargs... )
160
150
end
161
151
162
152
"""
163
- eigen(t::AbstractTensor, leftind::Tuple , rightind::Tuple ; kwargs...) -> D, V
153
+ eigen(t::AbstractTensor, ( leftind, rightind)::Index2Tuple ; kwargs...) -> D, V
164
154
165
155
Compute eigenvalue factorization of tensor `t` as linear map from `rightind` to `leftind`.
166
156
@@ -178,13 +168,13 @@ matrices. See the corresponding documentation for more information.
178
168
179
169
See also `eig` and `eigh`
180
170
"""
181
- function LinearAlgebra. eigen (t:: AbstractTensorMap , p1 :: IndexTuple , p2 :: IndexTuple ;
171
+ function LinearAlgebra. eigen (t:: AbstractTensorMap , (p₁, p₂) :: Index2Tuple ;
182
172
kwargs... )
183
- return eigen! (permute (t, (p1, p2 ); copy= true ); kwargs... )
173
+ return eigen! (permute (t, (p₁, p₂ ); copy= true ); kwargs... )
184
174
end
185
175
186
176
"""
187
- eig(t::AbstractTensor, leftind::Tuple , rightind::Tuple ; kwargs...) -> D, V
177
+ eig(t::AbstractTensor, ( leftind, rightind)::Index2Tuple ; kwargs...) -> D, V
188
178
189
179
Compute eigenvalue factorization of tensor `t` as linear map from `rightind` to `leftind`.
190
180
The function `eig` assumes that the linear map is not hermitian and returns type stable
@@ -204,12 +194,12 @@ Accepts the same keyword arguments `scale`, `permute` and `sortby` as `eigen` of
204
194
205
195
See also `eigen` and `eigh`.
206
196
"""
207
- function eig (t:: AbstractTensorMap , p1 :: IndexTuple , p2 :: IndexTuple ; kwargs... )
208
- return eig! (permute (t, (p1, p2 ); copy= true ); kwargs... )
197
+ function eig (t:: AbstractTensorMap , (p₁, p₂) :: Index2Tuple ; kwargs... )
198
+ return eig! (permute (t, (p₁, p₂ ); copy= true ); kwargs... )
209
199
end
210
200
211
201
"""
212
- eigh(t::AbstractTensorMap, leftind::Tuple , rightind::Tuple ) -> D, V
202
+ eigh(t::AbstractTensorMap, ( leftind, rightind)::Index2Tuple ) -> D, V
213
203
214
204
Compute eigenvalue factorization of tensor `t` as linear map from `rightind` to `leftind`.
215
205
The function `eigh` assumes that the linear map is hermitian and `D` and `V` tensors with
@@ -228,26 +218,23 @@ permute(t, (leftind, rightind)) * V = V * D
228
218
229
219
See also `eigen` and `eig`.
230
220
"""
231
- function eigh (t:: AbstractTensorMap , p1 :: IndexTuple , p2 :: IndexTuple )
232
- return eigh! (permute (t, (p1, p2 ); copy= true ))
221
+ function eigh (t:: AbstractTensorMap , (p₁, p₂) :: Index2Tuple )
222
+ return eigh! (permute (t, (p₁, p₂ ); copy= true ))
233
223
end
234
224
235
225
"""
236
- isposdef(t::AbstractTensor, leftind::Tuple , rightind::Tuple ) -> ::Bool
226
+ isposdef(t::AbstractTensor, ( leftind, rightind)::Index2Tuple ) -> ::Bool
237
227
238
228
Test whether a tensor `t` is positive definite as linear map from `rightind` to `leftind`.
239
229
240
230
If `leftind` and `rightind` are not specified, the current partition of left and right
241
231
indices of `t` is used. In that case, less memory is allocated if one allows the data in
242
232
`t` to be destroyed/overwritten, by using `isposdef!(t)`. Note that the permuted tensor on
243
233
which `isposdef!` is called should have equal domain and codomain, as otherwise it is
244
- meaningless
245
-
246
- Accepts the same keyword arguments `scale`, `permute` and `sortby` as `eigen` of dense
247
- matrices. See the corresponding documentation for more information.
234
+ meaningless.
248
235
"""
249
- function LinearAlgebra. isposdef (t:: AbstractTensorMap , p1 :: IndexTuple , p2 :: IndexTuple )
250
- return isposdef! (permute (t, (p1, p2 ); copy= true ))
236
+ function LinearAlgebra. isposdef (t:: AbstractTensorMap , (p₁, p₂) :: Index2Tuple )
237
+ return isposdef! (permute (t, (p₁, p₂ ); copy= true ))
251
238
end
252
239
253
240
function tsvd (t:: AbstractTensorMap ; trunc:: TruncationScheme = NoTruncation (),
0 commit comments