@@ -5,19 +5,19 @@ _repack_diagonal(d::DiagonalTensorMap) = Diagonal(d.data)
55for f in (:svd_compact , :svd_full , :svd_trunc , :svd_vals , :qr_compact , :qr_full , :qr_null ,
66 :lq_compact , :lq_full , :lq_null , :eig_full , :eig_trunc , :eig_vals , :eigh_full ,
77 :eigh_trunc , :eigh_vals , :left_polar , :right_polar )
8- @eval copy_input (:: typeof ($ f), d:: DiagonalTensorMap ) = copy (d)
8+ @eval MAK . copy_input (:: typeof ($ f), d:: DiagonalTensorMap ) = copy (d)
99end
1010
1111for f! in (:eig_full! , :eig_trunc! )
12- @eval function initialize_output (:: typeof ($ f!), d:: AbstractTensorMap ,
13- :: DiagonalAlgorithm )
12+ @eval function MAK . initialize_output (:: typeof ($ f!), d:: AbstractTensorMap ,
13+ :: DiagonalAlgorithm )
1414 return d, similar (d)
1515 end
1616end
1717
1818for f! in (:eigh_full! , :eigh_trunc! )
19- @eval function initialize_output (:: typeof ($ f!), d:: AbstractTensorMap ,
20- :: DiagonalAlgorithm )
19+ @eval function MAK . initialize_output (:: typeof ($ f!), d:: AbstractTensorMap ,
20+ :: DiagonalAlgorithm )
2121 if scalartype (d) <: Real
2222 return d, similar (d)
2323 else
@@ -27,36 +27,37 @@ for f! in (:eigh_full!, :eigh_trunc!)
2727end
2828
2929for f! in (:qr_full! , :qr_compact! )
30- @eval function initialize_output (:: typeof ($ f!), d:: AbstractTensorMap ,
31- :: DiagonalAlgorithm )
30+ @eval function MAK . initialize_output (:: typeof ($ f!), d:: AbstractTensorMap ,
31+ :: DiagonalAlgorithm )
3232 return d, similar (d)
3333 end
3434 # to avoid ambiguities
35- @eval function initialize_output (:: typeof ($ f!), d:: AdjointTensorMap ,
36- :: DiagonalAlgorithm )
35+ @eval function MAK . initialize_output (:: typeof ($ f!), d:: AdjointTensorMap ,
36+ :: DiagonalAlgorithm )
3737 return d, similar (d)
3838 end
3939end
4040for f! in (:lq_full! , :lq_compact! )
41- @eval function initialize_output (:: typeof ($ f!), d:: AbstractTensorMap ,
42- :: DiagonalAlgorithm )
41+ @eval function MAK . initialize_output (:: typeof ($ f!), d:: AbstractTensorMap ,
42+ :: DiagonalAlgorithm )
4343 return similar (d), d
4444 end
4545 # to avoid ambiguities
46- @eval function initialize_output (:: typeof ($ f!), d:: AdjointTensorMap ,
47- :: DiagonalAlgorithm )
46+ @eval function MAK . initialize_output (:: typeof ($ f!), d:: AdjointTensorMap ,
47+ :: DiagonalAlgorithm )
4848 return similar (d), d
4949 end
5050end
5151
52- function initialize_output (:: typeof (left_orth!), d:: DiagonalTensorMap )
52+ function MAK . initialize_output (:: typeof (left_orth!), d:: DiagonalTensorMap )
5353 return d, similar (d)
5454end
55- function initialize_output (:: typeof (right_orth!), d:: DiagonalTensorMap )
55+ function MAK . initialize_output (:: typeof (right_orth!), d:: DiagonalTensorMap )
5656 return similar (d), d
5757end
5858
59- function initialize_output (:: typeof (svd_full!), t:: AbstractTensorMap , :: DiagonalAlgorithm )
59+ function MAK. initialize_output (:: typeof (svd_full!), t:: AbstractTensorMap ,
60+ :: DiagonalAlgorithm )
6061 V_cod = fuse (codomain (t))
6162 V_dom = fuse (domain (t))
6263 U = similar (t, codomain (t) ← V_cod)
6869for f! in
6970 (:qr_full! , :qr_compact! , :lq_full! , :lq_compact! , :eig_full! , :eig_trunc! , :eigh_full! ,
7071 :eigh_trunc! , :right_orth! , :left_orth! )
71- @eval function $f! (d:: DiagonalTensorMap , F, alg:: DiagonalAlgorithm )
72- check_input ($ f!, d, F, alg)
72+ @eval function MAK . $f! (d:: DiagonalTensorMap , F, alg:: DiagonalAlgorithm )
73+ MAK . check_input ($ f!, d, F, alg)
7374 $ f! (_repack_diagonal (d), _repack_diagonal .(F), alg)
7475 return F
7576 end
7677end
7778
7879for f! in (:qr_full! , :qr_compact! )
79- @eval function check_input (:: typeof ($ f!), d:: AbstractTensorMap , QR,
80- :: DiagonalAlgorithm )
80+ @eval function MAK . check_input (:: typeof ($ f!), d:: AbstractTensorMap , QR,
81+ :: DiagonalAlgorithm )
8182 Q, R = QR
8283 @assert d isa DiagonalTensorMap
8384 @assert Q isa DiagonalTensorMap && R isa DiagonalTensorMap
@@ -91,8 +92,8 @@ for f! in (:qr_full!, :qr_compact!)
9192end
9293
9394for f! in (:lq_full! , :lq_compact! )
94- @eval function check_input (:: typeof ($ f!), d:: AbstractTensorMap , LQ,
95- :: DiagonalAlgorithm )
95+ @eval function MAK . check_input (:: typeof ($ f!), d:: AbstractTensorMap , LQ,
96+ :: DiagonalAlgorithm )
9697 L, Q = LQ
9798 @assert d isa DiagonalTensorMap
9899 @assert Q isa DiagonalTensorMap && L isa DiagonalTensorMap
@@ -106,25 +107,27 @@ for f! in (:lq_full!, :lq_compact!)
106107end
107108
108109# disambiguate
109- svd_compact! (t:: AbstractTensorMap , USVᴴ, alg:: DiagonalAlgorithm ) = svd_full! (t, USVᴴ, alg)
110+ function MAK. svd_compact! (t:: AbstractTensorMap , USVᴴ, alg:: DiagonalAlgorithm )
111+ return svd_full! (t, USVᴴ, alg)
112+ end
110113
111114# f_vals
112115# ------
113116
114117for f! in (:eig_vals! , :eigh_vals! , :svd_vals! )
115- @eval function $f! (d:: AbstractTensorMap , V, alg:: DiagonalAlgorithm )
116- check_input ($ f!, d, V, alg)
118+ @eval function MAK . $f! (d:: AbstractTensorMap , V, alg:: DiagonalAlgorithm )
119+ MAK . check_input ($ f!, d, V, alg)
117120 $ f! (_repack_diagonal (d), diagview (_repack_diagonal (V)), alg)
118121 return V
119122 end
120- @eval function initialize_output (:: typeof ($ f!), d:: DiagonalTensorMap ,
121- alg:: DiagonalAlgorithm )
122- data = initialize_output ($ f!, _repack_diagonal (d), alg)
123+ @eval function MAK . initialize_output (:: typeof ($ f!), d:: DiagonalTensorMap ,
124+ alg:: DiagonalAlgorithm )
125+ data = MAK . initialize_output ($ f!, _repack_diagonal (d), alg)
123126 return DiagonalTensorMap (data, d. domain)
124127 end
125128end
126129
127- function check_input (:: typeof (eig_full!), t:: DiagonalTensorMap , DV, :: DiagonalAlgorithm )
130+ function MAK . check_input (:: typeof (eig_full!), t:: DiagonalTensorMap , DV, :: DiagonalAlgorithm )
128131 domain (t) == codomain (t) ||
129132 throw (ArgumentError (" Eigenvalue decomposition requires square input tensor" ))
130133
@@ -144,7 +147,8 @@ function check_input(::typeof(eig_full!), t::DiagonalTensorMap, DV, ::DiagonalAl
144147 return nothing
145148end
146149
147- function check_input (:: typeof (eigh_full!), t:: DiagonalTensorMap , DV, :: DiagonalAlgorithm )
150+ function MAK. check_input (:: typeof (eigh_full!), t:: DiagonalTensorMap , DV,
151+ :: DiagonalAlgorithm )
148152 domain (t) == codomain (t) ||
149153 throw (ArgumentError (" Eigenvalue decomposition requires square input tensor" ))
150154
@@ -164,21 +168,21 @@ function check_input(::typeof(eigh_full!), t::DiagonalTensorMap, DV, ::DiagonalA
164168 return nothing
165169end
166170
167- function check_input (:: typeof (eig_vals!), t:: AbstractTensorMap , D, :: DiagonalAlgorithm )
171+ function MAK . check_input (:: typeof (eig_vals!), t:: AbstractTensorMap , D, :: DiagonalAlgorithm )
168172 @assert D isa DiagonalTensorMap
169173 @check_scalar D t
170174 @check_space D space (t)
171175 return nothing
172176end
173177
174- function check_input (:: typeof (eigh_vals!), t:: AbstractTensorMap , D, :: DiagonalAlgorithm )
178+ function MAK . check_input (:: typeof (eigh_vals!), t:: AbstractTensorMap , D, :: DiagonalAlgorithm )
175179 @assert D isa DiagonalTensorMap
176180 @check_scalar D t real
177181 @check_space D space (t)
178182 return nothing
179183end
180184
181- function check_input (:: typeof (svd_vals!), t:: AbstractTensorMap , D, :: DiagonalAlgorithm )
185+ function MAK . check_input (:: typeof (svd_vals!), t:: AbstractTensorMap , D, :: DiagonalAlgorithm )
182186 @assert D isa DiagonalTensorMap
183187 @check_scalar D t real
184188 @check_space D space (t)
0 commit comments