def fts(df, ferrers): res = None for idx, row in df.iterrows(): ptup = tuple(int(x) for x in row[0]) perm = Perm2.from_tup(ptup) if res is None: res = row[1] * yor(ferrers, perm, use_cache=False) else: res += (row[1] * yor(ferrers, perm, use_cache=False)) return res
def inv_ft_part2(g, ferrers, fhat): ''' g: tuple of ints ''' rep = yor(ferrers, g, use_cache=False) dim = mat.shape[0] result = dim * fhat.T.ravel().dot(rep.ravel()) return result
def func(grid): tup = tuple(i for row in grid for i in row) val = 0 pinv = Perm2.from_tup(tup).inv() for p, mat in fmats.items(): f = ferrers[p] mat_inv = yor(f, pinv) val += np.sum(mat_inv * mat) return val
def inv_transform(perm_df, ferrers): # need to load the appropriate matrix try: fhat_loc = '/local/hopan/tile/fourier_eval/{}.npy'.format( ferrers.partition) fhat = np.load(fhat_loc) except: fhat_loc = '/scratch/hopan/tile/fourier_eval/{}.npy'.format( ferrers.partition) fhat = np.load(fhat_loc) ifts = [] for perm_num in perm_df[0]: # g is a number, turn it into a tuple g = Perm2.from_tup(tuple(int(x) for x in str(perm_num))) rep = yor(ferrers, g, use_cache=False) dim = fhat.shape[0] result = dim * (fhat * rep).sum() / S9 ifts.append(result) return ifts
def perm_irrep(self, perm): return yor(self.ferrers, perm).ravel()
def irrep(self, tup): # TODO: maybe avoid cache? return yor(self.ferrers, Perm2.from_tup(tup)).ravel()