@@ -197,9 +197,9 @@ function fixedpoint(
197197 if isnothing (alg. symmetrization)
198198 retract = peps_retract
199199 else
200- retract, symm_finalize ! = symmetrize_retract_and_finalize! (alg . symmetrization)
201- fin! = finalize! # Previous finalize!
202- finalize! = (x, f, g, numiter) -> fin! ( symm_finalize! (x, f, g, numiter) ... , numiter )
200+ retract, finalize ! = symmetrize_retract_and_finalize! (
201+ alg . symmetrization, peps_retract, finalize!
202+ )
203203 end
204204
205205 # :fixed mode compatibility
@@ -284,30 +284,21 @@ end
284284Performs a norm-preserving retraction of an infinite PEPS `A = x[1]` along `η` with step
285285size `α`, giving a new PEPS `A´`,
286286```math
287- A' \\ leftarrow \\ cos \\ left ( α \\ frac{||η||}{||A||} \\ right ) A + \\ sin \\ left ( α \\ frac{||η||}{||A||} \\ right) ||A|| \\ frac{η}{||η||} ,
287+ A' ← \\ cos ( α ‖η‖ / ‖A‖ ) A + \\ sin ( α ‖η‖ / ‖A‖ ) ‖A‖ η / ‖η‖ ,
288288```
289289and corresponding directional derivative `ξ`,
290290```math
291- ξ = \\ cos \\ left ( α \\ frac{||η||}{||A||} \\ right ) η - \\ sin \\ left ( α \\ frac{||η||}{||A||} \\ right) ||η|| \\ frac{A}{||A||} ,
291+ ξ = \\ cos ( α ‖η‖ / ‖A‖ ) η - \\ sin ( α ‖η‖ / ‖A‖ ) ‖η‖ A / ‖A‖ ,
292292```
293- such that ``\\ langle A', ξ \\ rangle = 0`` and ``||A'|| = ||A|| ``.
293+ such that ``⟨ A', ξ ⟩ = 0`` and ``‖A'‖ = ‖A‖ ``.
294294"""
295295function peps_retract (x, η, α)
296296 peps = x[1 ]
297- norms_peps = norm .(peps. A)
298- norms_η = norm .(η. A)
299-
300- peps´ = similar (x[1 ])
301- peps´. A .=
302- cos .(α .* norms_η ./ norms_peps) .* peps. A .+
303- sin .(α .* norms_η ./ norms_peps) .* norms_peps .* η. A ./ norms_η
304-
305297 env = deepcopy (x[2 ])
306298
307- ξ = similar (η)
308- ξ. A .=
309- cos .(α .* norms_η ./ norms_peps) .* η. A .-
310- sin .(α .* norms_η ./ norms_peps) .* norms_η .* peps. A ./ norms_peps
299+ retractions = norm_preserving_retract .(unitcell (peps), unitcell (η), α)
300+ peps´ = InfinitePEPS (map (first, retractions))
301+ ξ = InfinitePEPS (map (last, retractions))
311302
312303 return (peps´, env), ξ
313304end
@@ -319,31 +310,21 @@ Transports a direction at `A = x[1]` to a valid direction at `A´ = x´[1]` corr
319310the norm-preserving retraction of `A` along `η` with step size `α`. In particular, starting
320311from a direction `η` of the form
321312```math
322- ξ = \\ left \\ langle \\ frac{η}{||η||} , ξ \\ right \\ rangle \\ frac{η}{||η||} + Δξ
313+ ξ = ⟨ η / ‖η‖ , ξ ⟩ η / ‖η‖ + Δξ
323314```
324- where ``\\ langle Δξ, A \\ rangle = \\ langle Δξ, η \\ rangle = 0``, it returns
315+ where ``⟨ Δξ, A ⟩ = ⟨ Δξ, η ⟩ = 0``, it returns
325316```math
326- ξ(α) = \\ left \\ langle \\ frac{η}{||η||} , ξ \\ right \\ rangle \\ left ( \\ cos \\ left ( α \\ frac{||η||}{||A||} \\ right) \\ frac{η}{||η||} - \\ sin( \\ left( α \\ frac{||η||}{||A||} \\ right) \\ frac{A}{||A||} \\ right ) + Δξ
317+ ξ(α) = ⟨ η / ‖η‖ , ξ ⟩ ( \\ cos ( α ‖η‖ / ‖A‖ ) η / ‖η‖ - \\ sin( α ‖η‖ / ‖A‖ ) A / ‖A‖ ) + Δξ
327318```
328- such that ``|| ξ(α)|| = ||ξ||, \\ langle A', ξ(α) \\ rangle = 0``.
319+ such that ``‖ ξ(α)‖ = ‖ξ‖, ⟨ A', ξ(α) ⟩ = 0``.
329320"""
330321function peps_transport! (ξ, x, η, α, x´)
331322 peps = x[1 ]
332- norms_peps = norm .(peps. A)
333-
334- norms_η = norm .(η. A)
335- normalized_η = η. A ./ norms_η
336- overlaps_η_ξ = inner .(normalized_η, ξ. A)
323+ peps´ = x´[1 ]
337324
338- # isolate the orthogonal component
339- Δξ = ξ. A .- overlaps_η_ξ .* normalized_η
340-
341- # keep orthogonal component fixed, modify the rest by the proper directional derivative
342- ξ. A .=
343- overlaps_η_ξ .* (
344- cos .(α .* norms_η ./ norms_peps) .* normalized_η .-
345- sin .(α .* norms_η ./ norms_peps) .* peps. A ./ norms_peps
346- ) .+ Δξ
325+ norm_preserving_transport! .(
326+ unitcell (ξ), unitcell (peps), unitcell (η), α, unitcell (peps´)
327+ )
347328
348329 return ξ
349330end
@@ -356,17 +337,22 @@ real_inner(_, η₁, η₂) = real(dot(η₁, η₂))
356337
357338Return the `retract` and `finalize!` function for symmetrizing the `peps` and `grad` tensors.
358339"""
359- function symmetrize_retract_and_finalize! (symm:: SymmetrizationStyle )
360- finf = function symmetrize_finalize! ((peps, env), E, grad, _)
340+ function symmetrize_retract_and_finalize! (
341+ symm:: SymmetrizationStyle , retract= peps_retract, (finalize!)= OptimKit. _finalize!
342+ )
343+ function symmetrize_then_finalize! ((peps, env), E, grad, numiter)
344+ # symmetrize the gradient
361345 grad_symm = symmetrize! (grad, symm)
362- return (peps, env), E, grad_symm
346+ # then finalize
347+ return finalize! ((peps, env), E, grad_symm, numiter)
363348 end
364- retf = function symmetrize_retract ((peps, env), η, α)
365- peps_symm = deepcopy (peps)
366- peps_symm. A .+ = η. A .* α
367- env′ = deepcopy (env)
368- symmetrize! (peps_symm, symm)
369- return (peps_symm, env′), η
349+ function retract_then_symmetrize ((peps, env), η, α)
350+ # retract
351+ (peps´, env´), ξ = retract ((peps, env), η, α)
352+ # symmetrize retracted point and directional derivative
353+ peps´_symm = symmetrize! (peps´, symm)
354+ ξ_symm = symmetrize! (ξ, symm)
355+ return (peps´_symm, env´), ξ_symm
370356 end
371- return retf, finf
357+ return retract_then_symmetrize, symmetrize_then_finalize!
372358end
0 commit comments