Computes the tensorproduct reducing last dimensoin of U with first dimension of V.
    For matrices, it is equal to regular matrix product.

def sdot( U, V ):
    '''
    Computes the tensorproduct reducing last dimensoin of U with first dimension of V.
    For matrices, it is equal to regular matrix product.
    '''
    nu = U.ndim
    #nv = V.ndim
    return np.tensordot( U, V, axes=(nu-1,0) )