Great, thank you! This - almost - provides a performance test: ``` sage: K.<a>=NumberField(x^2-3) sage: O=K.ring_of_integers() sage: b=O(a-2) sage: R.<z> = O[] sage: f = O(2*a + 4)*z^2 sage: f.gcd(f+1) ... NotImplementedError: Maximal Order generated by a in Number Field in a with defining polynomial x^2 - 3 does not provide a gcd implementation for univariate polynomials sage: O._refine_category_(UniqueFactorizationDomains()) sage: f.gcd(f+1) ... File ~/sage/src/sage/rings/polynomial/polynomial_element.pyx:5373, in sage.rings.polynomial.polynomial_element.Polynomial.pseudo_quo_rem() 5371 diffdeg = R.degree() - B.degree() 5372 Q = d*Q + self._parent(c).shift(diffdeg) -> 5373 R = d*R - c*B.shift(diffdeg) 5374 e -= 1 5375 ... TypeError: unsupported operand parent(s) for *: 'Number Field in a with defining polynomial x^2 - 3' and 'Univariate Polynomial Ring in z over Maximal Order generated by a in Number Field in a with defining polynomial x^2 - 3' ```
:-( Martin On Thursday, 12 December 2024 at 17:46:21 UTC+1 Nils Bruin wrote: > Quadratic rings perhaps? A fair number of those are UFD: > > sage: K.<a>=NumberField(x^2-3) > sage: O=K.ring_of_integers() > sage: b=O(a-2) > sage: %timeit b.is_unit() > 664 ns ± 4.24 ns per loop (mean ± std. dev. of 7 runs, 1,000,000 loops > each) > sage: %timeit b.is_one() > 55.8 ns ± 0.214 ns per loop (mean ± std. dev. of 7 runs, 10,000,000 loops > each) > > On Thursday, 12 December 2024 at 05:50:14 UTC-8 Marc Mezzarobba wrote: > >> Marc Mezzarobba wrote: >> >> for testing purposes I am in need of an UFD in Sage for which is_unit >> >> is significantly slower than is_one. >> > >> > Matrices? >> >> Woops, I read “a ring” insteand of “an ufd”... >> >> -- >> Marc >> >> -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To view this discussion visit https://groups.google.com/d/msgid/sage-devel/4f7760a0-a6b3-4459-b64f-a08060929c93n%40googlegroups.com.