# Is there a defined minimal interface for a type to work with SparseArrays?

**URL:** https://discourse.julialang.org/t/is-there-a-defined-minimal-interface-for-a-type-to-work-with-sparsearrays/69602
**Category:** Internals & Design
**Tags:** sparse, interface
**Created:** [October 12, 2021, 3:37am UTC](https://discourse.julialang.org/t/is-there-a-defined-minimal-interface-for-a-type-to-work-with-sparsearrays/69602 "2021-10-12T03:37:20Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![suavesito](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/suavesito/32/34386_2.png) [@suavesito](https://discourse.julialang.org/u/suavesito)
#### Post date: [October 12, 2021, 6:23pm UTC](https://discourse.julialang.org/t/is-there-a-defined-minimal-interface-for-a-type-to-work-with-sparsearrays/69602/3 "2021-10-12T18:23:14Z")

</div>

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)

```julia
using Symbolics
using SparseArrays

@variables a

v = sparsevec([1], [v])

v+v # here throws an error

```

---

_[View the full topic](https://discourse.julialang.org/t/is-there-a-defined-minimal-interface-for-a-type-to-work-with-sparsearrays/69602)._
