@@ -26,7 +26,7 @@ for f! in (:qr_compact!, :qr_full!,
2626 :svd_compact! , :svd_full! ,
2727 :left_polar! , :left_orth_polar! , :right_polar! , :right_orth_polar! )
2828 @eval function $f! (t:: AbstractTensorMap , F, alg:: AbstractAlgorithm )
29- check_input ($ f!, t, F)
29+ check_input ($ f!, t, F, alg )
3030
3131 foreachblock (t, F... ) do _, bs
3232 factors = Base. tail (bs)
4545# Handle these separately because single output instead of tuple
4646for f! in (:qr_null! , :lq_null! , :svd_vals! , :eig_vals! , :eigh_vals! )
4747 @eval function $f! (t:: AbstractTensorMap , N, alg:: AbstractAlgorithm )
48- check_input ($ f!, t, N)
48+ check_input ($ f!, t, N, alg )
4949
5050 foreachblock (t, N) do _, (b, n)
5151 n′ = $ f! (b, n, alg)
6363const _T_USVᴴ = Tuple{<: AbstractTensorMap ,<: AbstractTensorMap ,<: AbstractTensorMap }
6464const _T_USVᴴ_diag = Tuple{<: AbstractTensorMap ,<: DiagonalTensorMap ,<: AbstractTensorMap }
6565
66- function check_input (:: typeof (svd_full!), t:: AbstractTensorMap , (U, S, Vᴴ):: _T_USV ᴴ)
66+ function check_input (:: typeof (svd_full!), t:: AbstractTensorMap , (U, S, Vᴴ):: _T_USV ᴴ, :: AbstractAlgorithm )
6767 # scalartype checks
6868 @check_scalar U t
6969 @check_scalar S t real
@@ -79,7 +79,7 @@ function check_input(::typeof(svd_full!), t::AbstractTensorMap, (U, S, Vᴴ)::_T
7979 return nothing
8080end
8181
82- function check_input (:: typeof (svd_compact!), t:: AbstractTensorMap , (U, S, Vᴴ):: _T_USV ᴴ_diag)
82+ function check_input (:: typeof (svd_compact!), t:: AbstractTensorMap , (U, S, Vᴴ):: _T_USV ᴴ_diag, :: AbstractAlgorithm )
8383 # scalartype checks
8484 @check_scalar U t
8585 @check_scalar S t real
@@ -94,7 +94,7 @@ function check_input(::typeof(svd_compact!), t::AbstractTensorMap, (U, S, Vᴴ):
9494 return nothing
9595end
9696
97- function check_input (:: typeof (svd_vals!), t:: AbstractTensorMap , S:: SectorDict )
97+ function check_input (:: typeof (svd_vals!), t:: AbstractTensorMap , S:: SectorDict , :: AbstractAlgorithm )
9898 @check_scalar S t real
9999 V_cod = infimum (fuse (codomain (t)), fuse (domain (t)))
100100 @check_space (S, V_cod ← V_dom)
139139# ------------------------
140140const _T_DV = Tuple{<: DiagonalTensorMap ,<: AbstractTensorMap }
141141
142- function check_input (:: typeof (eigh_full!), t:: AbstractTensorMap , (D, V):: _T_DV )
142+ function check_input (:: typeof (eigh_full!), t:: AbstractTensorMap , (D, V):: _T_DV , :: AbstractAlgorithm )
143143 domain (t) == codomain (t) ||
144144 throw (ArgumentError (" Eigenvalue decomposition requires square input tensor" ))
145145
@@ -155,7 +155,7 @@ function check_input(::typeof(eigh_full!), t::AbstractTensorMap, (D, V)::_T_DV)
155155 return nothing
156156end
157157
158- function check_input (:: typeof (eig_full!), t:: AbstractTensorMap , (D, V):: _T_DV )
158+ function check_input (:: typeof (eig_full!), t:: AbstractTensorMap , (D, V):: _T_DV , :: AbstractAlgorithm )
159159 domain (t) == codomain (t) ||
160160 throw (ArgumentError (" Eigenvalue decomposition requires square input tensor" ))
161161
@@ -171,14 +171,14 @@ function check_input(::typeof(eig_full!), t::AbstractTensorMap, (D, V)::_T_DV)
171171 return nothing
172172end
173173
174- function check_input (:: typeof (eigh_vals!), t:: AbstractTensorMap , D:: DiagonalTensorMap )
174+ function check_input (:: typeof (eigh_vals!), t:: AbstractTensorMap , D:: DiagonalTensorMap , :: AbstractAlgorithm )
175175 @check_scalar D t real
176176 V_D = fuse (domain (t))
177177 @check_space (D, V_D ← V_D)
178178 return nothing
179179end
180180
181- function check_input (:: typeof (eig_vals!), t:: AbstractTensorMap , D:: DiagonalTensorMap )
181+ function check_input (:: typeof (eig_vals!), t:: AbstractTensorMap , D:: DiagonalTensorMap , :: AbstractAlgorithm )
182182 @check_scalar D t complex
183183 V_D = fuse (domain (t))
184184 @check_space (D, V_D ← V_D)
239239# ----------------
240240const _T_QR = Tuple{<: AbstractTensorMap ,<: AbstractTensorMap }
241241
242- function check_input (:: typeof (qr_full!), t:: AbstractTensorMap , (Q, R):: _T_QR )
242+ function check_input (:: typeof (qr_full!), t:: AbstractTensorMap , (Q, R):: _T_QR , :: AbstractAlgorithm )
243243 # scalartype checks
244244 @check_scalar Q t
245245 @check_scalar R t
@@ -252,7 +252,7 @@ function check_input(::typeof(qr_full!), t::AbstractTensorMap, (Q, R)::_T_QR)
252252 return nothing
253253end
254254
255- function check_input (:: typeof (qr_compact!), t:: AbstractTensorMap , (Q, R):: _T_QR )
255+ function check_input (:: typeof (qr_compact!), t:: AbstractTensorMap , (Q, R):: _T_QR , :: AbstractAlgorithm )
256256 # scalartype checks
257257 @check_scalar Q t
258258 @check_scalar R t
@@ -265,7 +265,7 @@ function check_input(::typeof(qr_compact!), t::AbstractTensorMap, (Q, R)::_T_QR)
265265 return nothing
266266end
267267
268- function check_input (:: typeof (qr_null!), t:: AbstractTensorMap , N:: AbstractTensorMap )
268+ function check_input (:: typeof (qr_null!), t:: AbstractTensorMap , N:: AbstractTensorMap , :: AbstractAlgorithm )
269269 # scalartype checks
270270 @check_scalar N t
271271
302302# ----------------
303303const _T_LQ = Tuple{<: AbstractTensorMap ,<: AbstractTensorMap }
304304
305- function check_input (:: typeof (lq_full!), t:: AbstractTensorMap , (L, Q):: _T_LQ )
305+ function check_input (:: typeof (lq_full!), t:: AbstractTensorMap , (L, Q):: _T_LQ , :: AbstractAlgorithm )
306306 # scalartype checks
307307 @check_scalar L t
308308 @check_scalar Q t
@@ -315,7 +315,7 @@ function check_input(::typeof(lq_full!), t::AbstractTensorMap, (L, Q)::_T_LQ)
315315 return nothing
316316end
317317
318- function check_input (:: typeof (lq_compact!), t:: AbstractTensorMap , (L, Q):: _T_LQ )
318+ function check_input (:: typeof (lq_compact!), t:: AbstractTensorMap , (L, Q):: _T_LQ , :: AbstractAlgorithm )
319319 # scalartype checks
320320 @check_scalar L t
321321 @check_scalar Q t
@@ -328,7 +328,7 @@ function check_input(::typeof(lq_compact!), t::AbstractTensorMap, (L, Q)::_T_LQ)
328328 return nothing
329329end
330330
331- function check_input (:: typeof (lq_null!), t:: AbstractTensorMap , N)
331+ function check_input (:: typeof (lq_null!), t:: AbstractTensorMap , N, :: AbstractAlgorithm )
332332 # scalartype checks
333333 @check_scalar N t
334334
@@ -367,7 +367,7 @@ const _T_WP = Tuple{<:AbstractTensorMap,<:AbstractTensorMap}
367367const _T_PWᴴ = Tuple{<: AbstractTensorMap ,<: AbstractTensorMap }
368368using MatrixAlgebraKit: PolarViaSVD
369369
370- function check_input (:: typeof (left_polar!), t:: AbstractTensorMap , (W, P):: _T_WP )
370+ function check_input (:: typeof (left_polar!), t:: AbstractTensorMap , (W, P):: _T_WP , :: AbstractAlgorithm )
371371 codomain (t) ≿ domain (t) ||
372372 throw (ArgumentError (" Polar decomposition requires `codomain(t) ≿ domain(t)`" ))
373373
@@ -382,7 +382,7 @@ function check_input(::typeof(left_polar!), t::AbstractTensorMap, (W, P)::_T_WP)
382382 return nothing
383383end
384384
385- function check_input (:: typeof (left_orth_polar!), t:: AbstractTensorMap , (W, P):: _T_WP )
385+ function check_input (:: typeof (left_orth_polar!), t:: AbstractTensorMap , (W, P):: _T_WP , :: AbstractAlgorithm )
386386 codomain (t) ≿ domain (t) ||
387387 throw (ArgumentError (" Polar decomposition requires `codomain(t) ≿ domain(t)`" ))
388388
@@ -404,7 +404,7 @@ function initialize_output(::typeof(left_polar!), t::AbstractTensorMap, ::Abstra
404404 return W, P
405405end
406406
407- function check_input (:: typeof (right_polar!), t:: AbstractTensorMap , (P, Wᴴ):: _T_PW ᴴ)
407+ function check_input (:: typeof (right_polar!), t:: AbstractTensorMap , (P, Wᴴ):: _T_PW ᴴ, :: AbstractAlgorithm )
408408 codomain (t) ≾ domain (t) ||
409409 throw (ArgumentError (" Polar decomposition requires `domain(t) ≿ codomain(t)`" ))
410410
@@ -419,7 +419,7 @@ function check_input(::typeof(right_polar!), t::AbstractTensorMap, (P, Wᴴ)::_T
419419 return nothing
420420end
421421
422- function check_input (:: typeof (right_orth_polar!), t:: AbstractTensorMap , (P, Wᴴ):: _T_PW ᴴ)
422+ function check_input (:: typeof (right_orth_polar!), t:: AbstractTensorMap , (P, Wᴴ):: _T_PW ᴴ, :: AbstractAlgorithm )
423423 codomain (t) ≾ domain (t) ||
424424 throw (ArgumentError (" Polar decomposition requires `domain(t) ≿ codomain(t)`" ))
425425
457457const _T_VC = Tuple{<: AbstractTensorMap ,<: AbstractTensorMap }
458458const _T_CVᴴ = Tuple{<: AbstractTensorMap ,<: AbstractTensorMap }
459459
460- function check_input (:: typeof (left_orth!), t:: AbstractTensorMap , (V, C):: _T_VC )
460+ function check_input (:: typeof (left_orth!), t:: AbstractTensorMap , (V, C):: _T_VC , :: AbstractAlgorithm )
461461 # scalartype checks
462462 @check_scalar V t
463463 isnothing (C) || @check_scalar C t
@@ -470,7 +470,7 @@ function check_input(::typeof(left_orth!), t::AbstractTensorMap, (V, C)::_T_VC)
470470 return nothing
471471end
472472
473- function check_input (:: typeof (right_orth!), t:: AbstractTensorMap , (C, Vᴴ):: _T_CV ᴴ)
473+ function check_input (:: typeof (right_orth!), t:: AbstractTensorMap , (C, Vᴴ):: _T_CV ᴴ, :: AbstractAlgorithm )
474474 # scalartype checks
475475 isnothing (C) || @check_scalar C t
476476 @check_scalar Vᴴ t
499499
500500# Nullspace
501501# ---------
502- function check_input (:: typeof (left_null!), t:: AbstractTensorMap , N)
502+ function check_input (:: typeof (left_null!), t:: AbstractTensorMap , N, :: AbstractAlgorithm )
503503 # scalartype checks
504504 @check_scalar N t
505505
@@ -511,7 +511,7 @@ function check_input(::typeof(left_null!), t::AbstractTensorMap, N)
511511 return nothing
512512end
513513
514- function check_input (:: typeof (right_null!), t:: AbstractTensorMap , N)
514+ function check_input (:: typeof (right_null!), t:: AbstractTensorMap , N, :: AbstractAlgorithm )
515515 @check_scalar N t
516516
517517 # space checks
0 commit comments