# SparseArray with width or height 0

I can store the zero matrix (=module morphism) $R^2\overset{a}{\leftarrow} R^3$ as a=SparseArray[{},{2,3}]. But

• $R^0\overset{a}{\leftarrow} R^3$ stored as a=SparseArray[{},{0,3}],
• $R^2\overset{a}{\leftarrow} R^0$ stored as a=SparseArray[{},{2,0}],
• $R^0\overset{a}{\leftarrow} R^0$ stored as a=SparseArray[{},{0,0}],

is no longer a SparseArray and contains no info about the dimensions of $a$. How can I remedy this?

• Is there no other way than to store the dimensions in a separate list? – Leo Sep 4 '18 at 16:36
• Mathematica represents tensors as nested lists. This means that representing zero-dimensional ones is not possible. 1x0 would be {{}} but 0x1 or similar is not possible (when a result would be this it usually gives us {}, a length-0 1-index tensor). While this applies to non-sparse arrays, it seems that it's SparseArray data structure stays consistent with this. – Szabolcs Sep 4 '18 at 16:58