Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sagemathgh-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: sagemath#37367 Reported by: Lorenz Panny Reviewer(s): Giacomo Pope
- Loading branch information