28 std::vector<unsigned int>
m_dim;
33 Lattice(std::vector<unsigned int>latticeDimensions) {
58 m_sites(std::move(other.m_sites)),
72 *
this = std::move(tmp);
85 m_sites = std::move(other.m_sites);
93 void allocate(std::vector<unsigned int> dim);
112 printf(
"OUT OF BUNDS WITH INDEX %lu of %lu", i,
m_latticeSize);
234 for (
unsigned long int iSite = 0; iSite < m_latticeSize; iSite++) {
235 m_sites[iSite] += B[iSite];
242 for (
unsigned long int iSite = 0; iSite < m_latticeSize; iSite++) {
243 m_sites[iSite] += B[iSite];
250 for (
unsigned long int iSite = 0; iSite < m_latticeSize; iSite++) {
251 m_sites[iSite] -= B[iSite];
258 for (
unsigned long int iSite = 0; iSite < m_latticeSize; iSite++) {
259 m_sites[iSite] -= B[iSite];
266 for (
unsigned long int iSite = 0; iSite < m_latticeSize; iSite++) {
267 m_sites[iSite] *= B[iSite];
273 for (
unsigned long int iSite = 0; iSite < m_latticeSize; iSite++) {
274 m_sites[iSite] *= B[iSite];
281 for (
unsigned long int iSite = 0; iSite < m_latticeSize; iSite++) {
289 for (
unsigned long int iSite = 0; iSite < m_latticeSize; iSite++) {
298 for (
unsigned long int iSite = 0; iSite < m_latticeSize; iSite++) {
306 for (
unsigned long int iSite = 0; iSite < m_latticeSize; iSite++) {
314 for (
unsigned long int iSite = 0; iSite < m_latticeSize; iSite++) {
322 for (
unsigned long int iSite = 0; iSite < m_latticeSize; iSite++) {
334 for (
unsigned long int iSite = 0; iSite < m_latticeSize; iSite++) {
335 m_sites[iSite].identity();
341 for (
unsigned long int iSite = 0; iSite <
m_latticeSize; iSite++) {
349 for (
unsigned long int iSite = 0; iSite <
m_latticeSize; iSite++) {
356 for (
unsigned long int iSite = 0; iSite < m_latticeSize; iSite++) {
357 m_sites[iSite].zeros();
363 for (
unsigned long int iSite = 0; iSite <
m_latticeSize; iSite++) {
371 for (
unsigned long int iSite = 0; iSite <
m_latticeSize; iSite++) {
379 m_latticeSize = dim[0] * dim[1] * dim[2] * dim[3];
381 m_sites.resize(m_latticeSize);
388 m_sites.resize(m_latticeSize);
389 for (
unsigned long int iSite = 0; iSite < m_latticeSize; iSite++) {
390 m_sites[iSite] = B[iSite];
402 for (
unsigned long int iSite = 0; iSite < L.
m_latticeSize; iSite++) {
403 tempTraceSum[iSite] = (L[iSite][0] + L[iSite][8] + L[iSite][16]);
412 for (
unsigned long int iSite = 0; iSite < L.
m_latticeSize; iSite++) {
413 tempTraceSum[iSite] = (L[iSite][1] + L[iSite][9] + L[iSite][17]);
422 for (
unsigned long int iSite = 0; iSite < L.
m_latticeSize; iSite++) {
423 tempTraceSum[iSite] =
complex(L[iSite][0] + L[iSite][8] + L[iSite][16],
424 L[iSite][1] + L[iSite][9] + L[iSite][17]);
432 for (
unsigned long int iSite = 0; iSite < L.
m_latticeSize; iSite++) {
433 L[iSite][1] -= other.
m_sites[iSite];
434 L[iSite][9] -= other.
m_sites[iSite];
435 L[iSite][17] -= other.
m_sites[iSite];
443 for (
unsigned long int iSite = 0; iSite < L.m_latticeSize; iSite++) {
444 L[iSite][1] -= other[iSite];
445 L[iSite][9] -= other[iSite];
446 L[iSite][17] -= other[iSite];
454 for (
unsigned long int iSite = 0; iSite < L.
m_latticeSize; iSite++) {
455 L[iSite][0] -= other.
m_sites[iSite];
456 L[iSite][8] -= other.
m_sites[iSite];
457 L[iSite][16] -= other.
m_sites[iSite];
465 for (
unsigned long int iSite = 0; iSite < L.m_latticeSize; iSite++) {
466 L[iSite][0] -= other[iSite];
467 L[iSite][8] -= other[iSite];
468 L[iSite][16] -= other[iSite];
478 for (
unsigned long int iSite = 0; iSite < L.
m_latticeSize; iSite++) {
479 latticeSum += L[iSite];
492 std::vector<double> latticeSpatialSum(L.
m_dim[3], 0);
495 for (
unsigned int it = 0; it < L.
m_dim[3]; it++) {
496 for (
unsigned int iy = 0; iy < L.
m_dim[1]; iy++) {
497 for (
unsigned int ix = 0; ix < L.
m_dim[0]; ix++) {
498 for (
unsigned int iz = 0; iz < L.
m_dim[2]; iz++) {
505 return latticeSpatialSum;
513 unsigned long site = 0;
518 for (
unsigned int ix = 0; ix < L1.
m_dim[0]; ix++) {
519 for (
unsigned int iy = 0; iy < L1.
m_dim[1]; iy++) {
520 for (
unsigned int iz = 0; iz < L1.
m_dim[2]; iz++) {
521 for (
unsigned int it = 0; it < L1.
m_dim[3]; it++) {
538 unsigned long site = 0;
543 for (
unsigned int ix = 0; ix < L1.
m_dim[0]; ix++) {
544 for (
unsigned int iy = 0; iy < L1.
m_dim[1]; iy++) {
545 for (
unsigned int iz = 0; iz < L1.
m_dim[2]; iz++) {
546 for (
unsigned int it = 0; it < L1.
m_dim[3]; it++) {
563 for (
unsigned long int iSite = 0; iSite < L.
m_latticeSize; iSite++) {
564 latticeSum += L[iSite][0] + L[iSite][8] + L[iSite][16];
574 for (
unsigned long int iSite = 0; iSite < L1.
m_latticeSize; iSite++) {
585 for (
unsigned long int iSite = 0; iSite < B.
m_latticeSize; iSite++) {
588 return std::move(_L);
596 for (
unsigned long int iSite = 0; iSite < B.m_latticeSize; iSite++) {
597 _L.
m_sites[iSite] = B.m_sites[iSite].inv();
599 return std::move(_L);
607 for (
unsigned long int iSite = 0; iSite < B.
m_latticeSize; iSite++) {
610 return std::move(_L);
618 for (
unsigned long int iSite = 0; iSite < B.m_latticeSize; iSite++) {
619 _L.
m_sites[iSite] = B.m_sites[iSite].transpose();
621 return std::move(_L);
629 for (
unsigned long int iSite = 0; iSite < B.
m_latticeSize; iSite++) {
632 return std::move(_L);
640 for (
unsigned long int iSite = 0; iSite < B.m_latticeSize; iSite++) {
641 _L.
m_sites[iSite] = B.m_sites[iSite].conjugate();
643 return std::move(_L);
654 for (
unsigned long int iSite = 0; iSite < B.
m_latticeSize; iSite++) {
657 return std::move(_L);
668 for (
unsigned long int iSite = 0; iSite < B.m_latticeSize; iSite++) {
669 _L.
m_sites[iSite] = B.m_sites[iSite].makeAntiHermitian();
671 return std::move(_L);
682 for (
unsigned long int iSite = 0; iSite < B.
m_latticeSize; iSite++) {
685 return std::move(_L);
696 for (
unsigned long int iSite = 0; iSite < B.m_latticeSize; iSite++) {
697 _L.
m_sites[iSite] = B.m_sites[iSite].makeHermitian();
699 return std::move(_L);
736 std::vector<SU3> sendCube;
737 std::vector<SU3> recvCube;
739 MPI_Request sendReq,recvReq;
742 switch(lorentzVector) {
751 for (
unsigned int iy = 0; iy < L.
m_dim[1]; iy++) {
752 for (
unsigned int iz = 0; iz < L.
m_dim[2]; iz++) {
753 for (
unsigned int it = 0; it < L.
m_dim[3]; it++) {
762 for (
unsigned int ix = 1; ix < L.
m_dim[0]; ix++) {
763 for (
unsigned int iy = 0; iy < L.
m_dim[1]; iy++) {
764 for (
unsigned int iz = 0; iz < L.
m_dim[2]; iz++) {
765 for (
unsigned int it = 0; it < L.
m_dim[3]; it++) {
772 MPI_Wait(&sendReq,MPI_STATUS_IGNORE);
773 MPI_Wait(&recvReq,MPI_STATUS_IGNORE);
775 for (
unsigned int iy = 0; iy < L.
m_dim[1]; iy++) {
776 for (
unsigned int iz = 0; iz < L.
m_dim[2]; iz++) {
777 for (
unsigned int it = 0; it < L.
m_dim[3]; it++) {
788 for (
unsigned int ix = 0; ix < L.
m_dim[0]; ix++) {
789 for (
unsigned int iz = 0; iz < L.
m_dim[2]; iz++) {
790 for (
unsigned int it = 0; it < L.
m_dim[3]; it++) {
798 for (
unsigned int ix = 0; ix < L.
m_dim[0]; ix++) {
799 for (
unsigned int iy = 1; iy < L.
m_dim[1]; iy++) {
800 for (
unsigned int iz = 0; iz < L.
m_dim[2]; iz++) {
801 for (
unsigned int it = 0; it < L.
m_dim[3]; it++) {
808 MPI_Wait(&sendReq,MPI_STATUS_IGNORE);
809 MPI_Wait(&recvReq,MPI_STATUS_IGNORE);
810 for (
unsigned int ix = 0; ix < L.
m_dim[0]; ix++) {
811 for (
unsigned int iz = 0; iz < L.
m_dim[2]; iz++) {
812 for (
unsigned int it = 0; it < L.
m_dim[3]; it++) {
823 for (
unsigned int ix = 0; ix < L.
m_dim[0]; ix++) {
824 for (
unsigned int iy = 0; iy < L.
m_dim[1]; iy++) {
825 for (
unsigned int it = 0; it < L.
m_dim[3]; it++) {
833 for (
unsigned int ix = 0; ix < L.
m_dim[0]; ix++) {
834 for (
unsigned int iy = 0; iy < L.
m_dim[1]; iy++) {
835 for (
unsigned int iz = 1; iz < L.
m_dim[2]; iz++) {
836 for (
unsigned int it = 0; it < L.
m_dim[3]; it++) {
843 MPI_Wait(&recvReq,MPI_STATUS_IGNORE);
844 MPI_Wait(&sendReq,MPI_STATUS_IGNORE);
845 for (
unsigned int ix = 0; ix < L.
m_dim[0]; ix++) {
846 for (
unsigned int iy = 0; iy < L.
m_dim[1]; iy++) {
847 for (
unsigned int it = 0; it < L.
m_dim[3]; it++) {
858 for (
unsigned int ix = 0; ix < L.
m_dim[0]; ix++) {
859 for (
unsigned int iy = 0; iy < L.
m_dim[1]; iy++) {
860 for (
unsigned int iz = 0; iz < L.
m_dim[2]; iz++) {
868 for (
unsigned int ix = 0; ix < L.
m_dim[0]; ix++) {
869 for (
unsigned int iy = 0; iy < L.
m_dim[1]; iy++) {
870 for (
unsigned int iz = 0; iz < L.
m_dim[2]; iz++) {
871 for (
unsigned int it = 1; it < L.
m_dim[3]; it++) {
878 MPI_Wait(&recvReq,MPI_STATUS_IGNORE);
879 MPI_Wait(&sendReq,MPI_STATUS_IGNORE);
880 for (
unsigned int ix = 0; ix < L.
m_dim[0]; ix++) {
881 for (
unsigned int iy = 0; iy < L.
m_dim[1]; iy++) {
882 for (
unsigned int iz = 0; iz < L.
m_dim[2]; iz++) {
893 switch(lorentzVector) {
898 for (
unsigned int iy = 0; iy < L.
m_dim[1]; iy++) {
899 for (
unsigned int iz = 0; iz < L.
m_dim[2]; iz++) {
900 for (
unsigned int it = 0; it < L.
m_dim[3]; it++) {
909 for (
unsigned int ix = 0; ix < L.
m_dim[0] - 1; ix++) {
910 for (
unsigned int iy = 0; iy < L.
m_dim[1]; iy++) {
911 for (
unsigned int iz = 0; iz < L.
m_dim[2]; iz++) {
912 for (
unsigned int it = 0; it < L.
m_dim[3]; it++) {
919 MPI_Wait(&sendReq,MPI_STATUS_IGNORE);
920 MPI_Wait(&recvReq,MPI_STATUS_IGNORE);
921 for (
unsigned int iy = 0; iy < L.
m_dim[1]; iy++) {
922 for (
unsigned int iz = 0; iz < L.
m_dim[2]; iz++) {
923 for (
unsigned int it = 0; it < L.
m_dim[3]; it++) {
934 for (
unsigned int ix = 0; ix < L.
m_dim[0]; ix++) {
935 for (
unsigned int iz = 0; iz < L.
m_dim[2]; iz++) {
936 for (
unsigned int it = 0; it < L.
m_dim[3]; it++) {
944 for (
unsigned int ix = 0; ix < L.
m_dim[0]; ix++) {
945 for (
unsigned int iy = 0; iy < L.
m_dim[1] - 1; iy++) {
946 for (
unsigned int iz = 0; iz < L.
m_dim[2]; iz++) {
947 for (
unsigned int it = 0; it < L.
m_dim[3]; it++) {
954 MPI_Wait(&sendReq,MPI_STATUS_IGNORE);
955 MPI_Wait(&recvReq,MPI_STATUS_IGNORE);
956 for (
unsigned int ix = 0; ix < L.
m_dim[0]; ix++) {
957 for (
unsigned int iz = 0; iz < L.
m_dim[2]; iz++) {
958 for (
unsigned int it = 0; it < L.
m_dim[3]; it++) {
969 for (
unsigned int ix = 0; ix < L.
m_dim[0]; ix++) {
970 for (
unsigned int iy = 0; iy < L.
m_dim[1]; iy++) {
971 for (
unsigned int it = 0; it < L.
m_dim[3]; it++) {
979 for (
unsigned int ix = 0; ix < L.
m_dim[0]; ix++) {
980 for (
unsigned int iy = 0; iy < L.
m_dim[1]; iy++) {
981 for (
unsigned int iz = 0; iz < L.
m_dim[2] - 1; iz++) {
982 for (
unsigned int it = 0; it < L.
m_dim[3]; it++) {
989 MPI_Wait(&recvReq,MPI_STATUS_IGNORE);
990 MPI_Wait(&sendReq,MPI_STATUS_IGNORE);
991 for (
unsigned int ix = 0; ix < L.
m_dim[0]; ix++) {
992 for (
unsigned int iy = 0; iy < L.
m_dim[1]; iy++) {
993 for (
unsigned int it = 0; it < L.
m_dim[3]; it++) {
1004 for (
unsigned int ix = 0; ix < L.
m_dim[0]; ix++) {
1005 for (
unsigned int iy = 0; iy < L.
m_dim[1]; iy++) {
1006 for (
unsigned int iz = 0; iz < L.
m_dim[2]; iz++) {
1014 for (
unsigned int ix = 0; ix < L.
m_dim[0]; ix++) {
1015 for (
unsigned int iy = 0; iy < L.
m_dim[1]; iy++) {
1016 for (
unsigned int iz = 0; iz < L.
m_dim[2]; iz++) {
1017 for (
unsigned int it = 0; it < L.
m_dim[3] - 1; it++) {
1024 MPI_Wait(&recvReq,MPI_STATUS_IGNORE);
1025 MPI_Wait(&sendReq,MPI_STATUS_IGNORE);
1026 for (
unsigned int ix = 0; ix < L.
m_dim[0]; ix++) {
1027 for (
unsigned int iy = 0; iy < L.
m_dim[1]; iy++) {
1028 for (
unsigned int iz = 0; iz < L.
m_dim[2]; iz++) {
Lattice< SU3 > shift(Lattice< SU3 > L, DIR direction, unsigned int lorentzVector)
shift copies the lattice L and shifts it in a specified lorentzVector direction DIR.
Definition: lattice.h:728
void zeros()
zeros sets all of the SU3 elements in the lattice to zero.
Definition: lattice.h:355
Lattice< T > operator-(Lattice< T > A, Lattice< T > &B)
Definition: lattice.h:167
void allocate(std::vector< unsigned int > dim)
allocate method for allocating memory.
Definition: lattice.h:378
static unsigned long cubeIndex(unsigned long int i, unsigned long int j, unsigned long int k, unsigned long int Ni, unsigned long int Nj)
Definition: index.h:27
static MPI_Comm ACTIVE_COMM
The communicator ACTIVE_COMM is the communicator for the ACTIVE_GROUP.
Definition: parallelparameters.h:36
Lattice< SU3 > inv(Lattice< SU3 > &B)
Definition: lattice.h:581
A complex number class, consisting of t.
Definition: complex.h:16
Lattice< double > realTraceMultiplication(Lattice< SU3 > L1, Lattice< SU3 > L2)
Definition: lattice.h:508
Lattice(std::vector< unsigned int >latticeDimensions)
Definition: lattice.h:33
T sum(Lattice< T > L)
Definition: lattice.h:474
Lattice< double > imagTrace(Lattice< SU3 > L)
Definition: lattice.h:409
static int get(int iProcDir)
get returns the neighbourlist for the the calling processor/rank and the direction given py iProcDir.
Definition: neighbours.h:118
Lattice< SU3 > transpose(Lattice< SU3 > &B)
Definition: lattice.h:603
Lattice< complex > trace(Lattice< SU3 > L)
Definition: lattice.h:419
Lattice(Lattice< T > &&other) noexcept
Lattice move constructor.
Definition: lattice.h:57
Lattice< SU3 > makeAntiHermitian(Lattice< SU3 > &B)
Definition: lattice.h:647
static unsigned long getIndex(unsigned int i, unsigned int j, unsigned int k, unsigned int l)
Definition: index.h:31
unsigned long m_latticeSize
Definition: lattice.h:29
double traceRealMultiplication(SU3 A, SU3 B)
traceRealMultiplication
Definition: functions.h:42
Lattice< T > operator+(Lattice< T > A, Lattice< T > &B)
Definition: lattice.h:155
Lattice< T > copy(Lattice< T > B)
copy method for copying content of another lattice B onto itself.
Definition: lattice.h:385
std::vector< unsigned int > m_dim
Definition: lattice.h:28
Lattice< double > imagTraceMultiplication(Lattice< SU3 > L1, Lattice< SU3 > L2)
Definition: lattice.h:533
T & operator[](unsigned long i)
operator [] access operator that has no boundary checking.
Definition: lattice.h:101
Lattice< T > & operator+=(Lattice< T > &B)
Definition: lattice.h:233
Lattice & operator=(const Lattice &other)
operator = Copy assignement operator
Definition: lattice.h:70
double sumRealTrace(Lattice< SU3 > L)
Definition: lattice.h:559
Lattice< T > & operator/=(double B)
Definition: lattice.h:288
DIR
The DIR enum specifies if we are to move BACKWARDS or FORWARDS in the lattice shifts.
Definition: lattice.h:711
std::vector< T > m_sites
Definition: lattice.h:27
Lattice< T > operator/(Lattice< T > A, double b)
Definition: lattice.h:198
Lattice< T > & operator-=(Lattice< T > &B)
Definition: lattice.h:249
~Lattice()
Definition: lattice.h:38
Definition: lattice.h:712
Lattice(const Lattice< T > &other)
Lattice copy constructor.
Definition: lattice.h:45
Lattice< SU3 > subtractImag(Lattice< SU3 > &L, const Lattice< double > &other)
Definition: lattice.h:430
void identity()
identity method for setting the SU3 matrices of the lattice to identity.
Definition: lattice.h:333
double sumRealTraceMultiplication(Lattice< SU3 > L1, Lattice< SU3 > L2)
Definition: lattice.h:570
Lattice< T > operator *(Lattice< T > A, Lattice< T > &B)
Definition: lattice.h:179
Lattice< SU3 > conjugate(Lattice< SU3 > &B)
Definition: lattice.h:625
Lattice< double > realTrace(Lattice< SU3 > L)
Definition: lattice.h:399
Lattice()
Definition: lattice.h:32
Lattice< SU3 > makeHermitian(Lattice< SU3 > &B)
Definition: lattice.h:675
Lattice< SU3 > subtractReal(Lattice< SU3 > &L, const Lattice< double > &other)
Definition: lattice.h:452
Lattice< T > & operator *=(Lattice< T > &B)
Definition: lattice.h:265
double traceImagMultiplication(SU3 A, SU3 B)
traceImagMultiplication
Definition: functions.h:57
A method for holding a lattice of type T.
Definition: lattice.h:24
Definition: lattice.h:713
T & operator()(unsigned long i)
operator () access operator that has boundary checking.
Definition: lattice.h:110
std::vector< double > sumSpatial(Lattice< double > L)
Definition: lattice.h:485