We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cae9bfc commit 1f736efCopy full SHA for 1f736ef
src/itensor.jl
@@ -1,4 +1,4 @@
1
-using SparseArrays: SparseArrays, nnz
+using NDTensors: NDTensors, nnz
2
using .TagSets: TagSets, hastags, replacetags
3
4
# Private inner constructor
@@ -853,7 +853,11 @@ hasqns(T::Union{Tensor,ITensor}) = hasqns(inds(T))
853
854
eachnzblock(T::ITensor) = eachnzblock(tensor(T))
855
856
-SparseArrays.nnz(T::ITensor) = nnz(tensor(T))
+# 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))
861
862
nblocks(T::ITensor, args...) = nblocks(tensor(T), args...)
863
0 commit comments