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ify[((KL2[ϕ,θ,ρ,τ,ω,c,ℏ,Py,0])/(KL2Corbitt[ϕ,θ,ρ,τ,ω,c,ℏ,Py,0]))]

KOptNotebook[ϕ_,θ_,ρ_,τ_,ω_,c_,ℏ_,Py_,θy_]=Simplify[-2 (ω/(c^2))Dy[Py,θy].(IdentityMatrix[2]+ρ Exp[2 I ϕ]RotationMatrix[2θ]).Inverse[IdentityMatrix[2]-ρ Exp[2 I ϕ]RotationMatrix[2θ]].DyStar[Py,θy]]

FullSimplify[((KOpt[ϕ,θ,ρ,τ,ω,c,ℏ,Py,θy])/(KOptNotebook[ϕ,θ,ρ,τ,ω,c,ℏ,Py,θy]))]

FullSimplify[Series[KOpt[ϕ,θ,Sqrt[1-(τ^2)],τ,ω,c,ℏ,Py,θy],{ϕ,0,1},{θ,0,1},{τ,0,1}]]

(* End Mirror Not Fully Reflective *)

L[l1_,l2_]:={l1, l2};
Y[y1_,y2_]={y1,y2};
W[w1_,w2_]={w1,w2};
X[x1_,x2_]={x1,x2};
Z[z1_,z2_]={z1,z2};
T[t1_,t2_]={t1,t2};
V1[v11_,v12_]={v11,v12};
Dy[Py_,θy_]:=Sqrt[2Py]{Cos[θy],Sin[θy]};
DyStar[Py_,θy_]:=Sqrt[2Py]{Sin[θy],-Cos[θy]}
Sys[ϕ_,θ_,x_,l1_,l2_,ρ1_,τ1_,ρ2_, τ2_,λ2_,ω_,c_,ℏ_,Py_,θy_,w1_,w2_,x1_,x2_,y1_,y2_,z1_,z2_,t1_,t2_,v11_,v12_,FRP_
]:={
Y[y1,y2]==Exp[I ϕ]RotationMatrix[θ].W[w1,w2],
X[x1,x2]==Exp[I ϕ]RotationMatrix[θ].Z[z1,z2],
W[w1,w2]==-ρ1 X[x1,x2]+τ1 L[l1,l2],
T[t1,t2]==τ2 Y[y1,y2]+ρ2 V1[v11,v12],
Z[z1,z2]==-Y[y1,y2]-((2ω x ρ2)/(c Sqrt[ℏ  ω])) DyStar[Py,θy],
FRP==-Sqrt[((ℏ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