From 798c69de4468e36619d919f60363acb6f54bf886 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ne=C4=8Dada?= Date: Mon, 24 Sep 2018 00:21:15 +0300 Subject: [PATCH] dudom Former-commit-id: 4dddd839f153a1a9602b4f4b6c2c85035f6d9d0b --- misc/processWfiles.py | 2 +- qpms/symmetries.py | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/misc/processWfiles.py b/misc/processWfiles.py index f549768..9704ddc 100755 --- a/misc/processWfiles.py +++ b/misc/processWfiles.py @@ -6,5 +6,5 @@ from qpms import processWfiles_sameKs dest = sys.argv[1] srcs = sys.argv[2:] -processWfiles_sameKs(srcs, dest) +processWfiles_sameKs(srcs, dest, f='d') diff --git a/qpms/symmetries.py b/qpms/symmetries.py index ca0633f..b9b9883 100644 --- a/qpms/symmetries.py +++ b/qpms/symmetries.py @@ -158,9 +158,11 @@ def normalize(v): return v*np.nan return v / norm -def gen_hexlattice_Kpoint_svwf_rep_projectors(lMax,psi): +def gen_hexlattice_Kpoint_svwf_rep_projectors(lMax,psi, do_bases = False): nelem = lMax * (lMax+2) projectors = dict() + if do_bases: + bases = dict() for repi, W in gen_hexlattice_Kpoint_svwf_rep(lMax,psi).items(): totalvecs = 0 tmplist = list() @@ -191,10 +193,18 @@ def gen_hexlattice_Kpoint_svwf_rep_projectors(lMax,psi): # print(index, x) #print('----------') theprojector = np.zeros((2,2,nelem,2,2,nelem), dtype = float) + if do_bases: + thebasis = np.zeros((len(tmplist), 2,2,nelem), dtype=complex) + for i, v in enumerate(tmplist): + thebasis[i] = v + bases[repi] = thebasis for v in tmplist: theprojector += (v[:,:,:,ň,ň,ň] * v.conjugate()[ň,ň,ň,:,:,:]).real # TODO check is it possible to have imaginary elements? for x in [0, 1, -1,sqrt(0.5),-sqrt(0.5),0.5,-0.5]: theprojector[np.isclose(theprojector,x)]=x projectors[repi] = theprojector - return projectors + if do_bases: + return projectors, bases + else: + return projectors