@@ -381,26 +381,7 @@ subblocktype(T::Type) = throw(MethodError(subblocktype, (T,)))
381381
382382# Indexing behavior
383383# -----------------
384- @doc """
385- Base.view(t::AbstractTensorMap, sectors::Tuple{Vararg{Sector}})
386- Base.view(t::AbstractTensorMap, f₁::FusionTree, f₂::FusionTree)
387-
388- $_doc_subblock
389-
390- !!! note
391- Contrary to Julia's array types, the default indexing behavior is to return a view
392- into the tensor data. As a result, `getindex` and `view` have the same behavior.
393-
394- See also [`subblock`](@ref), [`subblocks`](@ref) and [`fusiontrees`](@ref).
395- """ Base. view (:: AbstractTensorMap , :: Tuple{I, Vararg{I}} ) where {I <: Sector },
396- Base. view (:: AbstractTensorMap , :: FusionTree , :: FusionTree )
397-
398- @inline Base. view (t:: AbstractTensorMap , sectors:: Tuple{I, Vararg{I}} ) where {I <: Sector } =
399- subblock (t, sectors)
400- @inline Base. view (t:: AbstractTensorMap , f₁:: FusionTree , f₂:: FusionTree ) =
401- subblock (t, (f₁, f₂))
402-
403- # by default getindex returns views
384+ # by default getindex returns views!
404385@doc """
405386 Base.getindex(t::AbstractTensorMap, sectors::Tuple{Vararg{Sector}})
406387 t[sectors]
@@ -418,9 +399,9 @@ See also [`subblock`](@ref), [`subblocks`](@ref) and [`fusiontrees`](@ref).
418399 Base. getindex (:: AbstractTensorMap , :: FusionTree , :: FusionTree )
419400
420401@inline Base. getindex (t:: AbstractTensorMap , sectors:: Tuple{I, Vararg{I}} ) where {I <: Sector } =
421- view (t, sectors)
402+ subblock (t, sectors)
422403@inline Base. getindex (t:: AbstractTensorMap , f₁:: FusionTree , f₂:: FusionTree ) =
423- view (t, f₁, f₂)
404+ subblock (t, ( f₁, f₂) )
424405
425406@doc """
426407 Base.setindex!(t::AbstractTensorMap, v, sectors::Tuple{Vararg{Sector}})
@@ -436,9 +417,9 @@ See also [`subblock`](@ref), [`subblocks`](@ref) and [`fusiontrees`](@ref).
436417 Base. setindex! (:: AbstractTensorMap , :: Any , :: FusionTree , :: FusionTree )
437418
438419@inline Base. setindex! (t:: AbstractTensorMap , v, sectors:: Tuple{I, Vararg{I}} ) where {I <: Sector } =
439- copy! (view (t, sectors), v)
420+ copy! (subblock (t, sectors), v)
440421@inline Base. setindex! (t:: AbstractTensorMap , v, f₁:: FusionTree , f₂:: FusionTree ) =
441- copy! (view (t, (f₁, f₂)), v)
422+ copy! (subblock (t, (f₁, f₂)), v)
442423
443424# Derived indexing behavior for tensors with trivial symmetry
444425# -------------------------------------------------------------
625606
626607# Conversion to Array:
627608# ----------------------
628- Base. ndims (t:: AbstractTensorMap ) = numind (t)
629- Base. size (t:: AbstractTensorMap ) = ntuple (Base. Fix1 (size, t), numind (t))
630- Base. size (t:: AbstractTensorMap , i) = dim (space (t, i))
631-
632609# probably not optimized for speed, only for checking purposes
633610function Base. convert (:: Type{Array} , t:: AbstractTensorMap )
634611 I = sectortype (t)
0 commit comments