diff --git a/src/tensor_operations/tensor_algebra.jl b/src/tensor_operations/tensor_algebra.jl index 36381d6caf..c5c0b9d70b 100644 --- a/src/tensor_operations/tensor_algebra.jl +++ b/src/tensor_operations/tensor_algebra.jl @@ -261,6 +261,12 @@ function directsum_projectors( return D1, D2 end +function directsum_projectors(::Type{<:EmptyNumber}, ::Type{<:EmptyNumber}, ::Index, ::Index, ::Index) + error("It is not possible to call directsum on two tensors with element type EmptyNumber. + If you are inputting ITensors constructor like ITensor(i, j), try specifying the element type, + e.g. ITensor(Float64, i, j), or filling them with zero value, e.g. ITensor(0.0, i, j).") +end + function check_directsum_inds(A::ITensor, I, B::ITensor, J) a = uniqueinds(A, I) b = uniqueinds(B, J)