This is a Mathematica code to convert operator product expansions (OPEs) to commutation relations of their modes, in 2 dimensional conformal field theory.
The evaluation is performed using the standard procedure of expressing the operators in terms of their Laurent modes and then performing the relevant contour integrations.
An example for the W3 algebra is provided.