Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "BlockSparseArrays"
uuid = "2c9a651f-6452-4ace-a6ac-809f4280fbb4"
authors = ["ITensor developers <[email protected]> and contributors"]
version = "0.5.4"
version = "0.5.5"

[deps]
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
Expand Down Expand Up @@ -39,7 +39,7 @@ GPUArraysCore = "0.1.0, 0.2"
LinearAlgebra = "1.10"
MacroTools = "0.5.13"
MapBroadcast = "0.1.5"
MatrixAlgebraKit = "0.1.2"
MatrixAlgebraKit = "0.2"
SparseArraysBase = "0.5"
SplitApplyCombine = "1.2.3"
TensorAlgebra = "0.3.2"
Expand Down
18 changes: 15 additions & 3 deletions src/factorizations/svd.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,27 @@ struct BlockPermutedDiagonalAlgorithm{A<:MatrixAlgebraKit.AbstractAlgorithm} <:
alg::A
end

# TODO: this is a hardcoded for now to get around this function not being defined in the
# type domain
function MatrixAlgebraKit.default_svd_algorithm(A::AbstractBlockSparseMatrix; kwargs...)
function default_blocksparse_svd_algorithm(f, A; kwargs...)
blocktype(A) <: StridedMatrix{<:LinearAlgebra.BLAS.BlasFloat} ||
error("unsupported type: $(blocktype(A))")
# TODO: this is a hardcoded for now to get around this function not being defined in the
# type domain
# alg = MatrixAlgebraKit.default_algorithm(f, blocktype(A); kwargs...)
alg = MatrixAlgebraKit.LAPACK_DivideAndConquer(; kwargs...)
return BlockPermutedDiagonalAlgorithm(alg)
end

function MatrixAlgebraKit.default_algorithm(
f::typeof(svd_compact!), A::AbstractBlockSparseMatrix; kwargs...
)
return default_blocksparse_svd_algorithm(f, A; kwargs...)
end
function MatrixAlgebraKit.default_algorithm(
f::typeof(svd_full!), A::AbstractBlockSparseMatrix; kwargs...
)
return default_blocksparse_svd_algorithm(f, A; kwargs...)
end

function similar_output(
::typeof(svd_compact!),
A,
Expand Down
2 changes: 1 addition & 1 deletion test/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ DiagonalArrays = "0.3"
GPUArraysCore = "0.2"
JLArrays = "0.2"
LinearAlgebra = "1"
MatrixAlgebraKit = "0.1"
MatrixAlgebraKit = "0.2"
Random = "1"
SafeTestsets = "0.1"
SparseArraysBase = "0.5"
Expand Down
Loading