9
1
mirror of https://github.com/QuantumPackage/qp2.git synced 2024-11-18 11:23:38 +01:00

updated nexus converter

This commit is contained in:
Kevin Gasperich 2020-04-01 19:45:39 -05:00
parent 5fee067556
commit 338f9ca2f8

View File

@ -185,22 +185,27 @@ for cell_type in cell_types:
#end for #end for
jobparams['twistinfo']+='])\n' jobparams['twistinfo']+='])\n'
print ('primitive cell kpoints') #print ('primitive cell kpoints')
# this should already be written by nexus as part of $system # this should already be written by nexus as part of $system
#jobparams['twistinfo']+='# primitive cell kpoints\n') #jobparams['twistinfo']+='# primitive cell kpoints\n')
#jobparams['twistinfo']+='orig=array([\n' #jobparams['twistinfo']+='orig=array([\n'
for i,k in enumerate(s.folded_structure.kpoints): #for i,k in enumerate(s.folded_structure.kpoints):
print (' ',i,k) #print (' ',i,k)
#jobparams['twistinfo']+=(str(list(k))+',\n') #jobparams['twistinfo']+=(str(list(k))+',\n')
#end for #end for
#jobparams['twistinfo']+='])\n' #jobparams['twistinfo']+='])\n'
jobparams['twistinfo']+='# mapping from supercell to primitive cell k-points\n' jobparams['twistinfo']+='# mapping from supercell to primitive cell k-points\n'
jobparams['twistinfo']+='mymap=array([\n' jobparams['twistinfo']+='mymap=array([\n'
if kmap is None:
for i in range(len(s.kpoints)):
jobparams['twistinfo']+=('['+str(i)+'],\n')
else:
for kmapkey in kmap.sorted_keys(): for kmapkey in kmap.sorted_keys():
jobparams['twistinfo']+=(str(list(kmap[kmapkey]))+',\n') jobparams['twistinfo']+=(str(list(kmap[kmapkey]))+',\n')
jobparams['twistinfo']+='])\n' jobparams['twistinfo']+='])\n'
print ('mapping from supercell to primitive cell k-points') print ('mapping from supercell to primitive cell k-points')
if kmap is not None:
print (kmap) print (kmap)
#jobparams['twistinfo']+=('allkpts=array(list(map(lambda xs: list(map(lambda x: orig[x], xs)), mymap)))\n') #jobparams['twistinfo']+=('allkpts=array(list(map(lambda xs: list(map(lambda x: orig[x], xs)), mymap)))\n')