Skip to content

Commit 5f6fa66

Browse files
authored
Bump to MatrixAlgebraKit v0.2 (#119)
1 parent 297e724 commit 5f6fa66

File tree

3 files changed

+18
-6
lines changed

3 files changed

+18
-6
lines changed

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "BlockSparseArrays"
22
uuid = "2c9a651f-6452-4ace-a6ac-809f4280fbb4"
33
authors = ["ITensor developers <[email protected]> and contributors"]
4-
version = "0.5.4"
4+
version = "0.5.5"
55

66
[deps]
77
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
@@ -39,7 +39,7 @@ GPUArraysCore = "0.1.0, 0.2"
3939
LinearAlgebra = "1.10"
4040
MacroTools = "0.5.13"
4141
MapBroadcast = "0.1.5"
42-
MatrixAlgebraKit = "0.1.2"
42+
MatrixAlgebraKit = "0.2"
4343
SparseArraysBase = "0.5"
4444
SplitApplyCombine = "1.2.3"
4545
TensorAlgebra = "0.3.2"

src/factorizations/svd.jl

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,27 @@ struct BlockPermutedDiagonalAlgorithm{A<:MatrixAlgebraKit.AbstractAlgorithm} <:
1212
alg::A
1313
end
1414

15-
# TODO: this is a hardcoded for now to get around this function not being defined in the
16-
# type domain
17-
function MatrixAlgebraKit.default_svd_algorithm(A::AbstractBlockSparseMatrix; kwargs...)
15+
function default_blocksparse_svd_algorithm(f, A; kwargs...)
1816
blocktype(A) <: StridedMatrix{<:LinearAlgebra.BLAS.BlasFloat} ||
1917
error("unsupported type: $(blocktype(A))")
18+
# TODO: this is a hardcoded for now to get around this function not being defined in the
19+
# type domain
20+
# alg = MatrixAlgebraKit.default_algorithm(f, blocktype(A); kwargs...)
2021
alg = MatrixAlgebraKit.LAPACK_DivideAndConquer(; kwargs...)
2122
return BlockPermutedDiagonalAlgorithm(alg)
2223
end
2324

25+
function MatrixAlgebraKit.default_algorithm(
26+
f::typeof(svd_compact!), A::AbstractBlockSparseMatrix; kwargs...
27+
)
28+
return default_blocksparse_svd_algorithm(f, A; kwargs...)
29+
end
30+
function MatrixAlgebraKit.default_algorithm(
31+
f::typeof(svd_full!), A::AbstractBlockSparseMatrix; kwargs...
32+
)
33+
return default_blocksparse_svd_algorithm(f, A; kwargs...)
34+
end
35+
2436
function similar_output(
2537
::typeof(svd_compact!),
2638
A,

test/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ DiagonalArrays = "0.3"
2828
GPUArraysCore = "0.2"
2929
JLArrays = "0.2"
3030
LinearAlgebra = "1"
31-
MatrixAlgebraKit = "0.1"
31+
MatrixAlgebraKit = "0.2"
3232
Random = "1"
3333
SafeTestsets = "0.1"
3434
SparseArraysBase = "0.5"

0 commit comments

Comments
 (0)