Skip to content

Commit 1f736ef

Browse files
committed
Try fixing tests
1 parent cae9bfc commit 1f736ef

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/itensor.jl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using SparseArrays: SparseArrays, nnz
1+
using NDTensors: NDTensors, nnz
22
using .TagSets: TagSets, hastags, replacetags
33

44
# Private inner constructor
@@ -853,7 +853,11 @@ hasqns(T::Union{Tensor,ITensor}) = hasqns(inds(T))
853853

854854
eachnzblock(T::ITensor) = eachnzblock(tensor(T))
855855

856-
SparseArrays.nnz(T::ITensor) = nnz(tensor(T))
856+
# TODO: Switch this to `SparseArrays.nnz`, it is written
857+
# this way for backwards compatibility since older versions
858+
# of NDTensors had their own `NDTensors.nnz` function
859+
# that didn't overload `SparseArrays.nnz`.
860+
NDTensors.nnz(T::ITensor) = nnz(tensor(T))
857861

858862
nblocks(T::ITensor, args...) = nblocks(tensor(T), args...)
859863

0 commit comments

Comments
 (0)