dudom
Former-commit-id: 4dddd839f153a1a9602b4f4b6c2c85035f6d9d0b
This commit is contained in:
parent
95eaea1b4b
commit
798c69de44
|
@ -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')
|
||||
|
||||
|
|
|
@ -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
|
||||
if do_bases:
|
||||
return projectors, bases
|
||||
else:
|
||||
return projectors
|
||||
|
||||
|
|
Loading…
Reference in New Issue