diff --git a/Project.toml b/Project.toml index 8ec8728..473394e 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "FusionTensors" uuid = "e16ca583-1f51-4df0-8e12-57d32947d33e" authors = ["ITensor developers and contributors"] -version = "0.5.15" +version = "0.5.16" [deps] Accessors = "7d9f7c33-5ae7-4f3b-8dc6-eff91059b697" @@ -29,7 +29,7 @@ LRUCache = "1.6" LinearAlgebra = "1.10" Random = "1.10" Strided = "2.3" -TensorAlgebra = "0.5.1" +TensorAlgebra = "0.5.2" TensorKitSectors = "0.1, 0.2" TensorProducts = "0.1.7" TypeParameterAccessors = "0.4" diff --git a/src/fusiontensor/tensor_algebra_interface.jl b/src/fusiontensor/tensor_algebra_interface.jl index ade110c..72657f2 100644 --- a/src/fusiontensor/tensor_algebra_interface.jl +++ b/src/fusiontensor/tensor_algebra_interface.jl @@ -4,7 +4,7 @@ using BlockArrays: Block using GradedArrays: space_isequal using LinearAlgebra: mul! using TensorAlgebra: TensorAlgebra, AbstractBlockPermutation, FusionStyle, blockedperm, - genperm, matricize, unmatricize + blockedtrivialperm, genperm, matricize, unmatricize function TensorAlgebra.output_axes( ::typeof(contract), @@ -52,7 +52,7 @@ function TensorAlgebra.unmatricize( return FusionTensor(data_matrix(m), codomain_axes, domain_axes) end -function TensorAlgebra.permuteblockeddims( +function TensorAlgebra.bipermutedims( ft::FusionTensor, codomain_perm::Tuple{Vararg{Int}}, domain_perm::Tuple{Vararg{Int}}, @@ -60,7 +60,7 @@ function TensorAlgebra.permuteblockeddims( return permutedims(ft, permmortar((codomain_perm, domain_perm))) end -function TensorAlgebra.permuteblockeddims!( +function TensorAlgebra.bipermutedims!( a_dest::FusionTensor, a_src::FusionTensor, codomain_perm::Tuple{Vararg{Int}}, @@ -69,7 +69,8 @@ function TensorAlgebra.permuteblockeddims!( return permutedims!(a_dest, a_src, permmortar((codomain_perm, domain_perm))) end -# TODO define custom broadcast rules +# TODO: Define custom broadcast rules for FusionTensors so that we can delete +# this method. function TensorAlgebra.unmatricizeadd!( style::FusionTensorFusionStyle, a_dest::AbstractArray, @@ -119,11 +120,11 @@ for f in MATRIX_FUNCTIONS @eval begin function TensorAlgebra.$f( a::FusionTensor, - codomain_perm::Tuple{Vararg{Int}}, domain_perm::Tuple{Vararg{Int}}; + codomain_length::Val, domain_length::Val; kwargs..., ) - a_mat = matricize(a, codomain_perm, domain_perm) - biperm = permmortar((codomain_perm, domain_perm)) + a_mat = matricize(a, codomain_length, domain_length) + biperm = blockedtrivialperm((codomain_length, domain_length)) permuted_axes = axes(a)[biperm] checkspaces_dual(codomain(permuted_axes), domain(permuted_axes)) fa_mat = set_data_matrix(a_mat, Base.$f(data_matrix(a_mat); kwargs...))