SetAttributes[κ,Constant];
SetAttributes[α,Constant];

r:=R[i,j,k,l];
s:=S[i,j,k,l];
(Subscript[s, i]):=Derivative[1,0,0,0][S][i_,j_,k_,l_];
(Subscript[s, j]):=Derivative[0,1,0,0][S][i_,j_,k_,l_]
(Subscript[s, k]):=Derivative[0,0,1,0][S][i_,j_,k_,l_]
(Subscript[s, l]):=Derivative[0,0,0,1][S][i_,j_,k_,l_]

Format[R[i,j,k,l]]:="r";
Format[(Subscript[δ, ij])[i,j,k,l]]:="(Subscript[δ, ij])";
Format[(Subscript[δ, ik])[i,j,k,l]]:="(Subscript[δ, ik])";
Format[(Subscript[δ, il])[i,j,k,l]]:="(Subscript[δ, il])";
Format[(Subscript[δ, jk])[i,j,k,l]]:="(Subscript[δ, jk])";
Format[(Subscript[δ, jl])[i,j,k,l]]:="(Subscript[δ, jl])";
Format[(Subscript[δ, kl])[i,j,k,l]]:="(Subscript[δ, kl])";
Format[Derivative[1,0,0,0][S][i_,j_,k_,l_]]:="(Subscript[s, i])";
Format[Derivative[0,1,0,0][S][i_,j_,k_,l_]]:="(Subscript[s, j])";
Format[Derivative[0,0,1,0][S][i_,j_,k_,l_]]:="(Subscript[s, k])";
Format[Derivative[0,0,0,1][S][i_,j_,k_,l_]]:="(Subscript[s, l])";
Format[(Subscript[s, x])]:="(Subscript[s, x])";
Format[(Subscript[s, y])]:="(Subscript[s, y])";
Format[(Subscript[s, z])]:="(Subscript[s, z])";

rsrule={s-> r^2/2};

$Assumptions = {r≥ 0,κ>0, A1≥ 0, A2≥ 0,α≥0,ρ1≥ 0,ρ2≥0};

Derivative[m1_,m2_,m3_,m4_][R][i_,j_,k_,l_]:=D[Sqrt[2*s],{i,m1},{j,m2},{k,m3},{l,m4}]/.rsrule//Simplify;
Derivative[1,1,0,0][S][i_,j_,k_,l_]:=(Subscript[δ, ij]);
Derivative[1,0,1,0][S][i_,j_,k_,l_]:=(Subscript[δ, ik]);
Derivative[1,0,0,1][S][i_,j_,k_,l_]:=(Subscript[δ, il]);
Derivative[0,1,1,0][S][i_,j_,k_,l_]:=(Subscript[δ, jk]);
Derivative[0,1,0,1][S][i_,j_,k_,l_]:=(Subscript[δ, jl]);
Derivative[0,0,1,1][S][i_,j_,k_,l_]:=(Subscript[δ, kl]);
Derivative[m1_,m2_,m3_,m4_][(Subscript[δ, ij])][i,j,k,l]:=0;
Derivative[m1_,m2_,m3_,m4_][(Subscript[δ, ik])][i,j,k,l]:=0;
Derivative[m1_,m2_,m3_,m4_][(Subscript[δ, il])][i,j,k,l]:=0;
Derivative[m1_,m2_,m3_,m4_][(Subscript[δ, jk])][i,j,k,l]:=0;
Derivative[m1_,m2_,m3_,m4_][(Subscript[δ, jl])][i,j,k,l]:=0;
Derivative[m1_,m2_,m3_,m4_][(Subscript[δ, kl])][i,j,k,l]:=0;

g={{1,0,0,0},{0,1,0,0},{0,0,1,0},{0,0,0,-1}};

del[n_,v_,A_]:=Switch[n,1,D[A,v],2,D[A,v],3,D[A,v],4,D[A,t]];

G=Series[1/(8*Pi^2)*(κ/r)*Sinh[κ*r]/(Cosh[κ*r]-Cosh[κ*t]),{κ,0,0}]//Normal//Expand

