diff --git a/Project.toml b/Project.toml index 8cf65b6..570e05e 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "TensorAlgebra" uuid = "68bd88dc-f39d-4e12-b2ca-f046b68fcc6a" authors = ["ITensor developers and contributors"] -version = "0.3.9" +version = "0.3.10" [deps] ArrayLayouts = "4c555306-a7a7-4459-81d9-ec55ddd5c99a" diff --git a/src/matricize.jl b/src/matricize.jl index 85470a4..3b19078 100644 --- a/src/matricize.jl +++ b/src/matricize.jl @@ -74,30 +74,19 @@ function matricize(a::AbstractArray, permblock1::Tuple, permblock2::Tuple) end # ==================================== unmatricize ======================================= -function unmatricize( - m::AbstractMatrix, - axes::Tuple{Vararg{AbstractUnitRange}}, - biperm::AbstractBlockPermutation{2}, -) +function unmatricize(m::AbstractMatrix, axes, biperm::AbstractBlockPermutation{2}) length(axes) == length(biperm) || throw(ArgumentError("axes do not match permutation")) return unmatricize(FusionStyle(m), m, axes, biperm) end function unmatricize( - ::FusionStyle, - m::AbstractMatrix, - axes::Tuple{Vararg{AbstractUnitRange}}, - biperm::AbstractBlockPermutation{2}, + ::FusionStyle, m::AbstractMatrix, axes, biperm::AbstractBlockPermutation{2} ) blocked_axes = axes[biperm] a_perm = unmatricize(m, blocked_axes) return permuteblockeddims(a_perm, invperm(biperm)) end -function unmatricize(::ReshapeFusion, m::AbstractMatrix, axes::AbstractUnitRange...) - return reshape(m, axes...) -end - function unmatricize( ::ReshapeFusion, m::AbstractMatrix, @@ -106,9 +95,7 @@ function unmatricize( return reshape(m, Tuple(blocked_axes)...) end -function unmatricize( - m::AbstractMatrix, blocked_axes::BlockedTuple{2,<:Any,<:Tuple{Vararg{AbstractUnitRange}}} -) +function unmatricize(m::AbstractMatrix, blocked_axes) return unmatricize(FusionStyle(m), m, blocked_axes) end @@ -121,9 +108,7 @@ function unmatricize( return unmatricize(m, blocked_axes) end -function unmatricize!( - a::AbstractArray, m::AbstractMatrix, biperm::AbstractBlockPermutation{2} -) +function unmatricize!(a, m::AbstractMatrix, biperm::AbstractBlockPermutation{2}) ndims(a) == length(biperm) || throw(ArgumentError("destination does not match permutation")) blocked_axes = axes(a)[biperm]