From 97f87202e16a62dba99c979b1287a7ee1cf6ab23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ne=C4=8Dada?= Date: Thu, 14 Mar 2019 01:34:04 +0200 Subject: [PATCH] Fix lowest SV index finding Former-commit-id: ac6e4f3539dfa32888497600a8adf603d3587883 --- misc/201903_finiterectlat_AaroBEC.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/misc/201903_finiterectlat_AaroBEC.py b/misc/201903_finiterectlat_AaroBEC.py index 6b0ce47..5952ef1 100755 --- a/misc/201903_finiterectlat_AaroBEC.py +++ b/misc/201903_finiterectlat_AaroBEC.py @@ -45,8 +45,8 @@ for iri in range(ss.nirreps): mm_iri = ss.modeproblem_matrix_packed(k, iri) U, S, Vh = np.linalg.svd(mm_iri) print(iri, ss.irrep_names[iri], S[-1]) - starti = np.searchsorted(S, sv_threshold, side='right') + starti = max(0,len(S) - np.searchsorted(S[::-1], sv_threshold, side='left')-1) np.savez(os.path.join(outputdatadir, 'Nx%d_Ny%d_%geV_ir%d.npz'%(Nx, Ny, omega/eV*hbar, iri)), - S=S[starti:], omega=omega, Vh = Vh[starti:], iri=iri, ) - + S=S[starti:], omega=omega, Vh = Vh[starti:], iri=iri, Nx = Nx, Ny= Ny ) + # Don't forget to conjugate Vh before transforming it to the full vector!