G1000[n1_]:=del[n1,i,G];
G0100[n2_]:=del[n2,j,G];
G0010[n3_]:=del[n3,k,G];
G0001[n4_]:=del[n4,l,G];
G1100[n1_,n2_]:=del[n2,j,G1000[n1]];
G1010[n1_,n3_]:=del[n3,k,G1000[n1]];
G1001[n1_,n4_]:=del[n4,l,G1000[n1]];
G0110[n2_,n3_]:=del[n3,k,G0100[n2]];
G0101[n2_,n4_]:=del[n4,l,G0100[n2]];
G0011[n3_,n4_]:=del[n4,l,G0010[n3]];
G1110[n1_,n2_,n3_]:=del[n3,k,G1100[n1,n2]];
G1101[n1_,n2_,n4_]:=del[n4,l,G1100[n1,n2]];
G1011[n1_,n3_,n4_]:=del[n4,l,G1010[n1,n3]];
G0111[n2_,n3_,n4_]:=del[n4,l,G0110[n2,n3]];
G1111[n1_,n2_,n3_,n4_]:=del[n4,l,G1110[n1,n2,n3]];

N4=Table[0,{n,10}];
N2=Table[0,{n,11},{n1,4},{n2,4}];
N2p=Table[0,{n,11},{n3,4},{n4,4}];
N0=Table[0,{n,13},{n1,4},{n2,4},{n3,4},{n4,4}];
NKcomp=Table[0,{n1,4},{n2,4},{n3,4},{n4,4}];

delrule={(Subscript[δ, ij])->If[n1==n2,1,0],(Subscript[δ, ik])->If[n1==n3,1,0],(Subscript[δ, il])->If[n1==n4,1,0],(Subscript[δ, jk])->If[n2==n3,1,0],(Subscript[δ, jl])->If[n2==n4,1,0],(Subscript[δ, kl])->If[n3==n4,1,0]};
srule={(Subscript[s, i])->Switch[n1,1,(Subscript[s, x]),2,(Subscript[s, y]),3,(Subscript[s, z]),4,0],(Subscript[s, j])->Switch[n2,1,(Subscript[s, x]),2,(Subscript[s, y]),3,(Subscript[s, z]),4,0],(Subscript[s, k])->Switch[n3,1,(Subscript[s, x]),2,(Subscript[s, y]),3,(Subscript[s, z]),4,0],(Subscript[s, l])->Switch[n4,1,(Subscript[s, x]),2,(Subscript[s, y]),3,(Subscript[s, z]),4,0]};
s1rule={(Subscript[s, i])->Switch[n1,1,(Subscript[s, x]),2,(Subscript[s, y]),3,(Subscript[s, z]),4,0],(Subscript[s, j])->Switch[n2,1,(Subscript[s, x]),2,(Subscript[s, y]),3,(Subscript[s, z]),4,0]};
s2rule={(Subscript[s, k])->Switch[n3,1,(Subscript[s, x]),2,(Subscript[s, y]),3,(Subscript[s, z]),4,0],(Subscript[s, l])->Switch[n4,1,(Subscript[s, x]),2,(Subscript[s, y]),3,(Subscript[s, z]),4,0]};
scrule={(Subscript[s, i])->Switch[n1,1,x,2,y,3,z,4,0],(Subscript[s, j])->Switch[n2,1,x,2,y,3,z,4,0],(Subscript[s, k])->Switch[n3,1,x,2,y,3,z,4,0],(Subscript[s, l])->Switch[n4,1,x,2,y,3,z,4,0]};
sc1rule={(Subscript[s, i])->Switch[n1,1,x,2,y,3,z,4,0],(Subscript[s, j])->Switch[n2,1,x,2,y,3,z,4,0]};
sc2rule={(Subscript[s, k])->Switch[n3,1,x,2,y,3,z,4,0],(Subscript[s, l])->Switch[n4,1,x,2,y,3,z,4,0]};
sfrule={(Subscript[s, x])->x,(Subscript[s, y])->y, (Subscript[s, z])->z};
coordrule={(Subscript[s, x])->Sqrt[r^2-(Subscript[s, y])^2-(Subscript[s, z])^2]};
coord2rule={Sqrt[r^2-(Subscript[s, y])^2-(Subscript[s, z])^2]->(Subscript[s, x])};

N4[[1]]=2*Sum[g[[n1,n2]]*g[[n3,n4]]*G1010[n1,n3]*G0101[n2,n4]/.srule/.delrule,{n1,4},{n2,4},{n3,4},{n4,4}]/.coordrule//Expand

