diff --git a/Project.toml b/Project.toml index 88dc51a..eb00b61 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "ITensorBase" uuid = "4795dd04-0d67-49bb-8f44-b89c448a1dc7" authors = ["ITensor developers and contributors"] -version = "0.2.7" +version = "0.2.8" [deps] Accessors = "7d9f7c33-5ae7-4f3b-8dc6-eff91059b697" @@ -27,7 +27,7 @@ ITensorBaseSparseArraysBaseExt = ["NamedDimsArrays", "SparseArraysBase"] [compat] Accessors = "0.1.39" -DerivableInterfaces = "0.4" +DerivableInterfaces = "0.5" DiagonalArrays = "0.3" FillArrays = "1.13" GradedArrays = "0.4" diff --git a/src/abstractitensor.jl b/src/abstractitensor.jl index e24e346..ccc4d70 100644 --- a/src/abstractitensor.jl +++ b/src/abstractitensor.jl @@ -46,8 +46,11 @@ end using DerivableInterfaces: @derive, @interface, AbstractArrayInterface -abstract type AbstractAllocatableArrayInterface <: AbstractArrayInterface end -struct AllocatableArrayInterface <: AbstractAllocatableArrayInterface end +abstract type AbstractAllocatableArrayInterface{N} <: AbstractArrayInterface{N} end +struct AllocatableArrayInterface{N} <: AbstractAllocatableArrayInterface{N} end +AllocatableArrayInterface{M}(::Val{N}) where {M,N} = AllocatableArrayInterface{N}() +AllocatableArrayInterface(::Val{N}) where {N} = AllocatableArrayInterface{N}() +AllocatableArrayInterface() = AllocatableArrayInterface{Any}() unallocatable(a::AbstractITensor) = NamedDimsArray(a)