def kron(a, b):
 if (not a.flags['CONTIGUOUS']):
  a = np.reshape(a, a.shape)
 if (not b.flags['CONTIGUOUS']):
  b = np.reshape(b, b.shape)
 o = np.outer(a, b)
 o = o.reshape((a.shape + b.shape))
 return np.concatenate(np.concatenate(o, axis=1), axis=1)

def kron ( a , b ) : if ( not a . flags [ 'CONTIGUOUS' ] ) : a = np . reshape ( a , a . shape ) if ( not b . flags [ 'CONTIGUOUS' ] ) : b = np . reshape ( b , b . shape ) o = np . outer ( a , b ) o = o . reshape ( ( a . shape + b . shape ) ) return np . concatenate ( np . concatenate ( o , axis = 1 ) , axis = 1 )
kronecker product of two matrices .