(*The first entry in the basis, see below, is the irreducible numerator*)

(* diagram comes from the LiteRed package*)

(*generate a start file*)

SetDirectory[NotebookDirectory[]<>"../"];
Get["FIRE6.m"];
Internal= {l,r};
External= {p,q};
Propagators=(- Power[##,2])&/@{l-r,l,r,p-l,q-r,p-l+r,q-r+l};
Replacements= {p^2->0,q^2->0,p q->-1/2};
PrepareIBP[];
Prepare[AutoDetectRestrictions->True,LI->True];
SaveStart["examples/v2"];

Quit

(* reduction purely by FIRE *)

SetDirectory[NotebookDirectory[]<>"../"];
Get["FIRE6.m"];
LoadStart["examples/v2",2];
Burn[]

F[2,{-1,1,1,1,1,1,1}]

(* master integrals ... too many *)

MasterIntegrals[]

(*finding relations between them*)

list=MasterIntegrals[];
Internal= {l,r};
External= {p,q};
Propagators= Power[##,2]&/@{l-r,l,r,p-l,q-r,p-l+r,q-r+l};
Replacements= {p^2->0,q^2->0,p q->-1/2};
WriteRules[list,"examples/v2"];

(*we are left with 3*)

Union@@((G@@@list)/.FindRules[list])

Quit

(*reduction with rules for masters*)

SetDirectory[NotebookDirectory[]<>"../"];
Get["FIRE6.m"];
LoadStart["examples/v2",2];
Burn[];
LoadRules["examples/v2",2];

F[2,{-1,1,1,1,1,1,1}]

Quit

(*generate LiteRed bases*)

SetDirectory[NotebookDirectory[]<>"../"];
SetDirectory["extra/LiteRed/Setup/"];
Get["LiteRed.m"];
SetDirectory["../../../"];
Get["FIRE6.m"];
Internal= {l,r};
External= {p,q};
Propagators= (-Power[##,2])&/@{l-r,l,r,p-l,q-r,p-l+r,q-r+l};
Replacements= {p^2->0,q^2->0,p q->-1/2};
CreateNewBasis[v2,Directory->"temp/v2.dir"]

GenerateIBP[v2];
AnalyzeSectors[v2,{0,__}];
FindSymmetries[v2];
SetOptions[SolvejSector,Depth->0];
SolvejSector/@UniqueSectors[v2];
DiskSave[v2];

Quit

(*reduction with LiteRed rules*)

SetDirectory[NotebookDirectory[]<>"../"];
Get["FIRE6.m"];
LoadStart["examples/v2",2];
LoadLRules["temp/v2.dir",2];
Burn[]

F[2,{-1,1,1,1,1,1,1}]

Quit

(*we transform the LiteRed rules into a file for c++ FIRE*)

SetDirectory[NotebookDirectory[]<>"../"];
Get["FIRE6.m"];
LoadStart["examples/v2"]; (*pay attention! there is no number as second argument here*)

TransformRules["temp/v2.dir","examples/v2.lbases",2];

SaveSBases["examples/v2"];

(*now run examples/v2l for the reduction with the use of the converted file*)