@@ -195,9 +195,9 @@ function fixedpoint(
195
195
if isnothing (alg. symmetrization)
196
196
retract = peps_retract
197
197
else
198
- retract, symm_finalize ! = symmetrize_retract_and_finalize! (alg . symmetrization)
199
- fin! = finalize! # Previous finalize!
200
- finalize! = (x, f, g, numiter) -> fin! ( symm_finalize! (x, f, g, numiter) ... , numiter )
198
+ retract, finalize ! = symmetrize_retract_and_finalize! (
199
+ alg . symmetrization, retract, finalize!
200
+ )
201
201
end
202
202
203
203
# :fixed mode compatibility
@@ -282,19 +282,19 @@ end
282
282
Performs a norm-preserving retraction of an infinite PEPS `A = x[1]` along `η` with step
283
283
size `α`, giving a new PEPS `A´`,
284
284
```math
285
- A' \\ leftarrow \\ cos \\ left ( α \\ frac{||η||}{||A||} \\ right ) A + \\ sin \\ left ( α \\ frac{||η||}{||A||} \\ right) ||A|| \\ frac{η}{||η||} ,
285
+ A' ← \\ cos ( α ‖η‖ / ‖A‖ ) A + \\ sin ( α ‖η‖ / ‖A‖ ) ‖A‖ η / ‖η‖ ,
286
286
```
287
287
and corresponding directional derivative `ξ`,
288
288
```math
289
- ξ = \\ cos \\ left ( α \\ frac{||η||}{||A||} \\ right ) η - \\ sin \\ left ( α \\ frac{||η||}{||A||} \\ right) ||η|| \\ frac{A}{||A||} ,
289
+ ξ = \\ cos ( α ‖η‖ / ‖A‖ ) η - \\ sin ( α ‖η‖ / ‖A‖ ) ‖η‖ A / ‖A‖ ,
290
290
```
291
- such that ``\\ langle A', ξ \\ rangle = 0`` and ``||A'|| = ||A|| ``.
291
+ such that ``⟨ A', ξ ⟩ = 0`` and ``‖A'‖ = ‖A‖ ``.
292
292
"""
293
293
function peps_retract (x, η, α)
294
294
peps = x[1 ]
295
295
env = deepcopy (x[2 ])
296
296
297
- retractions = vector_retract .(unitcell (peps), unitcell (η), α)
297
+ retractions = norm_preserving_retract .(unitcell (peps), unitcell (η), α)
298
298
peps´ = InfinitePEPS (map (first, retractions))
299
299
ξ = InfinitePEPS (map (last, retractions))
300
300
@@ -308,19 +308,21 @@ Transports a direction at `A = x[1]` to a valid direction at `A´ = x´[1]` corr
308
308
the norm-preserving retraction of `A` along `η` with step size `α`. In particular, starting
309
309
from a direction `η` of the form
310
310
```math
311
- ξ = \\ left \\ langle \\ frac{η}{||η||} , ξ \\ right \\ rangle \\ frac{η}{||η||} + Δξ
311
+ ξ = ⟨ η / ‖η‖ , ξ ⟩ η / ‖η‖ + Δξ
312
312
```
313
- where ``\\ langle Δξ, A \\ rangle = \\ langle Δξ, η \\ rangle = 0``, it returns
313
+ where ``⟨ Δξ, A ⟩ = ⟨ Δξ, η ⟩ = 0``, it returns
314
314
```math
315
- ξ(α) = \\ left \\ langle \\ frac{η}{||η||} , ξ \\ right \\ rangle \\ left ( \\ cos \\ left ( α \\ frac{||η||}{||A||} \\ right) \\ frac{η}{||η||} - \\ sin( \\ left ( α \\ frac{||η||}{||A||} \\ right) \\ frac{A}{||A||} \\ right ) + Δξ
315
+ ξ(α) = ⟨ η / ‖η‖ , ξ ⟩ ( \\ cos ( α ‖η‖ / ‖A‖ ) η / ‖η‖ - \\ sin( ( α ‖η‖ / ‖A‖ ) A / ‖A‖ ) + Δξ
316
316
```
317
- such that ``|| ξ(α)|| = ||ξ||, \\ langle A', ξ(α) \\ rangle = 0``.
317
+ such that ``‖ ξ(α)‖ = ‖ξ‖, ⟨ A', ξ(α) ⟩ = 0``.
318
318
"""
319
319
function peps_transport! (ξ, x, η, α, x´)
320
320
peps = x[1 ]
321
321
peps´ = x´[1 ]
322
322
323
- vector_transport! .(unitcell (ξ), unitcell (peps), unitcell (η), α, unitcell (peps´))
323
+ norm_preserving_transport! .(
324
+ unitcell (ξ), unitcell (peps), unitcell (η), α, unitcell (peps´)
325
+ )
324
326
325
327
return ξ
326
328
end
@@ -333,17 +335,22 @@ real_inner(_, η₁, η₂) = real(dot(η₁, η₂))
333
335
334
336
Return the `retract` and `finalize!` function for symmetrizing the `peps` and `grad` tensors.
335
337
"""
336
- function symmetrize_retract_and_finalize! (symm:: SymmetrizationStyle )
337
- finf = function symmetrize_finalize! ((peps, env), E, grad, _)
338
+ function symmetrize_retract_and_finalize! (
339
+ symm:: SymmetrizationStyle , retract= peps_retract, (finalize!)= OptimKit. _finalize!
340
+ )
341
+ function symmetrize_then_finalize! ((peps, env), E, grad, numiter)
342
+ # symmetrize the gradient
338
343
grad_symm = symmetrize! (grad, symm)
339
- return (peps, env), E, grad_symm
344
+ # then finalize
345
+ return finalize! ((peps, env), E, grad_symm, numiter)
340
346
end
341
- retf = function symmetrize_retract ((peps, env), η, α)
342
- peps_symm = deepcopy (peps)
343
- peps_symm. A .+ = η. A .* α
344
- env′ = deepcopy (env)
345
- symmetrize! (peps_symm, symm)
346
- return (peps_symm, env′), η
347
+ function retract_then_symmetrize ((peps, env), η, α)
348
+ # retract
349
+ (peps´, env´), ξ = retract ((peps, env), η, α)
350
+ # symmetrize retracted point and directional derivative
351
+ peps´_symm = symmetrize! (peps´, symm)
352
+ ξ_symm = symmetrize! (ξ, symm)
353
+ return (peps´_symm, env′), ξ_symm
347
354
end
348
- return retf, finf
355
+ return retract_then_symmetrize, symmetrize_then_finalize!
349
356
end
0 commit comments