-- www.eigenmath.org/spinors.txt -- Verify Dirac spinor properties. E1 = sqrt(p1x^2 + p1y^2 + p1z^2 + m1^2) E2 = sqrt(p2x^2 + p2y^2 + p2z^2 + m2^2) E3 = sqrt(p3x^2 + p3y^2 + p3z^2 + m3^2) E4 = sqrt(p4x^2 + p4y^2 + p4z^2 + m4^2) p1 = (E1, p1x, p1y, p1z) p2 = (E2, p2x, p2y, p2z) p3 = (E3, p3x, p3y, p3z) p4 = (E4, p4x, p4y, p4z) u11 = (E1 + m1, 0, p1z, p1x + i p1y) u12 = (0, E1 + m1, p1x - i p1y, -p1z) v21 = (p2z, p2x + i p2y, E2 + m2, 0) v22 = (p2x - i p2y, -p2z, 0, E2 + m2) u31 = (E3 + m3, 0, p3z, p3x + i p3y) u32 = (0, E3 + m3, p3x - i p3y, -p3z) v41 = (p4z, p4x + i p4y, E4 + m4, 0) v42 = (p4x - i p4y, -p4z, 0, E4 + m4) I = ((1,0,0,0),(0,1,0,0),(0,0,1,0),(0,0,0,1)) gmunu = ((1,0,0,0),(0,-1,0,0),(0,0,-1,0),(0,0,0,-1)) gamma0 = ((1,0,0,0),(0,1,0,0),(0,0,-1,0),(0,0,0,-1)) gamma1 = ((0,0,0,1),(0,0,1,0),(0,-1,0,0),(-1,0,0,0)) gamma2 = ((0,0,0,-i),(0,0,i,0),(0,i,0,0),(-i,0,0,0)) gamma3 = ((0,0,1,0),(0,0,0,-1),(-1,0,0,0),(0,1,0,0)) gamma = (gamma0,gamma1,gamma2,gamma3) pslash1 = dot(p1,gmunu,gamma) pslash2 = dot(p2,gmunu,gamma) pslash3 = dot(p3,gmunu,gamma) pslash4 = dot(p4,gmunu,gamma) "checking dirac equation (1=ok)" dot(pslash1 - m1 I,u11) == 0 dot(pslash1 - m1 I,u12) == 0 dot(pslash2 + m2 I,v21) == 0 dot(pslash2 + m2 I,v22) == 0 dot(pslash3 - m3 I,u31) == 0 dot(pslash3 - m3 I,u32) == 0 dot(pslash4 + m4 I,v41) == 0 dot(pslash4 + m4 I,v42) == 0 "checking completeness (1=ok)" adjoint(u) = dot(conj(u),gamma0) outer(u11,adjoint(u11)) + outer(u12,adjoint(u12)) == (E1 + m1) (pslash1 + m1 I) outer(v21,adjoint(v21)) + outer(v22,adjoint(v22)) == (E2 + m2) (pslash2 - m2 I) outer(u31,adjoint(u31)) + outer(u32,adjoint(u32)) == (E3 + m3) (pslash3 + m3 I) outer(v41,adjoint(v41)) + outer(v42,adjoint(v42)) == (E4 + m4) (pslash4 - m4 I)