Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement covering product in convolution module #14928

Merged
merged 2 commits into from Jul 18, 2018

Conversation

Projects
None yet
2 participants
@sidhantnagpal
Copy link
Member

sidhantnagpal commented Jul 16, 2018

Brief description of what is fixed or changed

Use Möbius Transform for calculating covering_product (returns list of sum of products of elements grouped by bitwise OR of the corresponding sequence indices).
Usage for the same is:

>>> from sympy import symbols, covering_product
>>> u, v, x, y, z = symbols('u v x y z')

>>> covering_product([u, v], [x, y])
[u*x, u*y + v*x + v*y]

>>> covering_product([u, v, x], [y, z])
[u*y, u*z + v*y + v*z, x*y, x*z]

Other comments


def covering_product(a, b):
"""
Returns the covering product of given sequences.

This comment has been minimized.

@jksuom

jksuom Jul 17, 2018

Member

Maybe a blank line should be added after this. I don't know how important it is but PEP 257 says

Multi-line docstrings consist of a summary line just like a one-line docstring, followed by a blank line, followed by a more elaborate description. The summary line may be used by automatic indexing tools; it is important that it fits on one line and is separated from the rest of the docstring by a blank line. The summary line may be on the same line as the opening quotes or on the next line.

@jksuom

This comment has been minimized.

Copy link
Member

jksuom commented Jul 18, 2018

Thanks, this is ready.

@jksuom jksuom merged commit 1531049 into sympy:master Jul 18, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.