diff --git a/docs/pyerrors/correlators.html b/docs/pyerrors/correlators.html index df181836..a4efe5c0 100644 --- a/docs/pyerrors/correlators.html +++ b/docs/pyerrors/correlators.html @@ -185,9 +185,6 @@ -
import warnings +from itertools import permutations import numpy as np import autograd.numpy as anp import matplotlib.pyplot as plt @@ -1266,7 +1264,7 @@ if vec_set[t] is None: sorted_vec_set.append(None) elif not t == ts: - perms = permutation([i for i in range(N)]) + perms = [list(o) for o in permutations([i for i in range(N)], N)] best_score = 0 for perm in perms: current_score = 1 @@ -1284,19 +1282,6 @@ return sorted_vec_set -def permutation(lst): # Shamelessly copied - if len(lst) == 1: - return [lst] - ll = [] - for i in range(len(lst)): - m = lst[i] - remLst = lst[:i] + lst[i + 1:] - # Generating all permutations where m is first - for p in permutation(remLst): - ll.append([m] + p) - return ll - - def _GEVP_solver(Gt, G0): # Just so normalization an sorting does not need to be repeated. Here we could later put in some checks sp_val, sp_vecs = scipy.linalg.eig(Gt, G0) sp_vecs = [sp_vecs[:, np.argsort(sp_val)[-i]] for i in range(1, sp_vecs.shape[0] + 1)] @@ -4124,34 +4109,6 @@ specifies a custom path for the file (default '.')
def permutation(lst): # Shamelessly copied - if len(lst) == 1: - return [lst] - ll = [] - for i in range(len(lst)): - m = lst[i] - remLst = lst[:i] + lst[i + 1:] - # Generating all permutations where m is first - for p in permutation(remLst): - ll.append([m] + p) - return ll -