This week I started working on adding Möbius Transform to the discrete module using Yate’s DP (Dynamic Programming) method for implementation as part of PR #14853. The proposed transforms are part of sympy.discrete.transforms module.

After discussing with Kalevi, the methods implementing this transform were added with appropriate names. The keyword subset is used as a boolean to choose whether enumeration is done over subsets or supersets. The usage for the transform is:

>>> from sympy import mobius_transform, inverse_mobius_transform
>>> seq = list(symbols('w x y z'))
>>> mobius_transform(seq)
[w, w + x, w + y, w + x + y + z]
>>> inverse_mobius_transform(_)
[w, x, y, z]
>>> inverse_mobius_transform(seq, subset=False)
[w - x - y + z, x - z, y - z, z]
>>> mobius_transform(_, subset=False)
[w, x, y, z]

The PR was merged successfully, after inclusion of docstring and unit tests for the transform.

Looking forward to another exciting week.

Published: 06 July 2018