def vech(A):
 length = A.shape[1]
 vechvec = []
 for i in range(length):
  b = i
  while (b < length):
   vechvec.append(A[(b, i)])
   b = (b + 1)
 vechvec = np.asarray(vechvec)
 return vechvec

def vech ( A ) : length = A . shape [ 1 ] vechvec = [ ] for i in range ( length ) : b = i while ( b < length ) : vechvec . append ( A [ ( b , i ) ] ) b = ( b + 1 ) vechvec = np . asarray ( vechvec ) return vechvec
simple vech operator returns vechvec: vector of all elements on and below diagonal .