Dirac equations

Let us introduce the following Ore algebra A of partial differential operators

D1=Der[x1];D2=Der[x2];D3=Der[x3];D4=Der[x4];
A=OreAlgebra[D1,D2,D3,D4]

and the matrix R of partial differential operators which defines the Dirac equations for massless particule

MatrixForm[R=ToOrePolynomial[{{D4,0,-I D3,-I D1-D2},
{0,D4, -I D1+D2, I D3},
{I D3, I D1+D2, -D4,0},
{I D1-D2, -I D3, 0,-D4}},A]]

and the left A-module, finitely presented by R, defined by M = (A^(1×4))/(A^(1×4))R.
Let us check whether or not M can be decomposed. We first compute the endomorphisms of M defined a constant matrix P:

MatrixForm[morph=Morphisms[R,R,{0,0},p, A]]

From this P, let us try to compute idempotent endomorphisms of M:

MatrixForm/@(PAll=IdempotentMorphisms[morph,R,p,A])

Considering the nontrivial idempotent endomorphism PAll[[2]], we obtain the following decomposition:

MatrixForm[Decomposition[R,PAll[[2]],A]]

Considering the nontrivial idempotent endomorphism PAll[[3]], we obtain the following decomposition:

MatrixForm[Decomposition[R,PAll[[3]],A]]