You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
gh-37367: improve random sampling of quotient-ring elements
Currently, random sampling in generic quotient rings is restricted to a
very small (and special) subset of the elements:
```sage
sage: R.<x,y> = QQ[]
sage: S = R.quotient([x^3, y^2])
sage: {S.random_element() for _ in range(999)}
{-2, -1, 0, 1, 2}
```
In this patch we add an implementation of `.random_element()` which
simply calls the `.random_element()` method of the cover ring and maps
the result to the quotient. This is still far from perfect for many
kinds of quotient rings, but it's definitely an improvement compared to
the current behavior.
URL: #37367
Reported by: Lorenz Panny
Reviewer(s): Giacomo Pope
0 commit comments