StatMech
Loading...
Searching...
No Matches
generateRM.cuh File Reference

Functions

__global__ void MatrixElementsInSector (Complex_t *dmatTot, Integer_t const LDT, Complex_t const *dmatLoc, Integer_t const LDL, Integer_t const numLoc, Integer_t const n, Integer_t const dloc, Integer_t const momentum, Integer_t const SecDim, Integer_t const *representatives, Integer_t const *periodicity)
 
__device__ Complex_t< double > MAGMA_CEXP (Real_t theta)
 

Function Documentation

◆ MAGMA_CEXP()

__device__ Complex_t< double > MAGMA_CEXP ( Real_t  theta)
69 {
70 return MAGMA_Z_MAKE(cos(theta),sin(theta));
71}

◆ MatrixElementsInSector()

__global__ void MatrixElementsInSector ( Complex_t dmatTot,
Integer_t const  LDT,
Complex_t const *  dmatLoc,
Integer_t const  LDL,
Integer_t const  numLoc,
Integer_t const  n,
Integer_t const  dloc,
Integer_t const  momentum,
Integer_t const  SecDim,
Integer_t const *  representatives,
Integer_t const *  periodicity 
)
78 {
79 int idx = blockIdx.x*blockDim.x +threadIdx.x;
80 int idy = blockIdx.y*blockDim.y +threadIdx.y;
81 if( (idx>idy) || (idx>=SecDim) || (idy>=SecDim) ) return;
82 dmatTot[idx+LDT*idy] = dComplexZero<>;
83 Real_t theta;
84 Integer_t Id1, Id2, locId1, locId2;
85 Integer_t const dimMatLoc = (Integer_t)pow((float)dloc,(float)numLoc);
86
87 for(int trans1 = 0;trans1 < periodicity[idx]; ++trans1) {
88 Id1 = transSpin(representatives[idx],trans1,dloc,n);
89 locId1 = Id1%dimMatLoc;
90 for(int trans2 = 0;trans2 < periodicity[idy]; ++trans2) {
91 Id2 = transSpin(representatives[idy],trans2,dloc,n);
92 locId2 = Id2%dimMatLoc;
93 if( Id1/dimMatLoc != Id2/dimMatLoc ) continue;
94 theta = 2.0*M_PI*momentum*(trans2-trans1)/(Real_t)n;
95 dmatTot[idx+LDT*idy] += dmatLoc[locId1+LDL*locId2]*MAGMA_CEXP(theta);
96 }
97 }
98 dmatTot[idx+LDT*idy] /= sqrt( (Real_t)periodicity[idx]*periodicity[idy] );
99 dmatTot[idy+LDT*idx] = conj(dmatTot[idx+LDT*idy]);
100}
__device__ Complex_t< double > MAGMA_CEXP(Real_t theta)
Definition generateRM.cuh:132
double Real_t
Definition mytypes.hpp:37
MKL_INT Integer_t
Definition mytypes.hpp:359