En = (D[I ℏ #, t] &); 
    px = (D[-I ℏ #, x] &); 
    py = (D[-I ℏ #, y] &); 
    pz = (D[-I ℏ #, z] &);

x px[f[x]] - px[x f[x]]

Lx = ((D[-I ℏ y  #, 
                  z]) -  (D[-I ℏ z  #, 
                  y])) &;

Ly = ((D[-I ℏ z  #, 
                  x]) -  (D[-I ℏ x  #, 
                  z])) &;

Lz = ((D[-I ℏ x  #, 
                  y]) -  (D[-I ℏ y  #, 
                  x])) &;

Simplify[
      Lx[Ly[f[x, y, z]]] - 
        Ly[Lx[f[x, y, z]]] -  I ℏ  Lz[
            f[x, y, z]]]

Lsq = (Lx[ Lx[#]] + Ly[ Ly[#]] + Lz[ Lz[#]]) &;

Simplify[Lsq[Lx[f[x, y, z]]] - Lx[Lsq[f[x, y, z]]]]

αx4=(({{0, 1, 0, 0}, {1, 0, 0, 0}, {0, 0, 0, -1}, {0, 0, -1, 0}}));αy4=(({{0, -I, 0, 0}, {I, 0, 0, 0}, {0, 0, 0, I}, {0, 0, -I, 0}}));αz4=(({{1, 0, 0, 0}, {0, -1, 0, 0}, {0, 0, -1, 0}, {0, 0, 0, 1}}));β4=(({{0, 0, -1, 0}, {0, 0, 0, -1}, {-1, 0, 0, 0}, {0, -1, 0, 0}}));

Hamiltonian4 = (-I ℏ  c (αx4 .  
                      D[ #, x] + αy4 . D[ #, y] + αz4  . 
                      D[ #, z]) + 
              m (c^2) β4 .  #) &;

(* La fonction d' 
        onde à 4 composantes  :  Ψelectron *)

Ψelectron[x_, y_, z_, 
        t_] := {Ψ1[x, y, z, t], Ψ2[x, y, z, 
          t], Ψ3[x, y, z, t], Ψ4[x, y, z, 
          t]}

sx4=(ℏ/2)(({{0, 1, 0, 0}, {1, 0, 0, 0}, {0, 0, 0, 1}, {0, 0, 1, 0}}));sy4=(ℏ/2)(({{0, -I, 0, 0}, {I, 0, 0, 0}, {0, 0, 0, -I}, {0, 0, I, 0}}));sz4=(ℏ/2)(({{1, 0, 0, 0}, {0, -1, 0, 0}, {0, 0, 1, 0}, {0, 0, 0, -1}}));

sx4 . sy4 - sy4 . sx4 - I ℏ sz4

Simplify[
      Hamiltonian4[Lz[Ψelectron[x, y, z, t]]] - 
        Lz[Hamiltonian4[Ψelectron[x, y, z, t]]]]

Spin4z = (sz4 . #) &;

Simplify[
      Hamiltonian4[
          Lz[Ψelectron[x, y, z, t]] + 
            Spin4z[Ψelectron[x, y, z, t]]] - 
        Lz[Hamiltonian4[Ψelectron[x, y, z, t]]] - 
        Spin4z[Hamiltonian4[Ψelectron[x, y, z, t]]]]

(En[Ψelectron[x, y, z, t]] - 
            Hamiltonian4[Ψelectron[x, y, z, t]] // 
          MatrixForm) == 0

Simplify[
      En[En[Ψelectron[x, y, z, t]]] - 
          Hamiltonian4[
            Hamiltonian4[Ψelectron[x, y, z, t]]] == 
        0]

αx6=(1/(Sqrt[2]))(({{0, 1, 0, 0, 0, 0}, {1, 0, 1, 0, 0, 0}, {0, 1, 0, 0, 0, 0}, {0, 0, 0, 0, -1, 0}, {0, 0, 0, -1, 0, -1}, {0, 0, 0, 0, -1, 0}}));αy6=(1/(Sqrt[2]))(({{0, -I, 0, 0, 0, 0}, {I, 0, -I, 0, 0, 0}, {0, I, 0, 0, 0, 0}, {0, 0, 0, 0, I, 0}, {0, 0, 0, -I, 0, I}, {0, 0, 0, 0, -I, 0}}));αz6=(({{1, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, -1, 0, 0, 0}, {0, 0, 0, -1, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 1}}));β6=(({{0, 0, 0, -1, 0, 0}, {0, 0, 0, 0, -1, 0}, {0, 0, 0, 0, 0, -1}, {-1, 0, 0, 0, 0, 0}, {0, -1, 0, 0, 0, 0}, {0, 0, -1, 0, 0, 0}}));

Hamiltonian6 = (-I ℏ  c (αx6 .  
                      D[ #, x] + αy6 . D[ #, y] + αz6  . 
                      D[ #, z]) + 
              m (c^2) β6 .  #) &;

Ψspin1[x_, y_, z_, 
        t_] := {Ψ1[x, y, z, t], Ψ2[x, y, z, 
          t], Ψ3[x, y, z, t], Ψ4[x, y, z, 
          t], Ψ5[x, y, z], Ψ6[x, y, z]}

sx6=(ℏ/(Sqrt[2]))(({{0, 1, 0, 0, 0, 0}, {1, 0, 1, 0, 0, 0}, {0, 1, 0, 0, 0, 0}, {0, 0, 0, 0, 1, 0}, {0, 0, 0, 1, 0, 1}, {0, 0, 0, 0, 1, 0}}));sy6=(ℏ/(Sqrt[2]))(({{0, -I, 0, 0, 0, 0}, {I, 0, -I, 0, 0, 0}, {0, I, 0, 0, 0, 0}, {0, 0, 0, 0, -I, 0}, {0, 0, 0, I, 0, -I}, {0, 0, 0, 0, I, 0}}));sz6=ℏ(({{1, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, -1, 0, 0, 0}, {0, 0, 0, 1, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, -1}}));

sx6 . sy6 - sy6 . sx6 - I ℏ sz6

Simplify[
      Hamiltonian6[Lz[Ψspin1[x, y, z, t]]] - 
        Lz[Hamiltonian6[Ψspin1[x, y, z, t]]]]

Spin6z = (sz6 . #) &;

Simplify[
      Hamiltonian6[
          Lz[Ψspin1[x, y, z, t]] + 
            Spin6z[Ψspin1[x, y, z, t]]] - 
        Lz[Hamiltonian6[Ψspin1[x, y, z, t]]] - 
        Spin6z[Hamiltonian6[Ψspin1[x, y, z, t]]]]

(* L' équation de Dirac pour le spin 1 :*)

(En[Ψspin1[x, y, z, t]] - 
            Hamiltonian6[Ψspin1[x, y, z, t]] // 
          MatrixForm) == 0

(En[Ψspin1[x, y, z, t]] - 
              Hamiltonian6[Ψspin1[x, y, z, t]] /. m -> 0 // 
          MatrixForm) == 0

T=(({{-(1/(Sqrt[2])), 0, (1/(Sqrt[2])), 0, 0, 0}, {-(I/(Sqrt[2])), 0, -(I/(Sqrt[2])), 0, 0, 0}, {0, 1, 0, 0, 0, 0}, {0, 0, 0, -(1/(Sqrt[2])), 0, (1/(Sqrt[2]))}, {0, 0, 0, -(I/(Sqrt[2])), 0, -(I/(Sqrt[2]))}, {0, 0, 0, 0, 1, 0}}));Tinv=(({{-(1/(Sqrt[2])), (I/(Sqrt[2])), 0, 0, 0, 0}, {0, 0, 1, 0, 0, 0}, {(1/(Sqrt[2])), (I/(Sqrt[2])), 0, 0, 0, 0}, {0, 0, 0, -(1/(Sqrt[2])), (I/(Sqrt[2])), 0}, {0, 0, 0, 0, 0, 1}, {0, 0, 0, (1/(Sqrt[2])), (I/(Sqrt[2])), 0}}));

{T . sx6 . Tinv // MatrixForm, T . sy6 . Tinv // MatrixForm, 
      T . sz6 . Tinv // MatrixForm}

Ψtrans[x_, y_, z_, t_] := 
      Tinv . {Ex[x, y, z, t] + I c Bx[x, y, z, t], 
          Ey[x, y, z, t] + I c By[x, y, z, t], 
          Ez[x, y, z, t] + I c Bz[x, y, z, t], 
          Ex[x, y, z, t] - I c Bx[x, y, z, t], 
          Ey[x, y, z, t] - I c By[x, y, z, t], 
          Ez[x, y, z, t] - I c Bz[x, y, z, t]}

Simplify[Ψtrans[x, y, z, t]] // MatrixForm

sol = 
      Simplify[En[Ψtrans[x, y, z, t]] - 
            Hamiltonian6[Ψtrans[x, y, z, t]] /. 
          m -> 0]

sol[[2]]

Simplify[sol[[1]] - sol[[3]]]

sul = 
        Simplify[(En[En[Ψtrans[x, y, z, t]]] - 
                Hamiltonian6[Hamiltonian6[Ψtrans[x, y, z, t]]] /. 
              m -> 0)];

sul[[2]]

Simplify[sul[[1]] - sul[[3]]]/((Sqrt[2]) (ℏ^2))

Simplify[sul[[1]] + sul[[3]]]/((Sqrt[2]) (ℏ^2))

Simplify[sul[[4]] - sul[[6]]]/((Sqrt[2]) (ℏ^2))

Simplify[sul[[4]] + sul[[6]]]/((Sqrt[2]) (ℏ^2))

Simplify[(En[
              Exp[-((I en t)/ℏ)] 
                Exp[((I p z)/ℏ)]  Tinv . {(Subscript[λ, 1]), (Subscript[λ, 2]), (Subscript[λ, 3]), (Subscript[λ, 4]), (Subscript[λ, 5]), (Subscript[λ, 6])}] - 
            Hamiltonian6[
              Exp[-((I en t)/ℏ)] 
                Exp[((I p z)/ℏ)]  Tinv . {(Subscript[λ, 1]), (Subscript[λ, 2]), (Subscript[λ, 3]), (Subscript[λ, 4]), (Subscript[λ, 5]), (Subscript[λ, 6])}])/(Exp[-((I en t)/ℏ)] 
            Exp[((I p z)/ℏ)])]

Reduce[({(((-en + c p) (Subscript[λ, 1]) + I ((en - c p) (Subscript[λ, 2]) + (c^2) m (I (Subscript[λ, 4]) + (Subscript[λ, 5]))))/(Sqrt[2])), 
              en (Subscript[λ, 3]) + 
                (c^2) m (Subscript[λ, 6]), (((en + c p) (Subscript[λ, 1]) + I ((en + c p) (Subscript[λ, 2]) + (c^2) m (-I (Subscript[λ, 4]) + (Subscript[λ, 5]))))/(Sqrt[2])), ((-(c^2) m (Subscript[λ, 1]) + I ((c^2) m (Subscript[λ, 2]) + (en + c p) (I (Subscript[λ, 4]) + (Subscript[λ, 5]))))/(Sqrt[2])), 
              (c^2) m (Subscript[λ, 3]) + 
                en (Subscript[λ, 6]), (((c^2) m (Subscript[λ, 1]) + I (c^2) m (Subscript[λ, 2]) + (en - c p) ((Subscript[λ, 4]) + I (Subscript[λ, 5])))/(Sqrt[2]))} /. m -> 0) == 
        0, {(Subscript[λ, 1]), (Subscript[λ, 2]), (Subscript[λ, 3]), (Subscript[λ, 4]), (Subscript[λ, 5]), (Subscript[λ, 6])}]

Eigensystem[{{0, -I ℏ, 0, 0, 0, 
          0}, {I ℏ, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 
          0}, {0, 0, 0, 0, -I ℏ, 0}, {0, 0, 
          0, I ℏ, 0, 0}, {0, 0, 0, 0, 0, 0}}]