def circulant(c):
 c = np.asarray(c).ravel()
 (a, b) = np.ogrid[0:len(c), 0:(- len(c)):(-1)]
 indx = (a + b)
 return c[indx]

def circulant ( c ) : c = np . asarray ( c ) . ravel ( ) ( a , b ) = np . ogrid [ 0 : len ( c ) , 0 : ( - len ( c ) ) : ( - 1 ) ] indx = ( a + b ) return c [ indx ]
construct a circulant matrix .