dump b-matrix according to off-diagonal entries