Let's say I have a "small" `SparseArray`, in the example $2\times2$ MatrixForm[ m2 = SparseArray[{{i_,i_}->1,{1,2}->a},2] ] [![enter image description here][1]][1] I want to expand it to a $4\times4$ `SparseArray` without rewriting it. let's say m4test = SparseArray[{{i_,i_}->1,{1,2}->a, {3,4}->b },4] [![enter image description here][2]][2] **How do I efficiently (not expanding and contracting) do I transform `m2` into `m4`?** ## Due diligence I have tried this, extendSparseArray[sa_, rules_] := SparseArray[ Join[rules, ArrayRules[sa]] , Max[Join[Dimensions[sa],Flatten@rules[[All,1]] ] ] ] MatrixForm[ extendSparseArray[m2, {{3,4}->b}] ] [![enter image description here][3]][3] Which does the job, but seems cumbersome. I'm sure I'm missing something more fundamental. **What are simple and idiomatic ways to achieve this and which one performs the best?** [1]: https://i.sstatic.net/t4zPT5yf.png [2]: https://i.sstatic.net/Jp4PJbJ2.png [3]: https://i.sstatic.net/Jp3ajUt2.png