Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gh-35643: Avoid redundant computations in finite field .conjugate() m…
…ethod ### 📚 Description The previous implementation was factoring the order (characteristic^degree) to obtain the field degree. The methods `cardinality()` and `order()` are really defined as `return self.characteristic()**self.degree()`. Sage 10rc3 ``` sage: p = next_prime(2**160) sage: K = GF((p,2)) sage: x = K.random_element() sage: %timeit x.conjugate() 13.2 ms ± 77.8 µs per loop (mean ± std. dev. of 7 runs, 100 loops each) ``` After patch: ``` sage: %timeit x.conjugate() 5.01 µs ± 15.5 ns per loop (mean ± std. dev. of 7 runs, 100,000 loops each) ``` ### 📝 Checklist - [x] The title is concise, informative, and self-explanatory. - [x] The description explains in detail what this PR is about. - [ ] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation accordingly. ### ⌛ Dependencies None URL: #35643 Reported by: Rémy Oudompheng Reviewer(s): Lorenz Panny
- Loading branch information