@@ -7,7 +7,8 @@ module Grassmann
77using TensorKit
88using TensorKit: similarstoragetype, SectorDict
99using .. TensorKitManifolds: projecthermitian!, projectantihermitian!,
10- projectisometric!, projectcomplement!, PolarNewton
10+ projectisometric!, projectcomplement!, PolarNewton,
11+ default_svd_alg
1112import .. TensorKitManifolds: base, checkbase, inner, retract, transport, transport!
1213
1314# special type to store tangent vectors using Z
@@ -56,7 +57,7 @@ function Base.getproperty(Δ::GrassmannTangent, sym::Symbol)
5657 elseif sym ∈ (:U, :S, :V)
5758 v = Base. getfield(Δ, sym)
5859 v != = nothing && return v
59- U, S, V, = tsvd(Δ. Z)
60+ U, S, V, = tsvd(Δ. Z; alg = default_svd_alg(Δ . Z) )
6061 Base. setfield!(Δ, :U, U)
6162 Base. setfield!(Δ, :S, S)
6263 Base. setfield!(Δ, :V, V)
@@ -191,15 +192,15 @@ for the isometries `U`, `V`, and `Y`, and the diagonal matrix `S`, and returning
191192`Z = U * S * V` and `Y`.
192193"""
193194function invretract(Wold:: AbstractTensorMap , Wnew:: AbstractTensorMap ; alg= nothing )
194- space(Wold) == space(Wnew) || throw(SectorMismatch ())
195+ space(Wold) == space(Wnew) || throw(SpaceMismatch ())
195196 WodWn = Wold' * Wnew # V' * cos(S) * V * Y
196197 Wneworth = Wnew - Wold * WodWn
197- Vd, cS, VY = tsvd!(WodWn)
198+ Vd, cS, VY = tsvd!(WodWn; alg = default_svd_alg(WodWn) )
198199 Scmplx = acos(cS)
199200 # acos always returns a complex TensorMap. We cast back to real if possible.
200201 S = scalartype(WodWn) <: Real && isreal(sectortype(Scmplx)) ? real(Scmplx) : Scmplx
201202 UsS = Wneworth * VY' # U * sin(S) # should be in polar decomposition form
202- U = projectisometric!(UsS; alg=Polar() )
203+ U = projectisometric!(UsS)
203204 Y = Vd * VY
204205 V = Vd'
205206 Z = Grassmann. GrassmannTangent(Wold, U * S * V)
@@ -213,9 +214,9 @@ Return the unitary Y such that V*Y and W are "in the same Grassmann gauge" (tech
213214from fibre bundles: in the same section), such that they can be related by a Grassmann
214215retraction.
215216"""
216- function relativegauge(W:: AbstractTensorMap , V:: AbstractTensorMap )
217- space(W) == space(V) || throw(SectorMismatch ())
218- return projectisometric!(V' * W; alg=Polar() )
217+ function relativegauge(W:: AbstractTensorMap , V:: AbstractTensorMap ; alg = nothing )
218+ space(W) == space(V) || throw(SpaceMismatch ())
219+ return projectisometric!(V' * W)
219220end
220221
221222function transport!(Θ::GrassmannTangent, W::AbstractTensorMap, Δ::GrassmannTangent, α, W′;
0 commit comments