# Sparse A\\B

**URL:** <https://discourse.julialang.org/t/sparse-a-b/107725>\
**Category:** Numerics\
**Tags:** question, linearalgebra, sparse\
**Created:** [December 17, 2023, 3:39am UTC](https://discourse.julialang.org/t/sparse-a-b/107725 "2023-12-17T03:39:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tbeason](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tbeason/32/15898_2.png) [@tbeason](https://discourse.julialang.org/u/tbeason)\
**Post date:** [December 17, 2023, 3:39am UTC](https://discourse.julialang.org/t/sparse-a-b/107725/1 "2023-12-17T03:39:36Z")

</div>

What is the best way to solve `A\B` where `A` and `B` are sparse, and where the result is also known to be sparse? Right now it seems I have to do `sparse(A \ Matrix(B))`.

---

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [December 17, 2023, 3:43am UTC](https://discourse.julialang.org/t/sparse-a-b/107725/2 "2023-12-17T03:43:47Z")

</div>

> [@tbeason](#):
>
> What is the best way to solve `A\B` where `A` and `B` are sparse, and where the result is also known to be sparse?

Beware that the inverse is rarely sparse. But in cases where it is, see [SparseSparse for inverting structured sparse matrices](https://discourse.julialang.org/t/sparsesparse-for-inverting-structured-sparse-matrices/105715)

---

<div class="post-metadata">

**Author:** ![tbeason](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tbeason/32/15898_2.png) [@tbeason](https://discourse.julialang.org/u/tbeason)\
**Post date:** [December 17, 2023, 4:10am UTC](https://discourse.julialang.org/t/sparse-a-b/107725/3 "2023-12-17T04:10:11Z")

</div>

I am aware. For this particular problem type, it is. The problem starts relatively sparse for small sizes, but sparsity increases quickly as the problem size grows. Thanks for the reference.
