GLAC  1.0
functions.h
Go to the documentation of this file.
1 
9 #ifndef FUNCTIONS_H
10 #define FUNCTIONS_H
11 
12 #include "matrices/su3.h"
13 #include "matrices/su2.h"
14 #include "complex.h"
15 
17  // Move into CLASS perhaps best?
18  return complex(H[0]*H[6] - H[1]*H[7] - H[2]*H[4] + H[3]*H[5], H[0]*H[7] + H[1]*H[6] - H[2]*H[5] - H[3]*H[4]);;
19 }
20 
22  /*
23  * Function for taking the determinant of
24  */
25  // Redo! Move into CLASS perhaps best?
26  return complex( - H[0]*H[10]*H[14] + H[0]*H[11]*H[15] + H[0]*H[16]*H[8] - H[0]*H[17]*H[9] + H[1]*H[10]*H[15] + H[1]*H[11]*H[14]
27  - H[1]*H[16]*H[9] - H[1]*H[17]*H[8] + H[10]*H[12]*H[2] - H[10]*H[13]*H[3] - H[11]*H[12]*H[3] - H[11]*H[13]*H[2]
28  - H[12]*H[4]*H[8] + H[12]*H[5]*H[9] + H[13]*H[4]*H[9] + H[13]*H[5]*H[8] + H[14]*H[4]*H[6] - H[14]*H[5]*H[7]
29  - H[15]*H[4]*H[7] - H[15]*H[5]*H[6] - H[16]*H[2]*H[6] + H[16]*H[3]*H[7] + H[17]*H[2]*H[7] + H[17]*H[3]*H[6],
30  - H[0]*H[10]*H[15] - H[0]*H[11]*H[14] + H[0]*H[16]*H[9] + H[0]*H[17]*H[8] - H[1]*H[10]*H[14] + H[1]*H[11]*H[15]
31  + H[1]*H[16]*H[8] - H[1]*H[17]*H[9] + H[10]*H[12]*H[3] + H[10]*H[13]*H[2] + H[11]*H[12]*H[2] - H[11]*H[13]*H[3]
32  - H[12]*H[4]*H[9] - H[12]*H[5]*H[8] - H[13]*H[4]*H[8] + H[13]*H[5]*H[9] + H[14]*H[4]*H[7] + H[14]*H[5]*H[6]
33  + H[15]*H[4]*H[6] - H[15]*H[5]*H[7] - H[16]*H[2]*H[7] - H[16]*H[3]*H[6] - H[17]*H[2]*H[6] + H[17]*H[3]*H[7]);
34 }
35 
42 inline double traceRealMultiplication(SU3 A, SU3 B) {
43  /*
44  * For two regular non-sparse trace multiplications taking only real components.
45  */
46  return (A[0]*B[0] - A[1]*B[1] + A[2]*B[6] - A[3]*B[7] + A[4]*B[12] - A[5]*B[13] +
47  A[6]*B[2] - A[7]*B[3] + A[8]*B[8] - A[9]*B[9] + A[10]*B[14] - A[11]*B[15] +
48  A[12]*B[4] - A[13]*B[5] + A[14]*B[10] - A[15]*B[11] + A[16]*B[16] - A[17]*B[17]);
49 }
50 
57 inline double traceImagMultiplication(SU3 A, SU3 B) {
58  /*
59  * For two regular non-sparse trace multiplications taking only imaginary components.
60  */
61  return (A[0]*B[1] + A[1]*B[0] + A[2]*B[7] + A[3]*B[6] + A[4]*B[13] + A[5]*B[12] +
62  A[6]*B[3] + A[7]*B[2] + A[8]*B[9] + A[9]*B[8] + A[10]*B[15] + A[11]*B[14] +
63  A[12]*B[5] + A[13]*B[4] + A[14]*B[11] + A[15]*B[10] + A[16]*B[17] + A[17]*B[16]);
64 
65 }
66 
67 #endif // FUNCTIONS_H
A complex number class, consisting of t.
Definition: complex.h:16
double traceRealMultiplication(SU3 A, SU3 B)
traceRealMultiplication
Definition: functions.h:42
class for holding matrices.
Definition: su3.h:18
complex SU3Determinant(SU3 H)
Definition: functions.h:21
complex SU2Determinant(SU2 H)
File for holding various functions.
Definition: functions.h:16
double traceImagMultiplication(SU3 A, SU3 B)
traceImagMultiplication
Definition: functions.h:57
Class for holding matrices.
Definition: su2.h:21