Oleksandr remarked on the memory required for a dense matrix. I shall attempt to explore SparseArray
limitations.
From this error message it appears that the dimensions of the array must be machine integers:
SparseArray[{}, {2, 2}^70]
SparseArray::adims: Array dimension specification {1180591620717411303424,1180591620717411303424} should be Automatic, a non-negative machine integer, or a list of non-negative machine integers. >>
If smaller dimensions are used it may still take too much memory:
SparseArray[{}, {2, 2}^60]
No more memory available.
Mathematica kernel has shut down.
Try quitting other applications and then retry.
From earlier experimentation I determined that every row in the arrays takes significant memory, so if we limit the number of rows:
SparseArray[{}, {2^20, 2^63 - 2}] // ByteCount
8389184
Mathematica is easily able to address a sparse array with 2^20 rows and on my machine up to 2^63 - 2 columns. However transposing this array would be impossible.
While we can assemble a SparseArray
of this size with some non-zero elements:
rls =
Array[
Round[RandomReal[1, 2]*{2^20, 2^63 - 2}] -> # &,
1000
];
test = SparseArray[rls, {2^20, 2^63 - 2}];
and some fundamental operations are possible:
3*test // ByteCount
8405720
others operations are not:
SparseArray[{1 -> 2, 7 -> 14, 183 -> 99}, 2^20].test
No more memory available.
Mathematica kernel has shut down.
Try quitting other applications and then retry.