Changeset 3308 for trunk/GSASIIspc.py


Ignore:
Timestamp:
Mar 5, 2018 3:31:19 PM (4 years ago)
Author:
vondreele
Message:

more fixes for mag site symmetry constraints

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIspc.py

    r3307 r3308  
    207207        if SGData['SGPtGrp'] in ['1','3','23',]:
    208208            SGData['SGSpin'] = lattSpin+[1,]
    209         elif SGData['SGPtGrp'] in ['-1','2','m','4','-4','-3','312','321','3m1','31m','6','-6','432','-43m','m3']:
     209        elif SGData['SGPtGrp'] in ['-1','2','m','4','-4','-3','312','321','3m1','31m','6','-6','432','-43m']:
    210210            SGData['SGSpin'] = lattSpin+[1,1,]
    211211        elif SGData['SGPtGrp'] in ['2/m','4/m','422','4mm','-42m','-4m2','-3m1','-31m',
    212             '6/m','622','6mm','-6m2','-62m','m-3m']:
     212            '6/m','622','6mm','-6m2','-62m','m3','m-3m']:
    213213            SGData['SGSpin'] = lattSpin+[1,1,1,]
    214214        else: #'222'-'mmm','4/mmm','6/mmm'
     
    790790    elif '(I)' in BNS:
    791791        Tmat *= 2.0
     792        SGData['SGSpin'][-1] = -1
    792793        if 'R' in BNS:
    793794            SGData['SGSpin'][-1] = -1
     
    10531054    "From magnetic space group cif text returns matrix/translation + spin flip"
    10541055    XYZ = {'x':[1,0,0],'+x':[1,0,0],'-x':[-1,0,0],'y':[0,1,0],'+y':[0,1,0],'-y':[0,-1,0],
    1055            'z':[0,0,1],'+z':[0,0,1],'-z':[0,0,-1],'x-y':[1,-1,0],'-x+y':[-1,1,0],}
     1056           'z':[0,0,1],'+z':[0,0,1],'-z':[0,0,-1],'x-y':[1,-1,0],'-x+y':[-1,1,0],'y-x':[-1,1,0]}
    10561057    ops = mcifOpr.split(",")
    10571058    M = []
     
    11211122    SpnFlp = np.ones(Nsym,dtype=np.int)
    11221123    GenFlg = SGData.get('GenFlg',[0])
     1124#    print ('GenFlg:',SGData['GenFlg'])
     1125#    print ('GenSym:',SGData['GenSym'])
    11231126    Nfl = len(GenFlg)
    1124     if Nfl>1:
    1125         for ieqv in range(Nsym):
    1126             for iunq in range(Nfl):
    1127                 if SGData['SGGen'][ieqv] & GenFlg[iunq]:
    1128                     SpnFlp[ieqv] *= FlpSpn[iunq]
     1127    for ieqv in range(Nsym):
     1128        for iunq in range(Nfl):
     1129            if SGData['SGGen'][ieqv] & GenFlg[iunq]:
     1130                SpnFlp[ieqv] *= FlpSpn[iunq]
    11291131#        print ('\nMagSpGrp:',SGData['MagSpGrp'],Ncv)
    1130 #        print ('GenFlg:',SGData['GenFlg'])
    1131 #        print ('GenSym:',SGData['GenSym'])
    11321132#        print ('FlpSpn:',Nfl,FlpSpn)
    1133         detM = [nl.det(M) for M in sgOp]
    1134         for incv in range(Ncv):
    1135             if incv:
    1136                 try:
    1137                     SpnFlp = np.concatenate((SpnFlp,SpnFlp[:Nsym]*FlpSpn[Nfl+incv-1]))
    1138                 except IndexError:
    1139                     FlpSpn = [1,]+FlpSpn
    1140                     SpnFlp = np.concatenate((SpnFlp,SpnFlp[:Nsym]*FlpSpn[Nfl+incv-1]))                   
    1141         if ' 1bar ' in SGData['GenSym'][0] and FlpSpn[0] < 0:
    1142             detM[1] = 1.
    1143         MagMom = SpnFlp*np.array(Ncv*detM)
    1144         SGData['MagMom'] = MagMom
     1133    detM = [nl.det(M) for M in sgOp]
     1134    for incv in range(Ncv):
     1135        if incv:
     1136            try:
     1137                SpnFlp = np.concatenate((SpnFlp,SpnFlp[:Nsym]*FlpSpn[Nfl+incv-1]))
     1138            except IndexError:
     1139                FlpSpn = [1,]+FlpSpn
     1140                SpnFlp = np.concatenate((SpnFlp,SpnFlp[:Nsym]*FlpSpn[Nfl+incv-1]))                   
     1141    if ' 1bar ' in SGData['GenSym'][0] and FlpSpn[0] < 0:
     1142        detM[1] = 1.
     1143    MagMom = SpnFlp*np.array(Ncv*detM)
     1144    SGData['MagMom'] = MagMom
    11451145#        print ('SgOps:',OprNames)
    11461146#        print ('SGGen:',SGData['SGGen'])
     
    21902190    "returns Mxyz terms, multipliers, GUI flags"
    21912191    CSI = [[1,2,3],[1.0,1.0,1.0]]
     2192    print('for ',siteSym)
    21922193    for opr in dupDir:
    21932194        indx = GetNXUPQsym(opr)
     
    21962197        else:
    21972198            csi = CSxinel[indx[3]]  #Q
    2198 #        print(opr,SpnFlp[dupDir[opr]],indx,csi,CSI)
     2199        print(opr,SpnFlp[dupDir[opr]],indx,csi,CSI)
    21992200        if not len(csi):
    22002201            return [[0,0,0],[0.,0.,0.]]
     
    22122213            elif CSI[0][kcs] >= csi[0][kcs]:
    22132214                CSI[0][kcs] = min(CSI[0][kcs],csi[0][kcs])
    2214                 if CSI[0][kcs] != csi[0][kcs]:
     2215                if CSI[1][kcs] != csi[1][kcs]:
    22152216                    if CSI[1][kcs] == 1.:
    22162217                        CSI[1][kcs] = csi[1][kcs]
     2218        print(CSI)
    22172219    return CSI
    22182220   
Note: See TracChangeset for help on using the changeset viewer.