Skip to content

Commit

Permalink
more updates
Browse files Browse the repository at this point in the history
  • Loading branch information
lkdvos committed Nov 9, 2023
1 parent 1ad344a commit 5478905
Show file tree
Hide file tree
Showing 8 changed files with 1,463 additions and 845 deletions.
55 changes: 28 additions & 27 deletions src/BlockTensorKit.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,44 +17,45 @@ using Strided
using TupleTools: getindices, isperm
using BlockArrays
using TupleTools
using Base: @propagate_inbounds

using VectorInterface: VectorInterface
import VectorInterface as VI
import TensorKit as TK
import TensorOperations as TO

# Spaces
include("sumspace.jl")
export SumSpace
export SumSpace, ProductSumSpace

# TensorMaps
include("blockarray.jl")
# include("blocktensor.jl")
include("blocktensor.jl")
include("sparseblocktensor.jl")
export BlockTensorMap
# export blocktype

# implementations
include("indexmanipulations.jl")
include("linalg.jl")
include("vectorinterface.jl")
include("tensoroperations.jl")

function adjointtensormaptype(::Type{S}, N₁::Int, N₂::Int, ::Type{T}) where {S,T}
I = sectortype(S)
if T <: DenseMatrix
M = T
elseif T <: Number
M = Matrix{T}
else
throw(ArgumentError("the final argument of `tensormaptype` should either be the scalar or the storage type, i.e. a subtype of `Number` or of `DenseMatrix`"))
end
if I === Trivial
return AdjointTensorMap{S,N₁,N₂,I,M,Nothing,Nothing}
else
F₁ = fusiontreetype(I, N₁)
F₂ = fusiontreetype(I, N₂)
return AdjointTensorMap{S,N₁,N₂,I,SectorDict{I,M},F₁,F₂}
end
end
adjointtensormaptype(S, N₁, N₂=0) = adjointtensormaptype(S, N₁, N₂, Float64)
# include("indexmanipulations.jl")
# include("linalg.jl")
# include("vectorinterface.jl")
# include("tensoroperations.jl")

# function adjointtensormaptype(::Type{S}, N₁::Int, N₂::Int, ::Type{T}) where {S,T}
# I = sectortype(S)
# if T <: DenseMatrix
# M = T
# elseif T <: Number
# M = Matrix{T}
# else
# throw(ArgumentError("the final argument of `tensormaptype` should either be the scalar or the storage type, i.e. a subtype of `Number` or of `DenseMatrix`"))
# end
# if I === Trivial
# return AdjointTensorMap{S,N₁,N₂,I,M,Nothing,Nothing}
# else
# F₁ = fusiontreetype(I, N₁)
# F₂ = fusiontreetype(I, N₂)
# return AdjointTensorMap{S,N₁,N₂,I,SectorDict{I,M},F₁,F₂}
# end
# end
# adjointtensormaptype(S, N₁, N₂=0) = adjointtensormaptype(S, N₁, N₂, Float64)

end
Loading

0 comments on commit 5478905

Please sign in to comment.