Skip to content

Commit 83b5d12

Browse files
Katharine Hyattkshyatt
authored andcommitted
Use MAK main
1 parent e9386ae commit 83b5d12

2 files changed

Lines changed: 3 additions & 37 deletions

File tree

‎Project.toml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,6 @@ TimerOutputs = "1"
7272
TupleTools = "1.5"
7373
VectorInterface = "0.6, 0.7"
7474
julia = "1.10"
75+
76+
[sources]
77+
MatrixAlgebraKit = {url = "https://github.com/QuantumKitHub/MatrixAlgebraKit.jl", rev = "main"}

‎src/factorizations/diagonal.jl‎

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -78,40 +78,3 @@ function MAK.initialize_output(::typeof(eig_vals!), t::AbstractTensorMap, alg::D
7878
A = similarstoragetype(t, Tc)
7979
return SectorVector{Tc, sectortype(t), A}(undef, V_D)
8080
end
81-
82-
for (f!, bf!) in ((:svd_vals!, :batched_svd_vals!),)
83-
# diagonals don't support batching yet
84-
@eval function MAK.$f!(t::AbstractTensorMap, N, alg::DiagonalAlgorithm)
85-
@timeit_debug GLOBAL_TIMER $(string(f!)) begin
86-
foreachblock(t, N) do _, (tblock, Nblock)
87-
@timeit_debug GLOBAL_TIMER "dense: MatrixAlgebraKit" begin
88-
Nblock′ = $f!(tblock, Nblock, alg)
89-
# deal with the case where the output is not the same as the input
90-
Nblock === Nblock′ || copy!(Nblock, Nblock′)
91-
end
92-
return nothing
93-
end
94-
end
95-
return N
96-
end
97-
end
98-
99-
for (f!, bf!) in ((:svd_full!, :batched_svd_full!),)
100-
@eval function MAK.$f!(t::AbstractTensorMap, F, alg::DiagonalAlgorithm)
101-
@timeit_debug GLOBAL_TIMER $(string(f!)) begin
102-
U, S, Vᴴ = F
103-
foreachblock(t, U, S, Vᴴ) do _, (tblock, Fblocks...)
104-
@timeit_debug GLOBAL_TIMER "dense: MatrixAlgebraKit" begin
105-
Fblocks′ = $f!(tblock, Fblocks, alg)
106-
# deal with the case where the output is not in-place
107-
for (b′, b) in zip(Fblocks′, Fblocks)
108-
b === b′ || copy!(b, b′)
109-
end
110-
end
111-
return nothing
112-
end
113-
return F
114-
end
115-
end
116-
end
117-

0 commit comments

Comments
 (0)