(* ::Package:: *)

(************************************************************************)
(* This file was generated automatically by the Mathematica front end.  *)
(* It contains Initialization cells from a Notebook file, which         *)
(* typically will have the same name as this file except ending in      *)
(* ".nb" instead of ".m".                                               *)
(*                                                                      *)
(* This file is intended to be loaded into the Mathematica kernel using *)
(* the package loading commands Get or Needs.  Doing so is equivalent   *)
(* to using the Evaluate Initialization Cells menu command in the front *)
(* end.                                                                 *)
(*                                                                      *)
(* DO NOT EDIT THIS FILE.  This entire file is regenerated              *)
(* automatically each time the parent Notebook file is saved in the     *)
(* Mathematica front end.  Any changes you make to this file will be    *)
(* overwritten.                                                         *)
(************************************************************************)



(* ::Input::Initialization:: *)
Bed[K_,\[Lambda]_]:=Module[{t,r,aps,cs,a,A,is},
t=1-\[Lambda]^2; r=t+t\[Conjugate];
aps=Times@@PD[K]/.x:X[i_,j_,k_,l_]:>If[PositiveQ[x],SubPlus[X][j,k,-l,-i],SubMinus[X][-j,k,l,-i]];
cs=aps/._[X][i_,j_,k_,l_]:>a[i,-l]a[j,-i]a[k,-j]a[l,-k]//.a[i_,x___,j_]a[j_,y___,k_]:>a[i,x,j,y,k];
A=Table[0,Length@cs,Length@cs];
Do[is=Position[cs,#][[1,1]]& /@ List@@x;
A[[is,is]]+=If[Head[x]===SubPlus[X],
\!\(
TagBox[
RowBox[{"(", "", GridBox[{
{"0", 
RowBox[{"t", "\[Conjugate]"}], "0", 
RowBox[{"-", 
RowBox[{"t", "\[Conjugate]"}]}]},
{"t", 
RowBox[{"-", "r"}], 
RowBox[{"-", 
RowBox[{"t", "\[Conjugate]"}]}], 
RowBox[{"2", 
RowBox[{"t", "\[Conjugate]"}]}]},
{"0", 
RowBox[{"-", "t"}], "0", "t"},
{
RowBox[{"-", "t"}], 
RowBox[{"2", "t"}], 
RowBox[{"t", "\[Conjugate]"}], 
RowBox[{"-", "r"}]}
},
GridBoxAlignment->{"Columns" -> {{Center}}, "Rows" -> {{Baseline}}},
GridBoxSpacings->{"Columns" -> {Offset[0.27999999999999997`], {Offset[0.7]}, Offset[0.27999999999999997`]}, "Rows" -> {Offset[0.2], {Offset[0.4]}, Offset[0.2]}}], "", ")"}],
Function[BoxForm`e$, MatrixForm[BoxForm`e$]]]\),\!\(
TagBox[
RowBox[{"(", "", GridBox[{
{"r", 
RowBox[{"-", "t"}], 
RowBox[{
RowBox[{"-", "2"}], " ", 
RowBox[{"t", "\[Conjugate]"}]}], 
RowBox[{"t", "\[Conjugate]"}]},
{
RowBox[{"-", 
RowBox[{"t", "\[Conjugate]"}]}], "0", 
RowBox[{"t", "\[Conjugate]"}], "0"},
{
RowBox[{
RowBox[{"-", "2"}], "t"}], "t", "r", 
RowBox[{"-", 
RowBox[{"t", "\[Conjugate]"}]}]},
{"t", "0", 
RowBox[{"-", "t"}], "0"}
},
GridBoxAlignment->{"Columns" -> {{Center}}, "Rows" -> {{Baseline}}},
GridBoxSpacings->{"Columns" -> {Offset[0.27999999999999997`], {Offset[0.7]}, Offset[0.27999999999999997`]}, "Rows" -> {Offset[0.2], {Offset[0.4]}, Offset[0.2]}}], "", ")"}],
Function[BoxForm`e$, MatrixForm[BoxForm`e$]]]\)
],
{x,List@@aps}];
MatrixSignature[A]
];



