Simple Wick's Theorem tool

Instructions

Input is product of operators a_{idx} for annihilator and c_{idx} for creator. No support for "quasi"-operators (a creation operator on an index which is always filled, for instance). Disjoint indices should be a semi-colon separated list of tuples "(i,j);(k,l), ...". Used only for the purpose of cleaning up Dirac deltas.
Warning: this has only been tested on simple inputs, as opposed to the Python version underwent many rounds of testing against known results.







Further Reading

Sloppily transpiled from some python code written for a paper that used some wick's theorem. Here for posterity and in case someone else might use it.
Writeup on wick's theorem at some point. For now look here: https://en.wikipedia.org/wiki/Second_quantization#Creation_and_annihilation_operators and here https://en.wikipedia.org/wiki/Normal_order.
More iffy on the bosonic results since I did not test it on those.