Changeset 4170
 Timestamp:
 Oct 4, 2019 3:01:33 PM (2 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/GSASIIspc.py
r4157 r4170 514 514 OpText = [] 515 515 Inv = True 516 Super = False 516 517 if 'noncentro' in text[1]: 517 518 Inv = False 519 if 'Super' in text[0]: 520 Super = True 518 521 Cent = [[0,0,0],] 522 if Super: 523 Cent = [[0,0,0,0],] 519 524 if '0,0,0' in text[1]: 520 525 Cent = np.array(eval(text[1].split('+')[0].replace(';','),('))) … … 523 528 for item in table: 524 529 if 'for' in item: continue 525 M,T = Text2MT(item.split(')')[1].replace(' ',''),CIF=True) 530 if Super: 531 M,T = MagSSText2MTS(item.split(')')[1].replace(' ',''),G2=True)[:2] 532 else: 533 M,T = Text2MT(item.split(')')[1].replace(' ',''),CIF=True) 526 534 OpsM.append(M) 527 535 OpsT.append(T) 528 536 OpsM = np.array(OpsM) 529 537 OpsT = np.array(OpsT) 530 if Inv :538 if Inv and not Super: #inversion ops altready listed in supersymmetries 531 539 OpsM = np.concatenate((OpsM,OpsM)) 532 540 OpsT = np.concatenate((OpsT,OpsT%1.)) 533 541 for cent in Cent: 534 542 for iop,opM in enumerate(list(OpsM)): 535 txt = MT2text([opM,(OpsT[iop]+cent[:3])%1.],reverse) 543 if Super: 544 txt = SSMT2text([opM,(OpsT[iop]+cent)%1.]) 545 else: 546 txt = MT2text([opM,(OpsT[iop]+cent)%1.],reverse) 536 547 OpText.append(txt.replace(' ','').lower()) 537 548 return OpText … … 1203 1214 return np.array(M),np.array(T),spnflp 1204 1215 1205 def MagSSText2MTS( mcifOpr):1216 def MagSSText2MTS(Opr,G2=False): 1206 1217 "From magnetic super space group cif text returns matrix/translation + spin flip" 1207 1218 XYZ = {'x1':[1,0,0,0],'x1':[1,0,0,0], … … 1213 1224 'x2x4':[0,1,0,1],'x2+x4':[0,1,0,1], 1214 1225 'x1x2+x4':[1,1,0,1],'x1+x2x4':[1,1,0,1]} 1215 ops = mcifOpr.split(",") 1226 if G2: 1227 XYZ = {'x':[1,0,0,0],'+x':[1,0,0,0],'x':[1,0,0,0], 1228 'y':[0,1,0,0],'+y':[0,1,0,0],'y':[0,1,0,0], 1229 'z':[0,0,1,0],'+z':[0,0,1,0],'z':[0,0,1,0], 1230 't':[0,0,0,1],'+t':[0,0,0,1],'t':[0,0,0,1], 1231 'xy':[1,1,0,0],'x+y':[1,1,0,0], 1232 'xt':[1,0,0,1],'x+t':[1,0,0,1], 1233 'yt':[0,1,0,1],'y+t':[0,1,0,1], 1234 'xy+t':[1,1,0,1],'x+yt':[1,1,0,1]} 1235 1236 ops = Opr.split(",") 1216 1237 M = [] 1217 1238 T = [] … … 1219 1240 ip = len(op) 1220 1241 if '/' in op: 1221 ip = op.index('/')2 1222 T.append(eval(op[ip:])) 1242 ip = op.index('/') 1243 if G2: 1244 T.append(eval(op[:ip+2])) 1245 M.append(XYZ[op[ip+2:]]) 1246 else: 1247 T.append(eval(op[ip2:])) 1248 M.append(XYZ[op[:ip2]]) 1223 1249 else: 1224 1250 T.append(0.) 1225 M.append(XYZ[op[:ip]])1251 M.append(XYZ[op]) 1226 1252 spnflp = 1 1227 if '1' in ops[4]: 1228 spnflp = 1 1253 if len(ops) == 5: 1254 if '1' in ops[4]: 1255 spnflp = 1 1229 1256 return np.array(M),np.array(T),spnflp 1230 1257
Note: See TracChangeset
for help on using the changeset viewer.