My Julia version is 1.6.3. But even testing my code with 1.7 (or even master) it does not work. It seems that it is accepted the interface of zero
and iszero
. But in some other places != zero
and == zero
is used instead of !iszero
and iszero
.
Which in this case makes SparseArrays to not work with Num
given that (if a
is a symbolic variable) a != zero(a)
returns an Expression
instead of a Bool
.
MWE (Julia 1.6.3, latest Symbolics)
using Symbolics
using SparseArrays
@variables a
v = sparsevec([1], [v])
v+v # here throws an error