KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > JSci > physics > quantum > GammaMatrix


1 package JSci.physics.quantum;
2
3 import JSci.maths.Complex;
4 import JSci.maths.matrices.ComplexSquareMatrix;
5 import JSci.maths.fields.ComplexField;
6
7 /**
8 * The GammaMatrix class provides an object for encapsulating the gamma matrices.
9 * @version 1.2
10 * @author Mark Hale
11 */

12 public final class GammaMatrix extends ComplexSquareMatrix {
13         private static final Complex y0_D[][]={
14                 {ComplexField.ONE,ComplexField.ZERO,ComplexField.ZERO,ComplexField.ZERO},
15                 {ComplexField.ZERO,ComplexField.ONE,ComplexField.ZERO,ComplexField.ZERO},
16                 {ComplexField.ZERO,ComplexField.ZERO,ComplexField.MINUS_ONE,ComplexField.ZERO},
17                 {ComplexField.ZERO,ComplexField.ZERO,ComplexField.ZERO,ComplexField.MINUS_ONE}
18         };
19         private static final Complex y1_D[][]={
20                 {ComplexField.ZERO,ComplexField.ZERO,ComplexField.ZERO,ComplexField.ONE},
21                 {ComplexField.ZERO,ComplexField.ZERO,ComplexField.ONE,ComplexField.ZERO},
22                 {ComplexField.ZERO,ComplexField.MINUS_ONE,ComplexField.ZERO,ComplexField.ZERO},
23                 {ComplexField.MINUS_ONE,ComplexField.ZERO,ComplexField.ZERO,ComplexField.ZERO}
24         };
25         private static final Complex y2_D[][]={
26                 {ComplexField.ZERO,ComplexField.ZERO,ComplexField.ZERO,ComplexField.I},
27                 {ComplexField.ZERO,ComplexField.ZERO,ComplexField.MINUS_I,ComplexField.ZERO},
28                 {ComplexField.ZERO,ComplexField.MINUS_I,ComplexField.ZERO,ComplexField.ZERO},
29                 {ComplexField.I,ComplexField.ZERO,ComplexField.ZERO,ComplexField.ZERO}
30         };
31         private static final Complex y3_D[][]={
32                 {ComplexField.ZERO,ComplexField.ZERO,ComplexField.ONE,ComplexField.ZERO},
33                 {ComplexField.ZERO,ComplexField.ZERO,ComplexField.ZERO,ComplexField.MINUS_ONE},
34                 {ComplexField.MINUS_ONE,ComplexField.ZERO,ComplexField.ZERO,ComplexField.ZERO},
35                 {ComplexField.ZERO,ComplexField.ONE,ComplexField.ZERO,ComplexField.ZERO}
36         };
37         private static final Complex y5_D[][]={
38                 {ComplexField.ZERO,ComplexField.ZERO,ComplexField.ONE,ComplexField.ZERO},
39                 {ComplexField.ZERO,ComplexField.ZERO,ComplexField.ZERO,ComplexField.ONE},
40                 {ComplexField.ONE,ComplexField.ZERO,ComplexField.ZERO,ComplexField.ZERO},
41                 {ComplexField.ZERO,ComplexField.ONE,ComplexField.ZERO,ComplexField.ZERO}
42         };
43         private static final Complex y0_M[][]={
44                 {ComplexField.ZERO,ComplexField.ZERO,ComplexField.ZERO,ComplexField.I},
45                 {ComplexField.ZERO,ComplexField.ZERO,ComplexField.MINUS_I,ComplexField.ZERO},
46                 {ComplexField.ZERO,ComplexField.I,ComplexField.ZERO,ComplexField.ZERO},
47                 {ComplexField.MINUS_I,ComplexField.ZERO,ComplexField.ZERO,ComplexField.ZERO}
48         };
49         private static final Complex y1_M[][]={
50                 {ComplexField.ZERO,ComplexField.ZERO,ComplexField.I,ComplexField.ZERO},
51                 {ComplexField.ZERO,ComplexField.ZERO,ComplexField.ZERO,ComplexField.MINUS_I},
52                 {ComplexField.I,ComplexField.ZERO,ComplexField.ZERO,ComplexField.ZERO},
53                 {ComplexField.ZERO,ComplexField.MINUS_I,ComplexField.ZERO,ComplexField.ZERO}
54         };
55         private static final Complex y2_M[][]={
56                 {ComplexField.I,ComplexField.ZERO,ComplexField.ZERO,ComplexField.ZERO},
57                 {ComplexField.ZERO,ComplexField.I,ComplexField.ZERO,ComplexField.ZERO},
58                 {ComplexField.ZERO,ComplexField.ZERO,ComplexField.MINUS_I,ComplexField.ZERO},
59                 {ComplexField.ZERO,ComplexField.ZERO,ComplexField.ZERO,ComplexField.MINUS_I}
60         };
61         private static final Complex y3_M[][]={
62                 {ComplexField.ZERO,ComplexField.ZERO,ComplexField.ZERO,ComplexField.MINUS_I},
63                 {ComplexField.ZERO,ComplexField.ZERO,ComplexField.MINUS_I,ComplexField.ZERO},
64                 {ComplexField.ZERO,ComplexField.MINUS_I,ComplexField.ZERO,ComplexField.ZERO},
65                 {ComplexField.MINUS_I,ComplexField.ZERO,ComplexField.ZERO,ComplexField.ZERO}
66         };
67         private static final Complex y5_M[][]={
68                 {ComplexField.ZERO,ComplexField.ZERO,ComplexField.I,ComplexField.ZERO},
69                 {ComplexField.ZERO,ComplexField.ZERO,ComplexField.ZERO,ComplexField.I},
70                 {ComplexField.MINUS_I,ComplexField.ZERO,ComplexField.ZERO,ComplexField.ZERO},
71                 {ComplexField.ZERO,ComplexField.MINUS_I,ComplexField.ZERO,ComplexField.ZERO}
72         };
73         /**
74         * Gamma 0 matrix (Dirac representation).
75         */

76         public static final GammaMatrix Y0_D=new GammaMatrix(y0_D);
77         /**
78         * Gamma 1 matrix (Dirac representation).
79         */

80         public static final GammaMatrix Y1_D=new GammaMatrix(y1_D);
81         /**
82         * Gamma 2 matrix (Dirac representation).
83         */

84         public static final GammaMatrix Y2_D=new GammaMatrix(y2_D);
85         /**
86         * Gamma 3 matrix (Dirac representation).
87         */

88         public static final GammaMatrix Y3_D=new GammaMatrix(y3_D);
89         /**
90         * Gamma 5 matrix (Dirac representation).
91         */

92         public static final GammaMatrix Y5_D=new GammaMatrix(y5_D);
93         /**
94         * Gamma 0 matrix (Weyl representation).
95         */

96         public static final GammaMatrix Y0_W=Y5_D;
97         /**
98         * Gamma 1 matrix (Weyl representation).
99         */

100         public static final GammaMatrix Y1_W=Y1_D;
101         /**
102         * Gamma 2 matrix (Weyl representation).
103         */

104         public static final GammaMatrix Y2_W=Y2_D;
105         /**
106         * Gamma 3 matrix (Weyl representation).
107         */

108         public static final GammaMatrix Y3_W=Y3_D;
109         /**
110         * Gamma 5 matrix (Weyl representation).
111         */

112         public static final GammaMatrix Y5_W=Y0_D;
113         /**
114         * Gamma 0 matrix (Majorana representation).
115         */

116         public static final GammaMatrix Y0_M=new GammaMatrix(y0_M);
117         /**
118         * Gamma 1 matrix (Majorana representation).
119         */

120         public static final GammaMatrix Y1_M=new GammaMatrix(y1_M);
121         /**
122         * Gamma 2 matrix (Majorana representation).
123         */

124         public static final GammaMatrix Y2_M=new GammaMatrix(y2_M);
125         /**
126         * Gamma 3 matrix (Majorana representation).
127         */

128         public static final GammaMatrix Y3_M=new GammaMatrix(y3_M);
129         /**
130         * Gamma 5 matrix (Majorana representation).
131         */

132         public static final GammaMatrix Y5_M=new GammaMatrix(y5_M);
133         /**
134         * Constructs a gamma matrix.
135         */

136         private GammaMatrix(Complex gammaArray[][]) {
137                 super(gammaArray);
138         }
139         /**
140         * Returns true if this matrix is unitary.
141         */

142         public boolean isUnitary() {
143                 return true;
144         }
145         /**
146         * Returns the determinant.
147         */

148         public Complex det() {
149                 return ComplexField.MINUS_ONE;
150         }
151         /**
152         * Returns the trace.
153         */

154         public Complex trace() {
155                 return ComplexField.ZERO;
156         }
157 }
158
159
Popular Tags