Changeset 2053


Ignore:
Timestamp:
Nov 15, 2015 3:43:23 PM (6 years ago)
Author:
vondreele
Message:

good SS xyz modulation derivatives

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIImath.py

    r2052 r2053  
    10431043    HdotX = twopi*np.inner(HP,Xmod)        #ops x atoms X 32
    10441044    HdotXD = HdotX+D[:,nxs,:]
    1045     HdotXA = twopi*HP[:,nxs,nxs,nxs,:]*np.swapaxes(XmodA,-1,-2)[nxs,:,:,:,:]+D[:,nxs,nxs,:,nxs]  #ops x atoms x waves x 32 x xyz
    1046     HdotXB = twopi*HP[:,nxs,nxs,nxs,:]*np.swapaxes(XmodB,-1,-2)[nxs,:,:,:,:]+D[:,nxs,nxs,:,nxs]
     1045#    HdotXA = twopi*HP[:,nxs,nxs,nxs,:]*np.swapaxes(XmodA,-1,-2)[nxs,:,:,:,:]+D[:,nxs,nxs,:,nxs]  #ops x atoms x waves x 32 x xyz
     1046#    HdotXB = twopi*HP[:,nxs,nxs,nxs,:]*np.swapaxes(XmodB,-1,-2)[nxs,:,:,:,:]+D[:,nxs,nxs,:,nxs]
    10471047    if Af.shape[1]:
    10481048        tauF = np.arange(1.,Af.shape[1]+1-nf)[:,nxs]*glTau  #Fwaves x 32
     
    10611061        UmodB = Bu[:,:,:,:,nxs]*CtauU #ditto
    10621062        Umod = np.swapaxes((UmodA+UmodB),2,4)      #atoms x waves x 32 x 3x3 (symmetric so I can do this!)
    1063         HuH = np.sum(HP[:,nxs,nxs,nxs]*np.inner(HP[:],Umod),axis=-1)    #ops x atoms x waves x 32
     1063        HuH = np.sum(HP[:,nxs,nxs,nxs]*np.inner(HP,Umod),axis=-1)    #ops x atoms x waves x 32
    10641064        HbH = np.exp(-np.sum(HuH,axis=-2)) # ops x atoms x 32; sum waves
    10651065#derivs need to be ops x atoms x waves x 6uij; ops x atoms x waves x 32 x 6uij before sum
     
    10791079    dHdXA = twopi*HP[:,nxs,nxs,nxs,:]*np.swapaxes(StauX,-1,-2)[nxs,:,:,:,:]    #ops x atoms x sine waves x 32 x xyz
    10801080    dHdXB = twopi*HP[:,nxs,nxs,nxs,:]*np.swapaxes(CtauX,-1,-2)[nxs,:,:,:,:]    #ditto - cos waves
    1081     dGdMxCa = -np.sum((Fmod*HbH)[:,:,nxs,:,nxs]*(dHdXA*np.sin(HdotXA))*glWt[nxs,nxs,nxs,:,nxs],axis=-2)
    1082     dGdMxCb = -np.sum((Fmod*HbH)[:,:,nxs,:,nxs]*(dHdXB*np.sin(HdotXB))*glWt[nxs,nxs,nxs,:,nxs],axis=-2)
     1081    dGdMxCa = -np.sum((Fmod*HbH)[:,:,nxs,:,nxs]*(dHdXA*np.sin(HdotXD)[:,:,nxs,:,nxs])*glWt[nxs,nxs,nxs,:,nxs],axis=-2)
     1082    dGdMxCb = -np.sum((Fmod*HbH)[:,:,nxs,:,nxs]*(dHdXB*np.sin(HdotXD)[:,:,nxs,:,nxs])*glWt[nxs,nxs,nxs,:,nxs],axis=-2)
    10831083    dGdMxC = np.concatenate((dGdMxCa,dGdMxCb),axis=-1)
    10841084# ops x atoms x waves x 2xyz - real part
    1085     dGdMxSa = np.sum((Fmod*HbH)[:,:,nxs,:,nxs]*(dHdXA*np.cos(HdotXA))*glWt[nxs,nxs,nxs,:,nxs],axis=-2)   
    1086     dGdMxSb = np.sum((Fmod*HbH)[:,:,nxs,:,nxs]*(dHdXB*np.cos(HdotXB))*glWt[nxs,nxs,nxs,:,nxs],axis=-2)   
     1085    dGdMxSa = np.sum((Fmod*HbH)[:,:,nxs,:,nxs]*(dHdXA*np.cos(HdotXD)[:,:,nxs,:,nxs])*glWt[nxs,nxs,nxs,:,nxs],axis=-2)   
     1086    dGdMxSb = np.sum((Fmod*HbH)[:,:,nxs,:,nxs]*(dHdXB*np.cos(HdotXD)[:,:,nxs,:,nxs])*glWt[nxs,nxs,nxs,:,nxs],axis=-2)   
    10871087    dGdMxS = np.concatenate((dGdMxSa,dGdMxSb),axis=-1)
    10881088# ops x atoms x waves x 2xyz - imaginary part
Note: See TracChangeset for help on using the changeset viewer.