(* ::Package:: *)

Print["Petrov routine loaded"];

aOrd[i_] := {{1, 2}, {1, 3}, {1, 4}, {2, 3}, {4, 2}, {3, 4}}[[i]]

(* 

   In the below routine

   mat = 6x6 matrix representing a skewon-free (2,2)-tensor as 
         described in Section 2.3 in the paper
   
   output = 6x6 matrix that represent the (2,2) tensor using
         the Petrov-notation in [SWW10]
         
*)

Petrov[mat_] := Module[{tmp},
  kappa = emMatrixToKappa[mat];
  Table[
    1/2 * Sum[
      emReadNormal[kappa, rr, ss, aOrd[ii][[1]], 
        aOrd[ii][[2]]] Signature[{rr, ss, aOrd[kk][[1]], 
         aOrd[kk][[2]]}],
      {rr, 1, 4}, {ss, 1, 4}
      ],
    {ii, 1, 6}, {kk, 1, 6}
    ] // MatrixForm
  ]