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,6 +1,6 @@
name = "SparseArraysBase"
uuid = "0d5efcca-f356-4864-8770-e1ed8d78f208"
version = "0.10.9"
version = "0.11.0"
authors = ["ITensor developers <support@itensor.org> and contributors"]

[workspace]
Expand Down Expand Up @@ -30,5 +30,5 @@ LinearAlgebra = "1.10"
MapBroadcast = "0.1.5"
Random = "1.10"
SparseArrays = "1.10"
TensorAlgebra = "0.17.5, 0.18"
TensorAlgebra = "0.19"
julia = "1.10"
2 changes: 1 addition & 1 deletion docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ Dictionaries = "0.4.4"
Documenter = "1.8.1"
ITensorFormatter = "0.2.27"
Literate = "2.20.1"
SparseArraysBase = "0.10"
SparseArraysBase = "0.11"
2 changes: 1 addition & 1 deletion examples/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ path = ".."

[compat]
Dictionaries = "0.4.4"
SparseArraysBase = "0.10"
SparseArraysBase = "0.11"
Test = "<0.0.1, 1"
14 changes: 7 additions & 7 deletions src/tensoralgebra.jl
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
using SparseArrays: SparseMatrixCSC
using TensorAlgebra: TensorAlgebra, FusionStyle, ReshapeFusion, matricize, unmatricize
using TensorAlgebra: TensorAlgebra, MatricizeStyle, ReshapeMatricize, matricize, unmatricize

struct SparseArrayFusion <: FusionStyle end
TensorAlgebra.FusionStyle(::Type{<:AnyAbstractSparseArray}) = SparseArrayFusion()
struct SparseArrayMatricize <: MatricizeStyle end
TensorAlgebra.MatricizeStyle(::Type{<:AnyAbstractSparseArray}) = SparseArrayMatricize()

function TensorAlgebra.matricize(
style::SparseArrayFusion, a::AbstractArray, length_codomain::Val
style::SparseArrayMatricize, a::AbstractArray, length_codomain::Val
)
m = matricize(ReshapeFusion(), a, length_codomain)
m = matricize(ReshapeMatricize(), a, length_codomain)
return convert(SparseMatrixCSC, m)
end
function TensorAlgebra.unmatricize(
style::SparseArrayFusion,
style::SparseArrayMatricize,
m::AbstractMatrix,
axes_codomain::Tuple{Vararg{AbstractUnitRange}},
axes_domain::Tuple{Vararg{AbstractUnitRange}}
)
a = unmatricize(ReshapeFusion(), m, axes_codomain, axes_domain)
a = unmatricize(ReshapeMatricize(), m, axes_codomain, axes_domain)
# TODO: Use `similar_type(m)` instead of hardcoding to `SparseArrayDOK`?
return convert(SparseArrayDOK, a)
end
Expand Down
4 changes: 2 additions & 2 deletions test/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ LinearAlgebra = "<0.0.1, 1"
Random = "<0.0.1, 1"
SafeTestsets = "0.1"
SparseArrays = "1.10"
SparseArraysBase = "0.10"
SparseArraysBase = "0.11"
StableRNGs = "1.0.2"
Suppressor = "0.2.8"
TensorAlgebra = "0.17.4, 0.18"
TensorAlgebra = "0.19"
Test = "<0.0.1, 1"
Loading