Changeset 5001


Ignore:
Timestamp:
Jul 27, 2021 11:11:23 AM (4 months ago)
Author:
vondreele
Message:

best incommensurate mag. struct. fctrs. so far but still not right.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIImath.py

    r4999 r5001  
    17281728    fxn of gTau points; NB: this allows only 1 mag. wave fxn.
    17291729    '''
    1730     Am = np.array(MSSdata[3:]).T[:,0,:]   #atoms x cos pos mods; only 1 wave used
    1731     Bm = np.array(MSSdata[:3]).T[:,0,:]   #...sin pos mods
     1730    Am = np.array(MSSdata[3:]).T[:,0,:]   #atoms x cos mag mods; only 1 wave used
     1731    Bm = np.array(MSSdata[:3]).T[:,0,:]   #...sin mag mods
    17321732    SGMT = np.array([ops[0] for ops in SGData['SGOps']])        #not .T!!
    17331733    Sinv = np.array([nl.inv(ops[0]) for ops in SSGData['SSGOps']])
     
    17461746    epsinv = Sinv[:,3,3]
    17471747    mst = np.inner(Sinv[:,:3,:3],modQ)-epsinv[:,nxs]*modQ   #van Smaalen Eq. 3.3
    1748     phi = np.inner(XYZ,modQ).T
     1748    phi = np.inner((XYZ-SGT[:,:3][nxs,:,:]),modQ).T
    17491749    TA = np.sum(mst[nxs,:,:]*(XYZ-SGT[:,:3][nxs,:,:]),axis=-1).T
    1750     phase =  TA[nxs,:,:] + epsinv[nxs,:,nxs]*(glTau[:,nxs,nxs]+phi[nxs,:,:])+SGT[:,3][nxs,:,nxs]
    1751     psin = np.sin(twopi*phase)
     1750    phase =  TA[nxs,:,:] + epsinv[nxs,:,nxs]*(glTau[:,nxs,nxs])+phi[nxs,:,:]-SGT[:,3][nxs,:,nxs]   #+,+,+ best for DyMnGe
     1751    psin = np.sin(twopi*phase)      #tau,ops,atms
    17521752    pcos = np.cos(twopi*phase)
    1753     MmodAR = Am[nxs,nxs,:,:]*pcos[:,:,:,nxs]    #cos term
    1754     MmodBR = Bm[nxs,nxs,:,:]*psin[:,:,:,nxs]    #sin term
     1753    MmodAR = Am[nxs,nxs,:,:]*pcos[:,:,:,nxs]    #Re cos term; tau,ops,atms, Mxyz
     1754    MmodBR = Bm[nxs,nxs,:,:]*psin[:,:,:,nxs]    #Re sin term
    17551755    MmodAR = np.sum(SGMT[nxs,:,nxs,:,:]*MmodAR[:,:,:,nxs,:],axis=-1)
    17561756    MmodBR = np.sum(SGMT[nxs,:,nxs,:,:]*MmodBR[:,:,:,nxs,:],axis=-1)
    1757     MmodAI = Am[nxs,nxs,:,:]*psin[:,:,:,nxs]    #cos term
    1758     MmodBI = Bm[nxs,nxs,:,:]*pcos[:,:,:,nxs]    #sin term
     1757    MmodAI = Am[nxs,nxs,:,:]*psin[:,:,:,nxs]    #Im cos term
     1758    MmodBI = Bm[nxs,nxs,:,:]*pcos[:,:,:,nxs]    #Im sin term
    17591759    MmodAI = np.sum(SGMT[nxs,:,nxs,:,:]*MmodAI[:,:,:,nxs,:],axis=-1)
    17601760    MmodBI = np.sum(SGMT[nxs,:,nxs,:,:]*MmodBI[:,:,:,nxs,:],axis=-1)
    1761     return MmodAR,MmodBR,MmodAI,MmodBI    #Ntau,Nops,Natm,Mxyz; cos & sin parts
     1761    return MmodAR,MmodBR,MmodAI,MmodBI    #Ntau,Nops,Natm,Mxyz; Re, Im cos & sin parts
    17621762       
    17631763def Modulation(H,HP,nWaves,Fmod,Xmod,Umod,glTau,glWt):
  • trunk/GSASIIstrMath.py

    r4999 r5001  
    15341534    if parmDict[pfx+'isMag']:       #This part correct for making modulated mag moments on equiv atoms - Mmod matched drawing & Bilbao drawings
    15351535   
    1536         mXYZ = np.array([[XYZ[0] for XYZ in list(G2spc.GenAtom(xyz,SGData,All=True,Move=True))] for xyz in (Xdata+dXdata).T]) #Natn,Nop,xyz
     1536        mXYZ = np.array([[XYZ[0] for XYZ in list(G2spc.GenAtom(xyz,SGData,All=True,Move=False))] for xyz in (Xdata+dXdata).T]) #Natn,Nop,xyz
    15371537        if SGData['SGGray']:
    15381538            mXYZ = np.hstack((mXYZ,mXYZ))
    15391539
    15401540        MmodAR,MmodBR,MmodAI,MmodBI = G2mth.MagMod(glTau,mXYZ,modQ,MSSdata,SGData,SSGData)  #Ntau,Nops,Natm,Mxyz cos,sin parts sum matches drawing
    1541         MmodA = MmodAR+MmodBR
    1542         MmodB = MmodAI+MmodBI
    15431541       
    15441542        if not SGData['SGGray']:    #for fixed Mx,My,Mz
     
    16451643            fbsm = np.sum(np.sum(fbms,axis=-2),axis=-2)
    16461644# #put into cartesian space
    1647             facm = np.inner(fasm,uAmat.T)       #.T better than not
    1648             fbcm = np.inner(fbsm,uAmat.T)
     1645            facm = np.inner(fasm,uBmat)       #uBmat best fit for DyMnGe
     1646            fbcm = np.inner(fbsm,uBmat)
    16491647#form e.F dot product
    16501648            eDotFa = np.sum(eM[:,nxs,:]*facm,axis=-1)    #Nref,Ntau       
Note: See TracChangeset for help on using the changeset viewer.