N2[[1]]=Table[-8*Sum[g[[n3,n4]]*G1010[n1,n3]*G0101[n2,n4]/.sc1rule/.s2rule/.delrule/.coordrule,{n3,4},{n4,4}]//Expand,{n1,4},{n2,4}]/.coord2rule/.sfrule//Expand

N2p[[1]]=Table[-8*Sum[g[[n1,n2]]*G1010[n1,n3]*G0101[n2,n4]/.s1rule/.sc2rule/.delrule/.coordrule,{n1,4},{n2,4}]//Expand,{n3,4},{n4,4}]/.coord2rule/.sfrule//Expand

N2[[4]]=Table[4*Sum[g[[n3,n4]]*G0010[n3]*G1101[n1,n2,n4]/.sc1rule/.s2rule/.delrule/.coordrule,{n3,4},{n4,4}]//Expand,{n1,4},{n2,4}]/.coord2rule/.sfrule//Expand

N2p[[4]]=Table[4*Sum[g[[n1,n2]]*G1000[n1]*G0111[n2,n3,n4]/.s1rule/.sc2rule/.delrule/.coordrule,{n1,4},{n2,4}]//Expand,{n3,4},{n4,4}]/.coord2rule/.sfrule//Expand

N0[[1]]=Table[4*G0110[n2,n3]*G1001[n1,n4]/.srule/.delrule/.coordrule//Expand,{n1,4},{n2,4},{n3,4},{n4,4}]/.coord2rule/.sfrule//Expand

N0[[2]]=Table[4*G1010[n1,n3]*G0101[n2,n4]/.srule/.delrule/.coordrule//Expand,{n1,4},{n2,4},{n3,4},{n4,4}]/.coord2rule/.sfrule//Expand

N0[[3]]=Table[G1100[n1,n2]*G0011[n3,n4]/.srule/.delrule/.coordrule//Expand,{n1,4},{n2,4},{n3,4},{n4,4}]/.coord2rule/.sfrule//Expand

N0[[4]]=Table[G*G1111[n1,n2,n3,n4]/.srule/.delrule/.coordrule//Expand,{n1,4},{n2,4},{n3,4},{n4,4}]/.coord2rule/.sfrule//Expand

N0[[5]]=Table[-2*G0100[n2]*G1011[n1,n3,n4]/.srule/.delrule/.coordrule//Expand,{n1,4},{n2,4},{n3,4},{n4,4}]/.coord2rule/.sfrule//Expand

N0[[6]]=Table[-2*G1000[n1]*G0111[n2,n3,n4]/.srule/.delrule/.coordrule//Expand,{n1,4},{n2,4},{n3,4},{n4,4}]/.coord2rule/.sfrule//Expand

N0[[7]]=Table[-2*G0001[n4]*G1110[n1,n2,n3]/.srule/.delrule/.coordrule//Expand,{n1,4},{n2,4},{n3,4},{n4,4}]/.coord2rule/.sfrule//Expand

N0[[8]]=Table[-2*G0010[n3]*G1101[n1,n2,n4]/.srule/.delrule/.coordrule//Expand,{n1,4},{n2,4},{n3,4},{n4,4}]/.coord2rule/.sfrule//Expand

NKcomp=Table[(1/72*Sum[N0[[m1,n1,n2,n3,n4]],{m1,13}]+1/288*g[[n1,n2]]*Sum[N2p[[m2,n3,n4]],{m2,11}]+1/288*g[[n3,n4]]*Sum[N2[[m3,n1,n2]],{m3,11}]+1/288*g[[n1,n2]]*g[[n3,n4]]*Sum[N4[[m4]],{m4,10}])//Expand,{n1,4},{n2,4},{n3,4},{n4,4}]

NKcomp[[4,4,4,4]]//Expand

deltarule={t->t1-t2,x->x1-x2, y->y1-y2,z->z1-z2};

(*Arule={α^2-ρ1^2-> A1^2,α^2-ρ2^2->A2^2}
A2rule={A1-> Sqrt[α^2-ρ1^2],A2->Sqrt[α^2-ρ2^2]}
A3rule={ρ1-> Sqrt[α^2-A1^2],ρ2->Sqrt[α^2-A2^2]}*)

z1m[x_,y_,z_,t_]:=x;
z2m[x_,y_,z_,t_]:=y;
z3m[x_,y_,z_,t_]:=z;
z4m[x_,y_,z_,t_]:=t;

z1r[ξ_,y_,z_,η_]:=ξ*Cosh[α*η];
z2r[ξ_,y_,z_,η_]:=y;
z3r[ξ_,y_,z_,η_]:=z;
z4r[ξ_,y_,z_,η_]:=ξ*Sinh[α*η];

T1[A_,B_]:=Solve[{z1m[A[[1]],A[[2]],A[[3]],A[[4]]]==z1r[B[[1]],B[[2]],B[[3]],B[[4]]],z2m[A[[1]],A[[2]],A[[3]],A[[4]]]==z2r[B[[1]],B[[2]],B[[3]],B[[4]]],z3m[A[[1]],A[[2]],A[[3]],A[[4]]]==z3r[B[[1]],B[[2]],B[[3]],B[[4]]],z4m[A[[1]],A[[2]],A[[3]],A[[4]]]==z4r[B[[1]],B[[2]],B[[3]],B[[4]]]},A][[1]]

m1={x1,y1,z1,t1};
m2={x2,y2,z2,t2};
r1={ξ1,Y1,Z1,η1};
r2={ξ2,Y2,Z2,η2};

Vs[A_,B_]:=A/.T1[A,B]

V1=Vs[m1,r1]//Simplify
V2=Vs[m2,r2]//Simplify

rindlerrule={m1[[1]]-> V1[[1]],m1[[2]]-> V1[[2]],m1[[3]]-> V1[[3]],m1[[4]]-> V1[[4]],m2[[1]]-> V2[[1]],m2[[2]]-> V2[[2]],m2[[3]]-> V2[[3]],m2[[4]]-> V2[[4]]};

rrule={r->Sqrt[x^2+y^2+z^2/.deltarule/.rindlerrule//Expand//Simplify]};

Js[A_,B_]:=Table[D[Vs[A,B][[i]],B[[j]]],{i,4},{j,4}]

J1=Js[m1,r1]//Simplify
J2=Js[m2,r2]//Simplify

J1//Simplify//MatrixForm

gm1={{1,0,0,0},{0,1,0,0},{0,0,1,0},{0,0,0,-1}};

gm2={{1,0,0,0},{0,1,0,0},{0,0,1,0},{0,0,0,-1}};

gr1=Table[Sum[gm1[[a1,a2]]*J1[[a1,b1]]*J1[[a2,b2]]/.rindlerrule,{a1,4},{a2,4}],{b1,4},{b2,4}]//Simplify;
gr2=Table[Sum[gm2[[a1,a2]]*J2[[a1,b1]]*J2[[a2,b2]]/.rindlerrule,{a1,4},{a2,4}],{b1,4},{b2,4}]//Simplify;

gr2//Simplify//MatrixForm

(*NKcomp[[4,4,4,4]]/.rrule/.Arule/.deltarule/.staticrule//Together*)

NKcomp2=Table[NKcomp[[n1,n2,n3,n4]]/.rrule/.deltarule/.rindlerrule//Expand,{n1,4},{n2,4},{n3,4},{n4,4}];

cmp={4,4,4,4};NKrindler=Sum[NKcomp2[[n1,n2,n3,n4]]*J1[[n1,cmp[[1]]]]*J1[[n2,cmp[[2]]]]*J2[[n3,cmp[[3]]]]*J2[[n4,cmp[[4]]]],{n1,4},{n2,4},{n3,4},{n4,4}]//Expand

NKr1=NKrindler/.{Y1->0,Y2->0,Z1->0,Z2->0}//Expand

NKr2=NKr1//Simplify//Expand

NKr3=NKr2/.{η1-η2->η}//Simplify//Expand

NKr4=NKr3*(((((ξ1)^2)+((ξ2)^2)-2 ξ1 ξ2 Cosh[α η]))^6)/.{α->1}//Simplify

simp1rule={Cosh[η]->V,Cosh[2η]->2*V^2-1};

Solve[{X==ξ1^2+ξ2^2,Y==ξ1*ξ2/2},{ξ1,ξ2}]

simp2rule=Solve[{X==ξ1^2+ξ2^2,Y==2*ξ1*ξ2},{ξ1,ξ2}][[2]]

NKr5=NKr4/.simp1rule/.simp2rule/.{V-> (X+d)/Y}//Simplify

simp3rule={X->Y}

NKr6=NKr5/d^6*8/.simp3rule/.{Y->2*ξ1*ξ2}//Simplify

TeXForm[96*Pi^4*NKr4]