Not quite sure if this is what you want, but in MATLAB this is what I used in the past. Probably not the most elegant solution. I go from sparse to full, and then grind the thing into square blocks.
A=full(A);
Then:
blockedmatrix = mat2cell(A, (n*ones(1,size(A,1)/n)), ... (n*ones(1,size(A,1)/n))); %found somewhere on internetz
This returns a cell where each record is of size nxn. It is easy to extract blocks of interest, manipulate them, and then restore them to a matrix using cell2mat.
source share