# Why rank doesn't work for sparse matrices?

**URL:** <https://discourse.julialang.org/t/why-rank-doesnt-work-for-sparse-matrices/1846>\
**Category:** Internals & Design\
**Tags:** question, proposal\
**Created:** [February 2, 2017, 5:25pm UTC](https://discourse.julialang.org/t/why-rank-doesnt-work-for-sparse-matrices/1846 "2017-02-02T17:25:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![e3c6](https://avatars.discourse-cdn.com/v4/letter/e/e79b87/32.png) [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Post date:** [February 2, 2017, 5:25pm UTC](https://discourse.julialang.org/t/why-rank-doesnt-work-for-sparse-matrices/1846/1 "2017-02-02T17:25:32Z")

</div>

The following throws an error:

```julia
mat = sparse([1 0 0; 0 1 0; 0 0 1])
rank(mat)

```

The error:

> ERROR: MethodError: no method matching svdvals!(::SparseMatrixCSC{Float64,Int64})

---

<div class="post-metadata">

**Author:** ![e3c6](https://avatars.discourse-cdn.com/v4/letter/e/e79b87/32.png) [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Post date:** [February 2, 2017, 5:28pm UTC](https://discourse.julialang.org/t/why-rank-doesnt-work-for-sparse-matrices/1846/2 "2017-02-02T17:28:42Z")

</div>

Is this intentional? I did not find any open issues in Github requesting this so I’m about to create one…

---

<div class="post-metadata">

**Author:** ![e3c6](https://avatars.discourse-cdn.com/v4/letter/e/e79b87/32.png) [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Post date:** [February 2, 2017, 7:37pm UTC](https://discourse.julialang.org/t/why-rank-doesnt-work-for-sparse-matrices/1846/3 "2017-02-02T19:37:37Z")

</div>

[https://github.com/JuliaLang/julia/issues/20409](https://github.com/JuliaLang/julia/issues/20409)
