Electrons annihilation to photons in QED
Code: "redberry2.groovy". Programming language: Groovy DMelt Version 1.8. Last modified: 04/22/2014. License: Pro
https://datamelt.org/code/cache/redberry2_5786.groovy
To run this script using the DMelt IDE, copy the above URL link to the menu [File]→[Read script from URL] of the DMelt IDE.



import cc.redberry.groovy.Redberry

import static cc.redberry.core.indices.IndexType.*
import static cc.redberry.groovy.RedberryPhysics.*
import static cc.redberry.groovy.RedberryStatic.*

//******************************************************//
//******** Electrons annihilation in two photons *******//
//******************************************************//

use(Redberry) {
    //setting up matrix quantities
    defineMatrices 'G_a', 'V_i', 'D[x_m]', Matrix1.matrix,
            'v[p_a]', 'u[p_a]', Matrix1.vector,
            'cv[p_a]', 'cu[p_a]', Matrix1.covector
            
        //vertex    
    def V = 'V_m = -I*e*G_m'.t,
        //electron propagator
        D = 'D[p_m] = -I*(m + p_m*G^m)/(m**2 - p_m*p^m)'.t,
        //diagramm a)
        Ma = 'cv[p2_m]*V_m*e^m[k2_m]*D[p1_m-k1_m]*V_n*e^n[k1_m]*u[p1_m]'.t,
        //diagramm b)
        Mb = 'cv[p2_m]*V_m*e^m[k1_m]*D[p1_m-k2_m]*V_n*e^n[k2_m]*u[p1_m]'.t,
        //matrix element
        M = Ma + Mb

    //substitute vertex and propagator in matrix element    
    M = (V & D) >> M
    
    //mandelstam and mass shell substitutions
    def mandelstam = setMandelstam(
            ['p1_m': 'm', 'p2_m': 'm', 'k1_m': '0', 'k2_m': '0'])

    //expand and apply substitutions        
    M = (ExpandAll & mandelstam) >> M
    
    //complex conjugation
    //exchange spinor momentums
    def MC = 'u[p1_m]*cv[p2_m] = v[p2_m]*cu[p1_m]'.t >> M
    //complex conjugate and reorder gamma matrices
    MC = (Conjugate & Reverse[Matrix1]) >> MC

    //squared matrix element
    def M2 = ExpandAll >> (M * MC / 4)

    //photon polarizations
    M2 = 'e_m[k1_a]*e_n[k1_a] = -g_mn'.t >> M2
    M2 = 'e_m[k2_a]*e_n[k2_a] = -g_mn'.t >> M2

    //electron polarizations
    M2 = 'u[p1_m]*cu[p1_m] =  m + p1^m*G_m'.t >> M2
    M2 = 'v[p2_m]*cv[p2_m] = -m + p2^m*G_m'.t >> M2
    
    //trace of gamma matrices
    M2 = DiracTrace['G_a'] >> M2
    
    //final simplifications
    M2 = (ExpandAndEliminate & 'd^m_m = 4'.t & mandelstam) >> M2
    M2 = 'u = 2*m**2 -s-t'.t >> M2
    M2 = Factor >> M2

    println M2
}

You see the box below because you did not login.