Skip to content

Clarify in docs that monoids are commutative and associative #469

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

Merged
merged 3 commits into from
Jun 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions docs/user_guide/operators.rst
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,12 @@ registered from numpy are located in ``graphblas.binary.numpy``.
Monoids
-------

Monoids extend the concept of a binary operator to require a single domain for all inputs and
the output. Monoids are also associative, so the order of the inputs does not matter. And finally,
monoids have a default identity such that ``A op identity == A``.
Monoids extend the concept of a binary operator to require a single domain for all inputs and the output.
Monoids are also associative so the order of operations does not matter
(for example, ``(a + b) + c == a + (b + c)``).
GraphBLAS primarily uses *commutative monoids* (for example, ``a + b == b + a``),
and all standard monoids in python-graphblas commute.
And finally, monoids have a default identity such that ``A op identity == A``.

Monoids are commonly for reductions, collapsing all elements down to a single value.

Expand Down