Changeset 3801 for trunk/GSASIIstrMath.py
- Timestamp:
- Jan 27, 2019 9:04:12 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIstrMath.py
r3795 r3801 976 976 return 977 977 Mag = np.array([np.sqrt(np.inner(mag,np.inner(mag,Ginv))) for mag in Gdata.T]) 978 Gdata = np.inner(Gdata.T, SGMT).T #apply sym. ops.978 Gdata = np.inner(Gdata.T,np.swapaxes(SGMT,1,2)).T #apply sym. ops. 979 979 if SGData['SGInv'] and not SGData['SGFixed']: 980 980 Gdata = np.hstack((Gdata,-Gdata)) #inversion if any … … 982 982 Gdata = SGData['MagMom'][nxs,:,nxs]*Gdata #flip vectors according to spin flip * det(opM) 983 983 Mag = np.tile(Mag[:,nxs],Nops).T #make Mag same length as Gdata 984 VGi = np.sqrt(nl.det(Ginv)) 985 Kdata = np.inner(Gdata.T,uAmat).T*VGi/Mag #Cartesian unit vectors 984 Kdata = np.inner(Gdata.T,uAmat.T).T/Mag #Cartesian unit vectors 986 985 Uij = np.array(G2lat.U6toUij(Uijdata)) 987 986 bij = Mast*Uij.T … … 1130 1129 Mag = np.array([np.sqrt(np.inner(mag,np.inner(mag,Ginv))) for mag in Gdata.T]) 1131 1130 Gones = np.ones_like(Gdata) 1132 Gdata = np.inner(Gdata.T, SGMT).T #apply sym. ops.1131 Gdata = np.inner(Gdata.T,np.swapaxes(SGMT,1,2)).T #apply sym. ops. 1133 1132 Gones = np.inner(Gones.T,SGMT).T 1134 1133 if SGData['SGInv'] and not SGData['SGFixed']: … … 1140 1139 Gones = SGData['MagMom'][nxs,:,nxs]*Gones #flip vectors according to spin flip 1141 1140 Mag = np.tile(Mag[:,nxs],Nops).T #make Mag same length as Gdata 1142 VGi = np.sqrt(nl.det(Ginv)) 1143 Kdata = np.inner(Gdata.T,uAmat).T*VGi/Mag #make unit vectors in Cartesian space 1141 Kdata = np.inner(Gdata.T,uAmat.T).T/Mag #Cartesian unit vectors 1144 1142 Uij = np.array(G2lat.U6toUij(Uijdata)) 1145 1143 bij = Mast*Uij.T … … 1417 1415 GS = G/np.outer(ast,ast) 1418 1416 Ginv = g/np.outer(ainv,ainv) 1419 VGi = np.sqrt(nl.det(Ginv))1420 1417 uAmat = G2lat.Gmat2AB(GS)[0] 1421 1418 Mast = twopisq*np.multiply.outer(ast,ast) … … 1442 1439 1443 1440 if parmDict[pfx+'isMag']: #TODO: fix the math 1444 GSdata = Gdata[:,nxs,:]+Mmod.T 1445 GSdata = np.inner(GSdata.T, SGMT).T #apply sym. ops.1441 GSdata = Gdata[:,nxs,:]+Mmod.T #Mxyz,Ntau,nAtm 1442 GSdata = np.inner(GSdata.T,np.swapaxes(SGMT,1,2)).T #apply sym. ops. 1446 1443 if SGData['SGInv'] and not SGData['SGFixed']: 1447 1444 GSdata = np.hstack((GSdata,-GSdata)) #inversion if any … … 1449 1446 GSdata = SGData['MagMom'][nxs,:,nxs,nxs]*GSdata #flip vectors according to spin flip * det(opM) 1450 1447 SMag = np.sqrt(np.sum((np.inner(GSdata.T,Ginv)*GSdata.T),axis=-1)).T 1451 Kdata = np.inner(G Sdata.T,uAmat).T*VGi/SMag[nxs,:,:,:] #Cartesian unit vectors = 0.9626 for hexagonal???1448 Kdata = np.inner(Gdata.T,uAmat.T).T/SMag[nxs,:,:,:] #Cartesian unit vectors 1452 1449 1453 1450 FF = np.zeros(len(Tdata))
Note: See TracChangeset
for help on using the changeset viewer.