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 = "FusionTensors"
uuid = "e16ca583-1f51-4df0-8e12-57d32947d33e"
authors = ["ITensor developers <[email protected]> and contributors"]
version = "0.5.15"
version = "0.5.16"

[deps]
Accessors = "7d9f7c33-5ae7-4f3b-8dc6-eff91059b697"
Expand Down Expand Up @@ -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"
Expand Down
15 changes: 8 additions & 7 deletions src/fusiontensor/tensor_algebra_interface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -52,15 +52,15 @@ 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}},
)
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}},
Expand All @@ -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,
Expand Down Expand Up @@ -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...))
Expand Down
Loading