Skip to content

Commit 66d341e

Browse files
committed
fix eachindex
1 parent fb6e913 commit 66d341e

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

src/fusiontensor/base_interface.jl

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,8 @@ function Base.deepcopy(ft::FusionTensor)
6666
)
6767
end
6868

69-
# TBD eachindex with fusion trees
70-
# NEED TO DEFINE getindex(::FusionTensor, ::Tuple{SectorFusionTree,SectorFusionTree})
71-
Base.eachindex(ft::FusionTensor) = keys(trees_block_mapping(ft))
69+
Base.eachindex(::FusionTensor) = throw(MethodError(eachindex, (FusionTensor,)))
7270

73-
# TBD define getindex(ft, ::AbstractSector) to access matrix block?
7471
function Base.getindex(ft::FusionTensor, f1::SectorFusionTree, f2::SectorFusionTree)
7572
charge_matrix = data_matrix(ft)[trees_block_mapping(ft)[f1, f2]]
7673
return reshape(charge_matrix, charge_block_size(ft, f1, f2))

test/test_basics.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ include("setup.jl")
7070
@test length(ft1) == 30
7171
@test ndims(ft1) == 2
7272
@test size(ft1) == tuplemortar(((6,), (5,)))
73+
@test_throws MethodError eachindex(ft1)
7374

7475
# copy
7576
ft2 = copy(ft1)

0 commit comments

Comments
 (0)