diff --git a/docs/pyerrors/correlators.html b/docs/pyerrors/correlators.html index a3f979d6..1158f611 100644 --- a/docs/pyerrors/correlators.html +++ b/docs/pyerrors/correlators.html @@ -185,15 +185,9 @@ -
def projected(self, vector_l=None, vector_r=None, normalize=False): + """We need to project the Correlator with a Vector to get a single value at each timeslice. + + The method can use one or two vectors. + If two are specified it returns v1@G@v2 (the order might be very important.) + By default it will return the lowest source, which usually means unsmeared-unsmeared (0,0), but it does not have to + """ if self.N == 1: raise Exception("Trying to project a Corr, that already has N=1.") - # This Exception is in no way necessary. One could just return self - # But there is no scenario, where a user would want that to happen and the error message might be more informative. self.gamma_method() @@ -2296,7 +2292,13 @@ region indentified for this correlator. - ++We need to project the Correlator with a Vector to get a single value at each timeslice.
+ +The method can use one or two vectors. +If two are specified it returns v1@G@v2 (the order might be very important.) +By default it will return the lowest source, which usually means unsmeared-unsmeared (0,0), but it does not have to
+
def smearing_symmetric(self): + """Symmetrizes the matrices and therefore make them positive definite.""" if self.N > 1: transposed = [None if (G is None) else G.T for G in self.content] return 0.5 * (Corr(transposed) + self) @@ -2467,7 +2470,9 @@ timeslice and the error on each timeslice. - ++Symmetrizes the matrices and therefore make them positive definite.
+
def Hankel(self, N, periodic=False): - # Constructs an NxN Hankel matrix - # C(t) c(t+1) ... c(t+n-1) - # C(t+1) c(t+2) ... c(t+n) - # ................. - # C(t+(n-1)) c(t+n) ... c(t+2(n-1)) + """Constructs an NxN Hankel matrix + + C(t) c(t+1) ... c(t+n-1) + C(t+1) c(t+2) ... c(t+n) + ................. + C(t+(n-1)) c(t+n) ... c(t+2(n-1)) + + Parameters: + ----------- + N : int + Dimension of the Hankel matrix + periodic : bool, optional + determines whether the matrix is extended periodically + """ if self.N != 1: raise Exception("Multi-operator Prony not implemented!") @@ -2603,7 +2617,21 @@ timeslice and the error on each timeslice. - ++Constructs an NxN Hankel matrix
+ +C(t) c(t+1) ... c(t+n-1) +C(t+1) c(t+2) ... c(t+n) +................. +C(t+(n-1)) c(t+n) ... c(t+2(n-1))
+ +Parameters:
+ +N : int + Dimension of the Hankel matrix +periodic : bool, optional + determines whether the matrix is extended periodically
+
def sort_vectors(vec_set, ts): # Helper function used to find a set of Eigenvectors consistent over all timeslices - reference_sorting = np.array(vec_set[ts]) - N = reference_sorting.shape[0] - sorted_vec_set = [] - for t in range(len(vec_set)): - if vec_set[t] is None: - sorted_vec_set.append(None) - elif not t == ts: - perms = permutation([i for i in range(N)]) - best_score = 0 - for perm in perms: - current_score = 1 - for k in range(N): - new_sorting = reference_sorting.copy() - new_sorting[perm[k], :] = vec_set[t][k] - current_score *= abs(np.linalg.det(new_sorting)) - if current_score > best_score: - best_score = current_score - best_perm = perm - # print("best perm", best_perm) - sorted_vec_set.append([vec_set[t][k] for k in best_perm]) - else: - sorted_vec_set.append(vec_set[t]) - - return sorted_vec_set -
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)] - sp_vecs = [v / np.sqrt((v.T @ G0 @ v)) for v in sp_vecs] - return sp_vecs -