def samplemat(dims):
 aa = np.zeros(dims)
 for i in range(min(dims)):
  aa[(i, i)] = i
 return aa

def samplemat ( dims ) : aa = np . zeros ( dims ) for i in range ( min ( dims ) ) : aa [ ( i , i ) ] = i return aa
make a matrix with all zeros and increasing elements on the diagonal .