By: Lucien Huber <im@lcnbr.ch>
move generation and tensor reduction into feynkit Finish the FeynKit ownership consolidation, add exact symmetry-aware tensor reduction through rank 20, expose the native PyO3 API, preserve named UFO couplings until explicit expansion, and keep GammaLoop integration confined to extension traits and finalized runtime conversion. User requests: The entire generation should live in feynkit. There can still be a final Feynkit graph to gammaloop graph if necessary , but I don't see why there should be two different models, Similarly for the cff. It is even okay if not all the rust side api that is necessary for gammaloop is exposed to python. IN general we want to drastically reduce code dedup and the necessity for adapters.. We own all the crates here, so it does not make sense to dedup so much implement the plan. To add methods from gammaloop using feynkit types, use an extension trait, don't wrap the type Tensor reduction is an important part of a QFT calculation. For the R operation, a tensor reduction is needed to make a tensor vacuum graph into a sum of scalar graphs. Write a tensor reducer as part of Feynkit. As input and output format it should support standards set by the rest of the ecosystem (likely spenso formatting of tensors). A goal is that it should easily reduce up to rank 12 and preferably up to rank 20. You can see the `vakint` source code for a Form implementation of tensor reduction. It uses some symmetries for the solving and it can exploit internal symmetries (projecting k^mu*k^nu means that mu and nu are internally exchangeable, and similarly if it is known that the projection will hit an external p^mu p^nu, that symmetry can be used as well). Apparently, there is a method by Collins (?) used in lattice QCD that speeds up solving the system, even having a closed form. Investigate that first. Make a plan and then implement it. Continue but I paused the goal as I want you to do a final polishing round, identifying the main important issues left and finishing what you were doing and then do one last clean commit+push and pause/stop there.