(* ::Package:: *)

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

(* ::Input::Initialization:: *)
SetDirectory["C:\\drorbn\\AcademicPensieve\\Projects\\Semi-Seifert"];
Once[<<KnotTheory`]


(* ::Input::Initialization:: *)
CF[\[Omega]_. \[ScriptCapitalE]_\[DoubleStruckCapitalE]]:=CF[\[Omega]]CF/@\[ScriptCapitalE];
CF[\[ScriptCapitalE]_List]:=CF/@\[ScriptCapitalE];
CF[q_]:=Expand@Collect[q,\[Epsilon]|Subscript[(p|x|\[Pi]|\[Xi]), _],F]/.F->Factor;


(* ::Input::Initialization:: *)
\[DoubleStruckCapitalE]/:\[DoubleStruckCapitalE][A_]\[DoubleStruckCapitalE][B_]:=\[DoubleStruckCapitalE][A+B];


(* ::Input::Initialization:: *)
$\[Pi]=Identity; 


(* ::Input::Initialization:: *)
Unprotect[Integrate]; 
\[Integral]\[Omega]_. \[DoubleStruckCapitalE][L_]\[DifferentialD](vs_List):=Module[{n,L0,Q,\[CapitalDelta],G,Z0,Z,\[Lambda],DZ,DDZ,FZ,a,b},
n=Length@vs; L0=L/.\[Epsilon]->0;
Q=Table[(-\!\(
\*SubscriptBox[\(\[PartialD]\), \(vs[[\(a\)\(]\)], vs[[\(b\)\(]\)]\)]L0\))/.Thread[vs->0]/.Subscript[(p|x), __]->0,{a,n},{b,n}];
If[(\[CapitalDelta]=Det[Q])==0,Return@"\!\(\*
StyleBox[\"Degenerate\",\nFontColor->RGBColor[1, 0, 0]]\)\!\(\*
StyleBox[\" \",\nFontColor->RGBColor[1, 0, 0]]\)\!\(\*
StyleBox[\"Q\",\nFontColor->RGBColor[1, 0, 0]]\)\!\(\*
StyleBox[\"!\",\nFontColor->RGBColor[1, 0, 0]]\)"];
Z=Z0=CF@$\[Pi][L+vs . Q . vs/2]; G=Inverse[Q];
FixedPoint[(DZ=Table[\!\(
\*SubscriptBox[\(\[PartialD]\), \(v\)]Z\),{v,vs}];
DDZ=Table[\!\(
\*SubscriptBox[\(\[PartialD]\), \(u\)]DZ\),{u,vs}];
FZ=Sum[G[[a,b]](DDZ[[a,b]]+DZ[[a]]DZ[[b]]),{a,n},{b,n}]/2;
Z=CF[Z0+\!\(
\*SubsuperscriptBox[\(\[Integral]\), \(0\), \(\[Lambda]\)]\($\[Pi][FZ]\ \[DifferentialD]\[Lambda]\)\)])&,Z];
PowerExpand@Factor[\[Omega] \[CapitalDelta]^(-1/2)]\[DoubleStruckCapitalE][CF[Z/.\[Lambda]->1/.Thread[vs->0]]]];
Protect[Integrate];


(* ::Input::Initialization:: *)
SetAttributes[{B,\[Sigma]}, Orderless];
CF[b_B]:=RotateLeft[#,First@Ordering[#]-1]&/@DeleteCases[b,{}]


(* ::Input::Initialization:: *)
CF[Subscript[\[CapitalSigma], b_][\[Sigma]_,q_]]:=Subscript[\[CapitalSigma], CF[b]][\[Sigma],CF[q]];


(* ::Input::Initialization:: *)
SSA[c:X[i_,j_,k_,l_]]:=SSA@If[PositiveQ[c],Subscript[X, -i,j,k,-l],Subscript[\!\(\*OverscriptBox[\(X\), \(_\)]\), -j,k,l,-i]];
SSA[Subscript[(c:X|\!\(\*OverscriptBox[\(X\), \(_\)]\)), i_,j_,k_,l_]]:=Module[{m},
m=If[c===X,\!\(\*
TagBox[
RowBox[{"(", "", GridBox[{
{
RowBox[{"-", "1"}], 
RowBox[{"-", "1"}], "2", "0"},
{"0", "0", "0", "0"},
{"0", "1", 
RowBox[{"-", "1"}], "0"},
{"1", "0", 
RowBox[{"-", "1"}], "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$]]]\),\!\(\*
TagBox[
RowBox[{"(", "", GridBox[{
{"1", 
RowBox[{"-", "1"}], "0", "0"},
{"0", "0", "0", "0"},
{
RowBox[{"-", "2"}], "1", "1", "0"},
{"1", "0", 
RowBox[{"-", "1"}], "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$]]]\)];
CF@Subscript[\[CapitalSigma], B[{i,j,k,l}]][\[Sigma][i->j,l->k],\[DoubleStruckCapitalE][{Subscript[p, i],Subscript[p, j],Subscript[p, k],Subscript[p, l]} . (t m-m\[Transpose]/t) . {Subscript[x, i],Subscript[x, j],Subscript[x, k],Subscript[x, l]}]]]


(* ::Input::Initialization:: *)
SSA@Subscript[P, i_,j_]:=CF@Subscript[\[CapitalSigma], B[{i,j}]][\[Sigma][i->j],\[DoubleStruckCapitalE][0]]


(* ::Input::Initialization:: *)
Subscript[\[CapitalSigma], b1_][\[Sigma]1_,\[ScriptCapitalE]1_]\[CirclePlus]Subscript[\[CapitalSigma], b2_][\[Sigma]2_,\[ScriptCapitalE]2_]^:=CF@Subscript[\[CapitalSigma], Join[b1,b2]][\[Sigma]1\[Union]\[Sigma]2,\[ScriptCapitalE]1 \[ScriptCapitalE]2];


(* ::Input::Initialization:: *)
Subscript[GT, i_,j_]@Subscript[\[CapitalSigma], B[{li___,i_,ri___},{lj___,j_,rj___},bs___]][\[Sigma]_,\[ScriptCapitalE]_]:=CF@Subscript[\[CapitalSigma], B[{ri,li,j,rj,lj,i},bs]][\[Sigma],\[ScriptCapitalE]/.{Subscript[p, i|j]->Subscript[p, i]+Subscript[p, j],Subscript[x, i|j]->Subscript[x, i]+Subscript[x, j]}]


(* ::Input::Initialization:: *)
Subscript[Cordon, i_]@Subscript[\[CapitalSigma], B[{li___,i_,ri___},bs___]][\[Sigma]_,PQ[\[ScriptCapitalC]_,q_]]:=Module[{\[Phi]=\!\(
\*SubscriptBox[\(\[PartialD]\), 
SubscriptBox[\(\[Gamma]\), \(i\)]]\[ScriptCapitalC]\),\[Lambda]=\!\(
\*SubscriptBox[\(\[PartialD]\), \(
\*SubscriptBox[
OverscriptBox[\(\[Gamma]\), \(_\)], \(i\)], 
\*SubscriptBox[\(\[Gamma]\), \(i\)]\)]q\),n\[Sigma]=\[Sigma],n\[ScriptCapitalC],nq,p},
{p}=FirstPosition[(#=!=0)&/@\[Phi],True,{0}];
{n\[ScriptCapitalC],nq}=Which[
p>0, {\[ScriptCapitalC],q}/.SuperPlus[(Subscript[\[Gamma], i]->-\[ScriptCapitalC][[p]]/\[Phi][[p]])]/.SuperPlus[(Subscript[\[Gamma], i]->0)],
\[Lambda]=!=0,(n\[Sigma]+=sign[\[Lambda]];{\[ScriptCapitalC],q/.SuperPlus[(Subscript[\[Gamma], i]->-(\!\(
\*SubscriptBox[\(\[PartialD]\), 
SubscriptBox[
OverscriptBox[\(\[Gamma]\), \(_\)], \(i\)]]q\))/\[Lambda])]/.SuperPlus[(Subscript[\[Gamma], i]->0)]}),
\[Lambda]===0,{\[ScriptCapitalC]\[Union]{\!\(
\*SubscriptBox[\(\[PartialD]\), 
SubscriptBox[
OverscriptBox[\(\[Gamma]\), \(_\)], \(i\)]]q\)},q/.SuperPlus[(Subscript[\[Gamma], i]->0)]}];
CF@Subscript[\[CapitalSigma], B[Most@{ri,li},bs]][n\[Sigma],PQ[n\[ScriptCapitalC],nq]/.SuperPlus[(Subscript[\[Gamma], Last@{ri,li}]->Subscript[\[Gamma], First@{ri,li}])]]  ]


(* ::Input::Initialization:: *)
Subscript[c, i_,j_]@t:Subscript[\[CapitalSigma], B[{li___,i_,ri___},{___,j_,___},___]][__]:=t//Subscript[GT, j,First@{ri,li}]//Subscript[Cordon, j]


(* ::Input::Initialization:: *)
Subscript[c, i_,j_]@t:Subscript[\[CapitalSigma], B[{___,i_,j_,___},___]][__]:=Subscript[Cordon, j]@t
Subscript[c, i_,j_]@t:Subscript[\[CapitalSigma], B[{j_,___,i_},___]][__]:=Subscript[Cordon, j]@t
Subscript[c, i_,j_]@t:Subscript[\[CapitalSigma], B[{___,j_,i_,___},___]][__]:=Subscript[Cordon, i]@t
Subscript[c, i_,j_]@t:Subscript[\[CapitalSigma], B[{i_,___,j_},___]][__]:=Subscript[Cordon, i]@t


(* ::Input::Initialization:: *)
mc[\[ScriptCapitalE]_]:=\[ScriptCapitalE]//.
t:Subscript[\[CapitalSigma], B[{___,i_,___},{___,j_,___},___]][__]|Subscript[\[CapitalSigma], B[{___,i_,j_,___},___]][__]|Subscript[\[CapitalSigma], B[{j_,___,i_},___]][__]/;i+j==0:>Subscript[c, i,j]@t
