Changeset 4144


Ignore:
Timestamp:
Sep 11, 2019 2:45:53 PM (4 years ago)
Author:
vondreele
Message:

magnetism again

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIstrMath.py

    r4143 r4144  
    11021102        sinm = np.sin(mphase)                               #ditto - match magstrfc.for
    11031103        cosm = np.cos(mphase)                               #ditto
    1104         HM = np.inner(Bmat.T,H)                             #put into cartesian space
     1104        HM = np.inner(Bmat,H)                             #put into cartesian space
    11051105        HM = HM/np.sqrt(np.sum(HM**2,axis=0))               #Kdata = MAGS & HM = UVEC in magstrfc.for both OK
    11061106        eDotK = np.sum(HM[:,:,nxs,nxs]*Kdata[:,nxs,:,:],axis=0)
     
    14821482    phfx = pfx.split(':')[0]+hfx
    14831483    ast = np.sqrt(np.diag(G))
    1484 #    GS = G/np.outer(ast,ast)
    1485 #    uAmat = G2lat.Gmat2AB(GS)[0]
     1484    GS = G/np.outer(ast,ast)
     1485    uAmat,uBmat = G2lat.Gmat2AB(GS)
    14861486    Mast = twopisq*np.multiply.outer(ast,ast)   
    14871487    SGInv = SGData['SGInv']
     
    15941594            TMcorr = 0.539*(np.reshape(Tiso,Tuij.shape)*Tuij)[:,0,:]*Mdata*Fdata*MF/(2.*Nops)     #Nref,Natm
    15951595                     
    1596             HM = np.inner(Bmat.T,HP.T)                            #put into cartesian space
     1596            HM = np.inner(Bmat,HP.T)                            #put into cartesian space X||H,Z||H*L
    15971597            eM = HM/np.sqrt(np.sum(HM**2,axis=0))               #& normalize
    15981598#for fixed moments --> m=0 reflections
     
    16151615                fams += fam0[:,nxs,:,:,:]
    16161616                fbms += fbm0[:,nxs,:,:,:]
    1617                        
     1617# do sum on ops, atms 1st                       
    16181618            famqs = np.sum(np.sum(fams,axis=-2),axis=-2)      #Nref,Ntau,Mxyz; sum ops & atoms
    16191619            fbmqs = np.sum(np.sum(fbms,axis=-2),axis=-2)
    16201620           
    1621             famcs = np.swapaxes(np.inner(Amat,famqs).T,0,1)     #convert to cartesian
    1622             fbmcs = np.swapaxes(np.inner(Amat,fbmqs).T,0,1)     # as Nref,Ntau,Mxyz
     1621            famcs = np.inner(famqs,Bmat)    #convert to cartesian
     1622            fbmcs = np.inner(fbmqs,Bmat)     # as Nref,Ntau,Mxyz
    16231623           
    16241624            famcs /= np.sqrt(np.sum(famcs**2,axis=-1))[:,:,nxs]     #normalize
     
    16311631            fbss = np.sum(fbmqs**2,axis=-1)*(1.-np.sum(eM.T[:,nxs,:]*fbmcs,axis=-1)**2)
    16321632           
     1633# do sum on ops atoms last? No!
     1634#            famcs = np.inner(fams,Bmat)     #convert to cartesian
     1635#            fbmcs = np.inner(fbms,Bmat)     # as Nref,Ntau,Mxyz
     1636#           
     1637#            famcs /= np.sqrt(np.sum(famcs**2,axis=-1))[:,:,:,:,nxs]     #normalize
     1638#            fbmcs /= np.sqrt(np.sum(fbmcs**2,axis=-1))[:,:,:,:,nxs]
     1639#           
     1640#            famcs = np.nan_to_num(famcs)    #nan --> 0.0
     1641#            fbmcs = np.nan_to_num(fbmcs)
     1642#           
     1643#            famqs = np.sum(fams**2,axis=-1)*(1.-np.sum(eM.T[:,nxs,nxs,nxs,:]*famcs,axis=-1)**2)      #mag intensity calc F^2-(e.F)^2
     1644#            fbmqs = np.sum(fbms**2,axis=-1)*(1.-np.sum(eM.T[:,nxs,nxs,nxs,:]*fbmcs,axis=-1)**2)
     1645#           
     1646#            fass = np.sum(np.sum(famqs,axis=-1),axis=-1)      #Nref,Ntau,Mxyz; sum ops & atoms
     1647#            fbss = np.sum(np.sum(fbmqs,axis=-1),axis=-1)
     1648#           
     1649#do integration           
    16331650            fas = np.sum(glWt*fass,axis=1)
    16341651            fbs = np.sum(glWt*fbss,axis=1)
Note: See TracChangeset for help on using the changeset viewer.