Changeset 1564 for trunk/GSASIIspc.py


Ignore:
Timestamp:
Nov 5, 2014 5:05:13 PM (8 years ago)
Author:
vondreele
Message:

fix display of space group stuff
mode work on super symmetry

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIspc.py

    r1561 r1564  
    446446            except ValueError:
    447447                pass
    448             if SGData['SGUniq'] == 'a' and LaueModId in [5,6,7,8,9,]:
     448            if SGData['SGUniq'] == 'a' and LaueModId in [5,6,7,8,9,10,]:
    449449                return True
    450             elif SGData['SGUniq'] == 'b' and LaueModId in [3,4,13,14,15,]:
     450            elif SGData['SGUniq'] == 'b' and LaueModId in [3,4,13,14,15,16,]:
    451451                return True
    452             elif SGData['SGUniq'] == 'c' and LaueModId in [1,2,19,20,21,]:
     452            elif SGData['SGUniq'] == 'c' and LaueModId in [1,2,19,20,21,22,]:
    453453                return True
    454454        elif LaueId in [2,] and LaueModId in [i+7 for i in range(18)]:
     
    525525    def extendSSGOps(SSGOps):
    526526        nOps = len(SSGOps)
    527         for i in range(nOps):
    528             if np.allclose(SSGOps[i][0][3],np.zeros(4)):
     527        for OpA in SSGOps[1:]:
     528            OpAtxt = SSMT2text(OpA)
     529            if 't' not in OpAtxt:
    529530                continue
    530             for j in range(nOps):
    531                 if np.allclose(SSGOps[j][0][3],np.zeros(4)):
     531            for OpB in SSGOps[1:]:
     532                OpBtxt = SSMT2text(OpB)
     533                if 't' not in OpBtxt:
    532534                    continue
    533                 OpC = list(SGProd(SSGOps[j],SSGOps[i]))
     535                OpC = list(SGProd(OpA,OpB))
    534536                OpC[1] %= 1.
    535                 for k in range(nOps):
    536                     OpD = SSGOps[k]
    537                     if SSMT2text(OpC) == SSMT2text(OpD):
     537                OpCtxt = SSMT2text(OpC)
     538#                print OpAtxt.replace(' ','')+'*'+OpBtxt.replace(' ','')+'='+OpCtxt.replace(' ','')
     539                for k,OpD in enumerate(SSGOps[1:]):
     540                    OpDtxt = SSMT2text(OpD)
     541                    if 't' in OpDtxt:
    538542                        continue
    539                     elif np.allclose(OpC[0][:3,:3],OpD[0][:3,:3]):
    540                         if np.allclose(OpD[0][3],np.zeros(4)):
    541                             SSGOps[k] = OpC
    542                         elif np.any([np.allclose(OpC[0][3][:3],cen) for cen in SGData['SGCen']]):   #?
    543                             continue
     543#                    print '    ('+OpCtxt.replace(' ','')+'=? '+OpDtxt.replace(' ','')+')'
     544                    if OpCtxt == OpDtxt:
     545                        continue
     546                    elif OpCtxt.split(',')[:3] == OpDtxt.split(',')[:3]:
     547                        if 't' not in OpDtxt:
     548                            SSGOps[k+1] = OpC
     549#                            print k+1,'   new:',OpCtxt.replace(' ','')
    544550                        else:
    545                             OpCtxt = SSMT2text(OpC).replace(' ','')
    546                             OpDtxt = SSMT2text(OpD).replace(' ','')
    547                             print 'OpC',OpCtxt,'OpD',OpDtxt
    548                             return False,OpCtxt+' conflict with '+OpDtxt
     551                            OpCtxt = OpCtxt.replace(' ','')
     552                            OpDtxt = OpDtxt.replace(' ','')
     553                            Txt = OpCtxt+' conflict with '+OpDtxt
     554                            print Txt
     555                            return False,Txt
    549556        return True,SSGOps
    550557               
     
    556563                iFrac[i] = frac
    557564        print SGData['SpGrp']+SSymbol
    558         print 'SSGKl',SSGKl,'genQ',genQ,'iFrac',iFrac
     565        print 'SSGKl',SSGKl,'genQ',genQ,'iFrac',iFrac,'modSymb',SSGData['modSymb']
    559566# set identity & 1,-1; triclinic
    560567        SSGOps[0][0][3,3] = 1.
     
    596603            if '1/2' in SSGData['modSymb']:
    597604                SSGOps[1][0][3,1] = 1
    598         elif SGData['SGPtGrp'] in ['4/m',]:
     605        elif SGData['SGPtGrp'] in ['4/m',]: #OK
    599606            if '1/2' in SSGData['modSymb']:
    600                 SSGOps[1][0][3,1] = SSGKl[0]
     607                SSGOps[1][0][3,1] = -SSGKl[0]
    601608            for i,j in enumerate([1,6]):
    602609                SSGOps[j][0][3,3] = SSGKl[i]
     
    604611                    SSGOps[j][1][3] = genQ[i]
    605612                E,SSGOps = extendSSGOps(SSGOps)
     613                if not E:
     614                    return E,SSGOps
    606615        elif SGData['SGPtGrp'] in ['422','4mm','-42m','-4m2',]:
    607             if '1/2' in SSGData['modSymb']:
    608                 SSGOps[1][0][3,1] = SSGKl[0]
    609616            for i,j in enumerate([1,4,5]):
    610                 SSGOps[j][0][3,3] = SSGKl[i]
    611                 if genQ[i]:
    612                     SSGOps[j][1][3] = genQ[i]
     617                if '1/2' in SSGData['modSymb']:
     618                    SSGOps[j][0][3,1] = -SSGKl[i]
     619                if SGData['SGPtGrp'] in ['422','-42m','-4m2',]:
     620                    SSGOps[j][0][3,3] = SSGKl[i]
     621                    if i and genQ[2]:
     622                        SSGOps[j][1][3] = genQ[i]
     623                else:     #4mm               
     624                    SSGOps[j][0][3,3] = -SSGKl[i]
     625                    if genQ[i]:
     626                        SSGOps[j][1][3] = genQ[i]
    613627                E,SSGOps = extendSSGOps(SSGOps)
     628                if not E:
     629                    return E,SSGOps
    614630        elif SGData['SGPtGrp'] in ['4/mmm',]:
    615631            if '1/2' in SSGData['modSymb']:
    616                 SSGOps[1][0][3,1] = -1
     632                SSGOps[1][0][3,1] = -SSGKl[0]
     633                SSGOps[6][0][3,1] = SSGKl[1]
    617634            for i,j in enumerate([1,10,6,7]):
    618635                SSGOps[j][0][3,3] = SSGKl[i]
    619636                if genQ[i]:
    620637                    SSGOps[j][1][3] = genQ[i]
    621 #                for k in iFrac:
    622 #                    SSGOps[j][0][3,k] = SSGKl[i]
    623                 E,SSGOps = extendSSGOps(SSGOps)
     638                E,Result = extendSSGOps(SSGOps)
     639                if not E:
     640                    for Op in SSGOps:
     641                        print SSMT2text(Op)
     642                    return E,Result
     643                else:
     644                    SSGOps = Result
    624645               
    625646# trigonal - all done
     
    639660            for i,j in enumerate([1,5]):
    640661                if SGData['SGPtGrp'] in ['3m','-3m']:
    641                     SSGOps[j][0][3,3] = SSGKl[i]
     662                    SSGOps[j][0][3,3] = 1
    642663                else:                   
    643664                    SSGOps[j][0][3,3] = SSGKl[i+1]
     
    654675                ids = [7,3]
    655676            if '1/3' in SSGData['modSymb']:
    656                 SSGOps[ids[0]][0][3,1] = -1
     677                SSGOps[ids[0]][0][3,1] = -SSGKl[0]
    657678            for i,j in enumerate(ids):
    658679                SSGOps[j][0][3,3] = SSGKl[i]
     
    660681                    SSGOps[j][1][3] = genQ[i+1]
    661682                     
    662 # hexagonal - all done
     683# hexagonal
    663684        elif SGData['SGPtGrp'] == '6':  #OK
    664685            SSGOps[1][0][3,3] = SSGKl[0]
     
    676697                    SSGOps[j][1][3] = genQ[i]
    677698                E,SSGOps = extendSSGOps(SSGOps)
    678         elif SGData['SGPtGrp'] in ['6/mmm',]: #OK
     699        elif SGData['SGPtGrp'] in ['6/mmm',]: #not OK
    679700            for i,j in enumerate([1,15,10,11]):
    680701                SSGOps[j][0][3,3] = SSGKl[i]
     
    730751        elif SGData['SGPtGrp'] in ['4mm',] and sym not in ['','ss0','s0s','0ss','qq0','qqs']:
    731752            return False
    732         elif SGData['SGPtGrp'] in ['-4m2',] and sym not in ['','00s','00q']:
     753        elif SGData['SGPtGrp'] in ['-4m2',] and sym not in ['','0s0','0q0']:
    733754            return False
    734         elif SGData['SGPtGrp'] in ['-42m',] and sym not in ['','0s0','0q0']:
     755        elif SGData['SGPtGrp'] in ['-42m',] and sym not in ['','00s','00q']:
    735756            return False
    736         elif SGData['SGPtGrp'] in ['4/mmm',] and sym not in ['','s00s','s0s0','00ss','q0q0','q0qs']:
     757        elif SGData['SGPtGrp'] in ['4/mmm',] and sym not in ['','s00s','s0s0','00ss','000s',]:
    737758            return False
    738759#trigonal/rhombohedral - all done
     
    764785        elif SGData['SGPtGrp'] in ['-6m2',] and sym not in ['','0s0']:
    765786            return False
    766         elif SGData['SGPtGrp'] in ['-62m',] and sym not in ['','0ss']:
     787        elif SGData['SGPtGrp'] in ['-62m',] and sym not in ['','00s']:
    767788            return False
    768789        elif SGData['SGPtGrp'] in ['6/mmm',] and sym not in ['','s00s','s0s0','00ss']:
     
    770791        return True
    771792       
    772     LaueModList = ['abg', 'ab0', 'ab1/2', 'a0g', 'a1/2g','0bg', '1/2bg',
    773                'a00', 'a01/2', 'a1/20', 'a1/21/2', 'a01', 'a10',
    774                '0b0', '0b1/2', '1/2b0', '1/2b1/2', '0b1', '1b0',
    775                '00g', '01/2g', '1/20g', '1/21/2g', '01g', '10g','1/31/3g']
     793    LaueModList = [
     794        'abg','ab0','ab1/2','a0g','a1/2g',  '0bg','1/2bg','a00','a01/2','a1/20',
     795        'a1/21/2','a01','a10','0b0','0b1/2', '1/2b0','1/2b1/2','0b1','1b0','00g',
     796        '01/2g','1/20g','1/21/2g','01g','10g', '1/31/3g']
    776797    LaueList = ['-1','2/m','mmm','4/m','4/mmm','3R','3mR','3','3m1','31m','6/m','6/mmm','m3','m3m']
    777     GenSymList = ['','s','0s','s0','00s','0s0','s00','s0s','ss0','0ss','q00','0q0','00q','qq0','q0q','0qq',
    778         'q','q0','0q','qqs','s0s0','00ss','s00s','q0q0','q0qs','t','t00','t0','h','h00']
     798    GenSymList = ['','s','0s','s0', '00s','0s0','s00','s0s','ss0','0ss','q00','0q0','00q','qq0','q0q', '0qq',
     799        'q','qqs','s0s0','00ss','s00s','000s','t','t00','t0','h','h00']
    779800    Fracs = {'1/2':0.5,'1/3':1./3,'1':1.0,'0':0.,'s':.5,'t':1./3,'q':.25,'h':1./6,'a':0.,'b':0.,'g':0.}
    780801    LaueId = LaueList.index(SGData['SGLaue'])
     
    9801001    A,U = OpA
    9811002    B,V = OpB
    982     M = np.inner(B.T,A)
     1003    M = np.inner(B,A)
    9831004    W = np.inner(B,U)+V
    984     return M.T,W
     1005    return M,W
    9851006       
    9861007def MoveToUnitCell(xyz):
     
    21082129    'P 4/m':['(00g)','(00g)s0','(1/21/2g)','(1/21/2g)s0',],
    21092130    'P 42/m':['(00g)','(00g)s0','(1/21/2g)','(1/21/2g)s0',],
    2110     'P 4/n':['(00g)','(00g)s0','(1/21/2g)','(1/21/2g)q0',],
    2111     'P 42/n':['(00g)','(00g)s0','(1/21/2g)','(1/21/2g)q0',],
     2131    'P 4/n':['(00g)','(00g)s0','(1/21/2g)',],
     2132    'P 42/n':['(00g)','(00g)s0','(1/21/2g)',],
    21122133    'P 4 2 2':['(00g)','(00g)q00','(00g)s00','(1/21/2g)','(1/21/2g)q00','(1/21/2g)s00',],
    21132134    'P 4 21 2':['(00g)','(00g)q00','(00g)s00',],
     
    21432164        '(1/21/2g)','(1/21/2g)s0s0','(1/21/2g)00ss','(1/21/2g)s00s',],
    21442165    'P 4/n b m':['(00g)','(00g)s0s0','(00g)00ss','(00g)s00s',
    2145         '(1/21/2g)','(1/21/2g)q0q0','(1/21/2g)q0qs',],
     2166        '(1/21/2g)','(1/21/2g)000s',],
    21462167    'P 4/n n c':['(00g)','(00g)s0s0','(00g)00ss','(00g)s00s',
    2147         '(1/21/2g)','(1/21/2g)q0q0','(1/21/2g)q0qs',],
     2168        '(1/21/2g)','(1/21/2g)000s',],
    21482169    'P 4/m b m':['(00g)','(00g)s0s0','(00g)00ss','(00g)s00s',],
    21492170    'P 4/m n c':['(00g)','(00g)s0s0','(00g)00ss','(00g)s00s',],
     
    21552176        '(1/21/2g)','(1/21/2g)s0s0','(1/21/2g)00ss','(1/21/2g)s00s',],
    21562177    'P 42/n b c':['(00g)','(00g)s0s0','(00g)00ss','(00g)s00s',
    2157         '(1/21/2g)','(1/21/2g)q0q0','(1/21/2g)q0qs',],
     2178        '(1/21/2g)','(1/21/2g)000s',],
    21582179    'P 42/n n m':['(00g)','(00g)s0s0','(00g)00ss','(00g)s00s',
    2159         '(1/21/2g)','(1/21/2g)q0q0','(1/21/2g)q0qs',],
     2180        '(1/21/2g)','(1/21/2g)000s',],
    21602181    'P 42/m b c':['(00g)','(00g)s0s0','(00g)00ss','(00g)s00s',],
    21612182    'P 42/m n m':['(00g)','(00g)s0s0','(00g)00ss','(00g)s00s',],
Note: See TracChangeset for help on using the changeset viewer.