Skip to content
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

Allow more rings to be used with libsingular & rework signal detection system #39075

Merged
merged 18 commits into from
Dec 22, 2024

Conversation

user202729
Copy link
Contributor

@user202729 user202729 commented Dec 3, 2024

Somewhat related: #33319

Anyway, this allows many more rings to be used with libsingular. Previously it fallback to the expect interface.

It seems weird that both Sage and Singular has different types for GF(5) and Zmod(5), but okay.

📝 Checklist

  • The title is concise and informative.
  • 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 and checked the documentation preview.

⌛ Dependencies

@user202729 user202729 force-pushed the libsingular-more-rings branch from acfbf30 to 2e88a31 Compare December 3, 2024 16:57
@user202729 user202729 marked this pull request as draft December 3, 2024 17:09
Copy link

github-actions bot commented Dec 3, 2024

Documentation preview for this PR (built with commit 963dde6; changes) is ready! 🎉
This preview will update shortly after each push to this PR.


sage: P.<x,y,z> = PolynomialRing(Integers(2^32), order='lex')
sage: P(2^32-1)
4294967295
-1
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is harmless, but technically modifies the behavior. (New behavior is probably better though.)

@@ -4527,8 +4527,7 @@ def groebner_basis(self, algorithm='', deg_bound=None, mult_bound=None, prot=Fal
sage: R.<x,y,z> = PolynomialRing(Zmod(2233497349584))
sage: I = R.ideal([z*(x-3*y), 3^2*x^2-y*z, z^2+y^2])
sage: I.groebner_basis()
[2*z^4, y*z^2 + 81*z^3, 248166372176*z^3, 9*x^2 - y*z, y^2 + z^2, x*z +
2233497349581*y*z, 248166372176*y*z]
[2*z^4, y*z^2 + 81*z^3, 248166372176*z^3, 9*x^2 + 2233497349583*y*z, y^2 + z^2, x*z + 2233497349581*y*z, 248166372176*y*z]
Copy link
Contributor Author

@user202729 user202729 Dec 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This time around the new behavior is worse. Thoughts?

p/s. See also #39018

@user202729 user202729 marked this pull request as ready for review December 3, 2024 19:11
@user202729
Copy link
Contributor Author

user202729 commented Dec 4, 2024

Should be fixed now. I clean up the code:

  • if it's written this way, in the future if Singular decide to modify their code base to support some new function, Sage will support it out of the box.
  • also it's cleaner, because we don't need to check for error condition twice (once by Sage, then by Singular)

Looks like pycodestyle doesn't actually understand cdef as being equivalent to def but… irrelevant.

Side note: I don't think correct handling of ctrl-c work yet.

@user202729
Copy link
Contributor Author

user202729 commented Dec 5, 2024

Alright, ctrl-c should works properly now.

Nevertheless, note that most interruptibility tests in SageMath are not that useful — those which are useful must run >10 minutes if not interrupted; in other words, the tests with alarm() would still pass if the code stops only after 5 minutes of alarm raised.

In some cases, I delete checks like if count >= 20: sig_on() because I have shown that it's possible for "small" inputs to take a long time. Of course this leads to a slight performance degradation because sig_on()/sig_off() takes time, but I think we have no other choice.

Related: my write-up on sig_on() and sig_on_no_except(): https://gist.github.com/user202729/52b0c7134ea34f78a4416cd19e28e578

Let's see if the tests pass.

p/s there's no interrupt test for call_function yet. What is a SingularFunction that might take a long time?

@user202729 user202729 changed the title Allow more rings to be used with libsingular Allow more rings to be used with libsingular & rework signal detection system Dec 5, 2024
@user202729
Copy link
Contributor Author

user202729 commented Dec 5, 2024

The failure is

sage -t --long --warn-long 30.0 --random-seed=286735480429121101562228604801325644303 src/sage/rings/polynomial/polynomial_element.pyx  # Timed out

Looks irrelevant. Also I can't reproduce it locally.

On the other hand the Conda 3.11 exception is

Log
2024-12-05T02:30:31.3073845Z sage -t --warn-long 5.0 --random-seed=119114750932116172018756669544404103919 src/sage/rings/polynomial/plural.pyx
2024-12-05T02:30:31.3075340Z     SignalError in doctesting framework
2024-12-05T02:30:31.3138442Z **********************************************************************
2024-12-05T02:30:31.3139329Z 
2024-12-05T02:30:31.3139520Z Tests run before exception:
2024-12-05T02:30:31.3140013Z sage: A.<x,y,z> = FreeAlgebra(QQ, 3) ## line 50 ##
2024-12-05T02:30:31.3140639Z sage: P.<x,y,z> = A.g_algebra(relations={y*x:-x*y}, order = 'lex') ## line 51 ##
2024-12-05T02:30:31.3141203Z sage: P ## line 53 ##
2024-12-05T02:30:31.3141916Z Noncommutative Multivariate Polynomial Ring in x, y, z over Rational Field, nc-relations: {y*x: -x*y}
2024-12-05T02:30:31.3142763Z sage: y*x + 1/2 ## line 56 ##
2024-12-05T02:30:31.3143165Z -x*y + 1/2
2024-12-05T02:30:31.3143588Z sage: A.<x,y,z> = FreeAlgebra(GF(17), 3) ## line 59 ##
2024-12-05T02:30:31.3144289Z sage: P.<x,y,z> = A.g_algebra(relations={y*x:-x*y}, order = 'lex') ## line 60 ##
2024-12-05T02:30:31.3144940Z sage: P ## line 61 ##
2024-12-05T02:30:31.3145747Z Noncommutative Multivariate Polynomial Ring in x, y, z over Finite Field of size 17, nc-relations: {y*x: -x*y}
2024-12-05T02:30:31.3146636Z sage: y*x + 7 ## line 64 ##
2024-12-05T02:30:31.3147041Z -x*y + 7
2024-12-05T02:30:31.3147544Z sage: from sage.matrix.constructor import Matrix ## line 71 ##
2024-12-05T02:30:31.3148118Z sage: c = Matrix(3) ## line 72 ##
2024-12-05T02:30:31.3148829Z sage: c[0,1] = -2 ## line 73 ##
2024-12-05T02:30:31.3149243Z sage: c[0,2] = 1 ## line 74 ##
2024-12-05T02:30:31.3149636Z sage: c[1,2] = 1 ## line 75 ##
2024-12-05T02:30:31.3150008Z sage: d = Matrix(3) ## line 77 ##
2024-12-05T02:30:31.3150384Z sage: d[0, 1] = 17 ## line 78 ##
2024-12-05T02:30:31.3150780Z sage: P = QQ['x','y','z'] ## line 79 ##
2024-12-05T02:30:31.3151236Z sage: c = c.change_ring(P) ## line 80 ##
2024-12-05T02:30:31.3151690Z sage: d = d.change_ring(P) ## line 81 ##
2024-12-05T02:30:31.3152837Z sage: from sage.rings.polynomial.plural import NCPolynomialRing_plural ## line 83 ##
2024-12-05T02:30:31.3153838Z sage: R.<x,y,z> = NCPolynomialRing_plural(QQ, c = c, d = d, order=TermOrder('lex',3),category=Algebras(QQ)) ## line 84 ##
2024-12-05T02:30:31.3154620Z sage: R ## line 85 ##
2024-12-05T02:30:31.3155335Z Noncommutative Multivariate Polynomial Ring in x, y, z over Rational Field, nc-relations: {y*x: -2*x*y + 17}
2024-12-05T02:30:31.3156137Z sage: R.term_order() ## line 88 ##
2024-12-05T02:30:31.3156568Z Lexicographic term order
2024-12-05T02:30:31.3156940Z sage: a,b,c = R.gens() ## line 91 ##
2024-12-05T02:30:31.3157402Z sage: f = 57 * a^2*b + 43 * c + 1; f ## line 92 ##
2024-12-05T02:30:31.3158125Z 57*x^2*y + 43*z + 1
2024-12-05T02:30:31.3158509Z sage: A.<x,y,z> = FreeAlgebra(QQ, 3) ## line 97 ##
2024-12-05T02:30:31.3159110Z sage: P = A.g_algebra(relations={y*x:-x*y}, order = 'lex') ## line 98 ##
2024-12-05T02:30:31.3159739Z sage: TestSuite(P).run() ## line 99 ##
2024-12-05T02:30:31.3160220Z sage: loads(dumps(P)) is P ## line 100 ##
2024-12-05T02:30:31.3160658Z True
2024-12-05T02:30:31.3161013Z sage: A.<x,y,z> = FreeAlgebra(QQ, 3) ## line 103 ##
2024-12-05T02:30:31.3161652Z sage: P = A.g_algebra(relations={y*x:-x*y}, order = 'lex') ## line 104 ##
2024-12-05T02:30:31.3162250Z sage: P.is_commutative() ## line 105 ##
2024-12-05T02:30:31.3162698Z False
2024-12-05T02:30:31.3163067Z sage: R.<x,y,z> = FreeAlgebra(QQ, 3) ## line 108 ##
2024-12-05T02:30:31.3163680Z sage: P = R.g_algebra(relations={}, order='lex') ## line 109 ##
2024-12-05T02:30:31.3164271Z sage: P.is_commutative() ## line 110 ##
2024-12-05T02:30:31.3164700Z True
2024-12-05T02:30:31.3165212Z sage: sig_on_count() # check sig_on/off pairings (virtual doctest) ## line 112 ##
2024-12-05T02:30:31.3165883Z 0
2024-12-05T02:30:31.3166260Z sage: A.<x,y,z> = FreeAlgebra(QQ, 3) ## line 156 ##
2024-12-05T02:30:31.3166912Z sage: H = A.g_algebra({y*x:x*y-z, z*x:x*z+2*x, z*y:y*z-2*y}) ## line 157 ##
2024-12-05T02:30:31.3167363Z 
2024-12-05T02:30:31.3167536Z **********************************************************************
2024-12-05T02:30:31.3168044Z Traceback (most recent call last):
2024-12-05T02:30:31.3168663Z   File "parent.pyx", line 895, in sage.structure.parent.Parent.__call__
2024-12-05T02:30:31.3169772Z   File "coerce_dict.pyx", line 650, in sage.structure.coerce_dict.MonoDict.get
2024-12-05T02:30:31.3170611Z KeyError: Free Algebra on 3 generators (x, y, z) over Rational Field
2024-12-05T02:30:31.3171066Z 
2024-12-05T02:30:31.3171379Z During handling of the above exception, another exception occurred:
2024-12-05T02:30:31.3171853Z 
2024-12-05T02:30:31.3172022Z Traceback (most recent call last):
2024-12-05T02:30:31.3172724Z   File "parent.pyx", line 2501, in sage.structure.parent.Parent._internal_convert_map_from
2024-12-05T02:30:31.3173610Z   File "coerce_dict.pyx", line 650, in sage.structure.coerce_dict.MonoDict.get
2024-12-05T02:30:31.3174391Z KeyError: Free Algebra on 3 generators (x, y, z) over Rational Field
2024-12-05T02:30:31.3174841Z 
2024-12-05T02:30:31.3175150Z During handling of the above exception, another exception occurred:
2024-12-05T02:30:31.3175613Z 
2024-12-05T02:30:31.3175784Z Traceback (most recent call last):
2024-12-05T02:30:31.3176692Z   File "/usr/share/miniconda3/envs/sage/lib/python3.11/site-packages/sage/doctest/forker.py", line 2596, in __call__
2024-12-05T02:30:31.3177711Z     doctests, extras = self._run(runner, options, results)
2024-12-05T02:30:31.3178262Z                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-12-05T02:30:31.3179381Z   File "/usr/share/miniconda3/envs/sage/lib/python3.11/site-packages/sage/doctest/forker.py", line 2644, in _run
2024-12-05T02:30:31.3180247Z     result = runner.run(test)
2024-12-05T02:30:31.3180651Z              ^^^^^^^^^^^^^^^^
2024-12-05T02:30:31.3181488Z   File "/usr/share/miniconda3/envs/sage/lib/python3.11/site-packages/sage/doctest/forker.py", line 905, in run
2024-12-05T02:30:31.3182283Z     return self._run(test, compileflags, out)
2024-12-05T02:30:31.3182690Z            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-12-05T02:30:31.3183459Z   File "/usr/share/miniconda3/envs/sage/lib/python3.11/site-packages/sage/doctest/forker.py", line 716, in _run
2024-12-05T02:30:31.3184387Z     self.compile_and_execute(example, compiler, test.globs)
2024-12-05T02:30:31.3185463Z   File "/usr/share/miniconda3/envs/sage/lib/python3.11/site-packages/sage/doctest/forker.py", line 1137, in compile_and_execute
2024-12-05T02:30:31.3186416Z     exec(compiled, globs)
2024-12-05T02:30:31.3187001Z   File "<doctest sage.rings.polynomial.plural.G_AlgFactory[1]>", line 1, in <module>
2024-12-05T02:30:31.3188030Z   File "/usr/share/miniconda3/envs/sage/lib/python3.11/site-packages/sage/algebras/free_algebra.py", line 992, in g_algebra
2024-12-05T02:30:31.3188965Z     dmat[v2_ind, v1_ind] = polynomial_ring(d_poly)
2024-12-05T02:30:31.3189372Z                            ^^^^^^^^^^^^^^^^^^^^^^^
2024-12-05T02:30:31.3189937Z   File "parent.pyx", line 897, in sage.structure.parent.Parent.__call__
2024-12-05T02:30:31.3190705Z   File "parent.pyx", line 2503, in sage.structure.parent.Parent._internal_convert_map_from
2024-12-05T02:30:31.3191528Z   File "parent.pyx", line 2524, in sage.structure.parent.Parent.discover_convert_map_from
2024-12-05T02:30:31.3192623Z   File "parent.pyx", line 2146, in sage.structure.parent.Parent._internal_coerce_map_from
2024-12-05T02:30:31.3193467Z   File "parent.pyx", line 2238, in sage.structure.parent.Parent._internal_coerce_map_from
2024-12-05T02:30:31.3194285Z   File "parent.pyx", line 2383, in sage.structure.parent.Parent.discover_coerce_map_from
2024-12-05T02:30:31.3195070Z   File "module.pyx", line 132, in sage.modules.module.Module._coerce_map_from_
2024-12-05T02:30:31.3196199Z   File "/usr/share/miniconda3/envs/sage/lib/python3.11/site-packages/sage/algebras/free_algebra.py", line 745, in _coerce_map_from_
2024-12-05T02:30:31.3197326Z     if isinstance(R, (FreeAlgebra_generic, FreeAlgebra_letterplace)):
2024-12-05T02:30:31.3197915Z        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-12-05T02:30:31.3198625Z   File "lazy_import.pyx", line 966, in sage.misc.lazy_import.LazyImport.__instancecheck__
2024-12-05T02:30:31.3199526Z   File "lazy_import.pyx", line 224, in sage.misc.lazy_import.LazyImport.get_object
2024-12-05T02:30:31.3200740Z   File "lazy_import.pyx", line 259, in sage.misc.lazy_import.LazyImport._get_object
2024-12-05T02:30:31.3201736Z   File "free_algebra_letterplace.pyx", line 1, in init sage.algebras.letterplace.free_algebra_letterplace
2024-12-05T02:30:31.3202963Z   File "free_algebra_element_letterplace.pyx", line 25, in init sage.algebras.letterplace.free_algebra_element_letterplace
2024-12-05T02:30:31.3203979Z   File "function.pyx", line 1811, in sage.libs.singular.function.lib
2024-12-05T02:30:31.3204684Z cysignals.signals.SignalError: Segmentation fault
2024-12-05T02:30:31.3205070Z 

It does pertain to singular, but looks like it comes from the line

lib("freegb.lib")

maybe the library is somehow just nonexistent on Conda? (weird?)

The Conda 3.9 exception is

Log
2024-12-05T02:32:18.1090817Z sage -t --warn-long 5.0 --random-seed=24174903179282061903800383542369590689 src/sage/rings/polynomial/multi_polynomial_libsingular.pyx
2024-12-05T02:32:18.1092184Z     AttributeError in doctesting framework
2024-12-05T02:32:18.1092997Z **********************************************************************
2024-12-05T02:32:18.1093314Z 
2024-12-05T02:32:18.1093465Z Tests run before exception:
2024-12-05T02:32:18.1093850Z sage: P.<x,y,z> = QQ[] ## line 23 ##
2024-12-05T02:32:18.1094249Z sage: P ## line 24 ##
2024-12-05T02:32:18.1094702Z Multivariate Polynomial Ring in x, y, z over Rational Field
2024-12-05T02:32:18.1095252Z sage: f = 27/113 * x^2 + y*z + 1/2; f ## line 27 ##
2024-12-05T02:32:18.1095681Z 27/113*x^2 + y*z + 1/2
2024-12-05T02:32:18.1096023Z sage: P.term_order() ## line 30 ##
2024-12-05T02:32:18.1096439Z Degree reverse lexicographic term order
2024-12-05T02:32:18.1097040Z sage: P = PolynomialRing(GF(127), 3, names='abc', order='lex'); P ## line 33 ##
2024-12-05T02:32:18.1097793Z Multivariate Polynomial Ring in a, b, c over Finite Field of size 127
2024-12-05T02:32:18.1098387Z sage: a,b,c = P.gens() ## line 35 ##
2024-12-05T02:32:18.1098812Z sage: f = 57 * a^2*b + 43 * c + 1; f ## line 36 ##
2024-12-05T02:32:18.1099237Z 57*a^2*b + 43*c + 1
2024-12-05T02:32:18.1099566Z sage: P.term_order() ## line 38 ##
2024-12-05T02:32:18.1099955Z Lexicographic term order
2024-12-05T02:32:18.1100315Z sage: z = QQ['z'].0 ## line 41 ##
2024-12-05T02:32:18.1100904Z sage: K.<s> = NumberField(z^2 - 2)                                                  # needs sage.rings.number_field ## line 42 ##
2024-12-05T02:32:18.1101733Z sage: P.<x,y> = PolynomialRing(K, 2)                                                # needs sage.rings.number_field ## line 43 ##
2024-12-05T02:32:18.1102472Z sage: 1/2*s*x^2 + 3/4*s                                                             # needs sage.rings.number_field ## line 44 ##
2024-12-05T02:32:18.1103000Z (1/2*s)*x^2 + (3/4*s)
2024-12-05T02:32:18.1103350Z sage: P.<x,y,z> = ZZ[]; P ## line 47 ##
2024-12-05T02:32:18.1104097Z Multivariate Polynomial Ring in x, y, z over Integer Ring
2024-12-05T02:32:18.1104631Z sage: P.<x,y,z> = Zmod(2^10)[]; P ## line 50 ##
2024-12-05T02:32:18.1105262Z Multivariate Polynomial Ring in x, y, z over Ring of integers modulo 1024
2024-12-05T02:32:18.1105883Z sage: P.<x,y,z> = Zmod(3^10)[]; P ## line 53 ##
2024-12-05T02:32:18.1106502Z Multivariate Polynomial Ring in x, y, z over Ring of integers modulo 59049
2024-12-05T02:32:18.1108454Z sage: P.<x,y,z> = Zmod(2^100)[]; P ## line 56 ##
2024-12-05T02:32:18.1109162Z Multivariate Polynomial Ring in x, y, z over Ring of integers modulo 1267650600228229401496703205376
2024-12-05T02:32:18.1109881Z sage: P.<x,y,z> = Zmod(2521352)[]; P ## line 60 ##
2024-12-05T02:32:18.1110509Z Multivariate Polynomial Ring in x, y, z over Ring of integers modulo 2521352
2024-12-05T02:32:18.1111111Z sage: type(P) ## line 62 ##
2024-12-05T02:32:18.1111750Z <class 'sage.rings.polynomial.multi_polynomial_libsingular.MPolynomialRing_libsingular'>
2024-12-05T02:32:18.1112495Z sage: P.<x,y,z> = Zmod(25213521351515232)[]; P ## line 65 ##
2024-12-05T02:32:18.1113172Z Multivariate Polynomial Ring in x, y, z over Ring of integers modulo 25213521351515232
2024-12-05T02:32:18.1113938Z sage: type(P) ## line 67 ##
2024-12-05T02:32:18.1114561Z <class 'sage.rings.polynomial.multi_polynomial_libsingular.MPolynomialRing_libsingular'>
2024-12-05T02:32:18.1115310Z sage: R.<x,y,z> = PolynomialRing(GF(5), 3) ## line 72 ##
2024-12-05T02:32:18.1115801Z sage: frob = R.hom([x^5, y^5, z^5]) ## line 73 ##
2024-12-05T02:32:18.1116257Z sage: frob(x^2 + 2*y - z^4) ## line 74 ##
2024-12-05T02:32:18.1116662Z -z^20 + x^10 + 2*y^5
2024-12-05T02:32:18.1117132Z sage: frob((x + 2*y)^3)                                                             # needs sage.rings.finite_rings ## line 76 ##
2024-12-05T02:32:18.1117674Z x^15 + x^10*y^5 + 2*x^5*y^10 - 2*y^15
2024-12-05T02:32:18.1118177Z sage: (x^5 + 2*y^5)^3                                                               # needs sage.rings.finite_rings ## line 78 ##
2024-12-05T02:32:18.1118708Z x^15 + x^10*y^5 + 2*x^5*y^10 - 2*y^15
2024-12-05T02:32:18.1119153Z sage: R.<x, y> = PolynomialRing(QQ, 2) ## line 84 ##
2024-12-05T02:32:18.1119660Z sage: S.<t> = PowerSeriesRing(R) ## line 85 ##
2024-12-05T02:32:18.1120285Z sage: t*(x+y) ## line 86 ##
2024-12-05T02:32:18.1120629Z (x + y)*t
2024-12-05T02:32:18.1120934Z sage: P.<x,y,z> = QQ[] ## line 91 ##
2024-12-05T02:32:18.1121347Z sage: loads(dumps(P)) == P ## line 92 ##
2024-12-05T02:32:18.1121746Z True
2024-12-05T02:32:18.1122030Z sage: loads(dumps(x)) == x ## line 94 ##
2024-12-05T02:32:18.1122421Z True
2024-12-05T02:32:18.1122832Z sage: P.<x,y,z> = GF(2^8,'a')[]                                                     # needs sage.rings.finite_rings ## line 96 ##
2024-12-05T02:32:18.1123386Z sage: loads(dumps(P)) == P ## line 97 ##
2024-12-05T02:32:18.1123776Z True
2024-12-05T02:32:18.1124060Z sage: loads(dumps(x)) == x ## line 99 ##
2024-12-05T02:32:18.1124445Z True
2024-12-05T02:32:18.1124731Z sage: P.<x,y,z> = GF(127)[] ## line 101 ##
2024-12-05T02:32:18.1125169Z sage: loads(dumps(P)) == P ## line 102 ##
2024-12-05T02:32:18.1125568Z True
2024-12-05T02:32:18.1125857Z sage: loads(dumps(x)) == x ## line 104 ##
2024-12-05T02:32:18.1126241Z True
2024-12-05T02:32:18.1126526Z sage: P.<x,y,z> = GF(127)[] ## line 106 ##
2024-12-05T02:32:18.1126954Z sage: loads(dumps(P)) == P ## line 107 ##
2024-12-05T02:32:18.1127345Z True
2024-12-05T02:32:18.1127630Z sage: loads(dumps(x)) == x ## line 109 ##
2024-12-05T02:32:18.1128020Z True
2024-12-05T02:32:18.1128445Z sage: Rt.<t> = PolynomialRing(QQ, implementation='singular') ## line 112 ##
2024-12-05T02:32:18.1128998Z sage: p = 1+t ## line 113 ##
2024-12-05T02:32:18.1129418Z sage: R.<u,v> = PolynomialRing(QQ, 2) ## line 114 ##
2024-12-05T02:32:18.1129876Z sage: p(u/v) ## line 115 ##
2024-12-05T02:32:18.1130225Z (u + v)/v
2024-12-05T02:32:18.1130524Z sage: x = polygen(ZZ, 'x') ## line 120 ##
2024-12-05T02:32:18.1131155Z sage: K.<j> = NumberField(x - 1728)                                                 # needs sage.rings.number_field ## line 121 ##
2024-12-05T02:32:18.1132046Z sage: R.<b,c> = K[]                                                                 # needs sage.rings.number_field ## line 122 ##
2024-12-05T02:32:18.1132725Z sage: b - j*c                                                                       # needs sage.rings.number_field ## line 123 ##
2024-12-05T02:32:18.1133256Z b - 1728*c
2024-12-05T02:32:18.1133731Z sage: sig_on_count() # check sig_on/off pairings (virtual doctest) ## line 149 ##
2024-12-05T02:32:18.1134314Z 0
2024-12-05T02:32:18.1135005Z sage: from sage.rings.polynomial.multi_polynomial_libsingular import MPolynomialRing_libsingular ## line 272 ##
2024-12-05T02:32:18.1135720Z sage: MPolynomialRing_libsingular(QQ, 3, ('x', 'y', 'z'), TermOrder('degrevlex', 3)) ## line 273 ##
2024-12-05T02:32:18.1136189Z Multivariate Polynomial Ring in x, y, z over Rational Field
2024-12-05T02:32:18.1136509Z sage: type(_) ## line 275 ##
2024-12-05T02:32:18.1136908Z <class 'sage.rings.polynomial.multi_polynomial_libsingular.MPolynomialRing_libsingular'>
2024-12-05T02:32:18.1137333Z sage: P.<x,y,z> = QQ[]; P ## line 278 ##
2024-12-05T02:32:18.1137659Z Multivariate Polynomial Ring in x, y, z over Rational Field
2024-12-05T02:32:18.1138098Z sage: type(P) ## line 280 ##
2024-12-05T02:32:18.1138483Z <class 'sage.rings.polynomial.multi_polynomial_libsingular.MPolynomialRing_libsingular'>
2024-12-05T02:32:18.1139000Z sage: sig_on_count() # check sig_on/off pairings (virtual doctest) ## line 282 ##
2024-12-05T02:32:18.1139335Z 0
2024-12-05T02:32:18.1139515Z sage: P.<x,y,z> = QQ[]; P ## line 303 ##
2024-12-05T02:32:18.1139822Z Multivariate Polynomial Ring in x, y, z over Rational Field
2024-12-05T02:32:18.1140154Z sage: f = 27/113 * x^2 + y*z + 1/2; f ## line 305 ##
2024-12-05T02:32:18.1140412Z 27/113*x^2 + y*z + 1/2
2024-12-05T02:32:18.1140619Z sage: P.term_order() ## line 307 ##
2024-12-05T02:32:18.1140874Z Degree reverse lexicographic term order
2024-12-05T02:32:18.1141236Z sage: P = PolynomialRing(GF(127), 3, names='abc', order='lex'); P ## line 310 ##
2024-12-05T02:32:18.1141692Z Multivariate Polynomial Ring in a, b, c over Finite Field of size 127
2024-12-05T02:32:18.1142038Z sage: a,b,c = P.gens() ## line 312 ##
2024-12-05T02:32:18.1142413Z sage: f = 57 * a^2*b + 43 * c + 1; f ## line 313 ##
2024-12-05T02:32:18.1142670Z 57*a^2*b + 43*c + 1
2024-12-05T02:32:18.1142867Z sage: P.term_order() ## line 315 ##
2024-12-05T02:32:18.1143102Z Lexicographic term order
2024-12-05T02:32:18.1143322Z sage: z = QQ['z'].0 ## line 318 ##
2024-12-05T02:32:18.1143677Z sage: K.<s> = NumberField(z^2 - 2)                                          # needs sage.rings.number_field ## line 319 ##
2024-12-05T02:32:18.1144156Z sage: P.<x,y> = PolynomialRing(K, 2)                                        # needs sage.rings.number_field ## line 320 ##
2024-12-05T02:32:18.1144587Z sage: 1/2*s*x^2 + 3/4*s                                                     # needs sage.rings.number_field ## line 321 ##
2024-12-05T02:32:18.1144895Z (1/2*s)*x^2 + (3/4*s)
2024-12-05T02:32:18.1145103Z sage: P.<x,y,z> = ZZ[]; P ## line 324 ##
2024-12-05T02:32:18.1145411Z Multivariate Polynomial Ring in x, y, z over Integer Ring
2024-12-05T02:32:18.1145739Z sage: P.<x,y,z> = Zmod(2^10)[]; P ## line 327 ##
2024-12-05T02:32:18.1146108Z Multivariate Polynomial Ring in x, y, z over Ring of integers modulo 1024
2024-12-05T02:32:18.1146479Z sage: P.<x,y,z> = Zmod(3^10)[]; P ## line 330 ##
2024-12-05T02:32:18.1147095Z Multivariate Polynomial Ring in x, y, z over Ring of integers modulo 59049
2024-12-05T02:32:18.1147520Z sage: P.<x,y,z> = Zmod(2^100)[]; P ## line 333 ##
2024-12-05T02:32:18.1147933Z Multivariate Polynomial Ring in x, y, z over Ring of integers modulo 1267650600228229401496703205376
2024-12-05T02:32:18.1148353Z sage: P.<x,y,z> = Zmod(2521352)[]; P ## line 337 ##
2024-12-05T02:32:18.1148723Z Multivariate Polynomial Ring in x, y, z over Ring of integers modulo 2521352
2024-12-05T02:32:18.1149083Z sage: type(P) ## line 339 ##
2024-12-05T02:32:18.1149463Z <class 'sage.rings.polynomial.multi_polynomial_libsingular.MPolynomialRing_libsingular'>
2024-12-05T02:32:18.1150025Z sage: P.<x,y,z> = Zmod(25213521351515232)[]; P ## line 342 ##
2024-12-05T02:32:18.1150447Z Multivariate Polynomial Ring in x, y, z over Ring of integers modulo 25213521351515232
2024-12-05T02:32:18.1150820Z sage: type(P) ## line 345 ##
2024-12-05T02:32:18.1151195Z <class 'sage.rings.polynomial.multi_polynomial_libsingular.MPolynomialRing_libsingular'>
2024-12-05T02:32:18.1151681Z sage: P.<x,y,z> = PolynomialRing(Integers(2^32), order='lex') ## line 348 ##
2024-12-05T02:32:18.1152008Z sage: P(2^32-1) ## line 349 ##
2024-12-05T02:32:18.1152221Z -1
2024-12-05T02:32:18.1152422Z sage: R.<x,y> = PolynomialRing(ZZ) ## line 357 ##
2024-12-05T02:32:18.1152731Z sage: R.coerce_map_from(R.base_ring()) ## line 358 ##
2024-12-05T02:32:18.1153016Z Polynomial base injection morphism:
2024-12-05T02:32:18.1153255Z   From: Integer Ring
2024-12-05T02:32:18.1153513Z   To:   Multivariate Polynomial Ring in x, y over Integer Ring
2024-12-05T02:32:18.1154034Z sage: from sage.rings.polynomial.multi_polynomial_libsingular import MPolynomialRing_libsingular ## line 365 ##
2024-12-05T02:32:18.1154601Z sage: MPolynomialRing_libsingular(Zmod(1), 1, ["x"], "lex") ## line 366 ##
2024-12-05T02:32:18.1155176Z sage: MPolynomialRing_libsingular(SR, 1, ["x"], "lex")                      # needs sage.symbolic ## line 370 ##
2024-12-05T02:32:18.1155644Z sage: MPolynomialRing_libsingular(QQ, 0, [], "lex") ## line 374 ##
2024-12-05T02:32:18.1156040Z sage: MPolynomialRing_libsingular(QQ, -1, [], "lex") ## line 378 ##
2024-12-05T02:32:18.1156466Z sage: sig_on_count() # check sig_on/off pairings (virtual doctest) ## line 382 ##
2024-12-05T02:32:18.1156794Z 0
2024-12-05T02:32:18.1156967Z sage: import gc ## line 403 ##
2024-12-05T02:32:18.1157409Z sage: from sage.rings.polynomial.multi_polynomial_libsingular import MPolynomialRing_libsingular ## line 404 ##
2024-12-05T02:32:18.1157922Z sage: R1 = MPolynomialRing_libsingular(GF(5), 2, ('x', 'y'),
2024-12-05T02:32:18.1158249Z                                  TermOrder('degrevlex', 2)) ## line 405 ##
2024-12-05T02:32:18.1158572Z sage: R2 = MPolynomialRing_libsingular(GF(11), 2, ('x', 'y'),
2024-12-05T02:32:18.1159017Z                                  TermOrder('degrevlex', 2)) ## line 407 ##
2024-12-05T02:32:18.1159347Z sage: R3 = MPolynomialRing_libsingular(GF(13), 2, ('x', 'y'),
2024-12-05T02:32:18.1159660Z                                  TermOrder('degrevlex', 2)) ## line 409 ##
2024-12-05T02:32:18.1159935Z sage: _ = gc.collect() ## line 411 ##
2024-12-05T02:32:18.1160179Z sage: foo = R1.gen(0) ## line 412 ##
2024-12-05T02:32:18.1160415Z sage: del foo ## line 413 ##
2024-12-05T02:32:18.1160632Z sage: del R1 ## line 414 ##
2024-12-05T02:32:18.1160853Z sage: _ = gc.collect() ## line 415 ##
2024-12-05T02:32:18.1161087Z sage: del R2 ## line 416 ##
2024-12-05T02:32:18.1161302Z sage: _ = gc.collect() ## line 417 ##
2024-12-05T02:32:18.1161535Z sage: del R3 ## line 418 ##
2024-12-05T02:32:18.1161745Z sage: _ = gc.collect() ## line 419 ##
2024-12-05T02:32:18.1162086Z sage: sig_on_count() # check sig_on/off pairings (virtual doctest) ## line 420 ##
2024-12-05T02:32:18.1162419Z 0
2024-12-05T02:32:18.1162597Z sage: import gc ## line 433 ##
2024-12-05T02:32:18.1163048Z sage: from sage.rings.polynomial.multi_polynomial_libsingular import MPolynomialRing_libsingular ## line 434 ##
2024-12-05T02:32:18.1163631Z sage: from sage.libs.singular.ring import ring_refcount_dict ## line 435 ##
2024-12-05T02:32:18.1164013Z sage: gc.collect()  # random output ## line 436 ##
2024-12-05T02:32:18.1164272Z 0
2024-12-05T02:32:18.1164469Z sage: n = len(ring_refcount_dict) ## line 437 ##
2024-12-05T02:32:18.1164786Z sage: R = MPolynomialRing_libsingular(GF(547), 2, ('x', 'y'),
2024-12-05T02:32:18.1165108Z                                 TermOrder('degrevlex', 2)) ## line 438 ##
2024-12-05T02:32:18.1165412Z sage: len(ring_refcount_dict) == n + 1 ## line 440 ##
2024-12-05T02:32:18.1165670Z True
2024-12-05T02:32:18.1165876Z sage: Q = copy(R)   # indirect doctest ## line 442 ##
2024-12-05T02:32:18.1166297Z sage: p = R.gen(0)^2 + R.gen(1)^2 ## line 443 ##
2024-12-05T02:32:18.1166565Z sage: q = copy(p) ## line 444 ##
2024-12-05T02:32:18.1166797Z sage: del R ## line 445 ##
2024-12-05T02:32:18.1167008Z sage: del Q ## line 446 ##
2024-12-05T02:32:18.1167216Z sage: del p ## line 447 ##
2024-12-05T02:32:18.1167420Z sage: del q ## line 448 ##
2024-12-05T02:32:18.1167657Z sage: gc.collect()  # random output ## line 449 ##
2024-12-05T02:32:18.1167918Z 0
2024-12-05T02:32:18.1168113Z sage: len(ring_refcount_dict) == n ## line 450 ##
2024-12-05T02:32:18.1168360Z False
2024-12-05T02:32:18.1168798Z sage: sig_on_count() # check sig_on/off pairings (virtual doctest) ## line 452 ##
2024-12-05T02:32:18.1169374Z 0
2024-12-05T02:32:18.1169667Z sage: R.<x,y> = GF(547)[] ## line 463 ##
2024-12-05T02:32:18.1170090Z sage: R is deepcopy(R) ## line 464 ##
2024-12-05T02:32:18.1170470Z True
2024-12-05T02:32:18.1170918Z sage: sig_on_count() # check sig_on/off pairings (virtual doctest) ## line 466 ##
2024-12-05T02:32:18.1171494Z 0
2024-12-05T02:32:18.1171777Z sage: R.<x,y> = QQ[] ## line 477 ##
2024-12-05T02:32:18.1172182Z sage: type(R) ## line 478 ##
2024-12-05T02:32:18.1172962Z <class 'sage.rings.polynomial.multi_polynomial_libsingular.MPolynomialRing_libsingular'>
2024-12-05T02:32:18.1173726Z sage: R.has_coerce_map_from(ZZ['t']) ## line 480 ##
2024-12-05T02:32:18.1174175Z False
2024-12-05T02:32:18.1174504Z sage: R.coerce_map_from(ZZ['x']) ## line 482 ##
2024-12-05T02:32:18.1174945Z Coercion map:
2024-12-05T02:32:18.1175354Z   From: Univariate Polynomial Ring in x over Integer Ring
2024-12-05T02:32:18.1175973Z   To:   Multivariate Polynomial Ring in x, y over Rational Field
2024-12-05T02:32:18.1176679Z sage: sig_on_count() # check sig_on/off pairings (virtual doctest) ## line 486 ##
2024-12-05T02:32:18.1177264Z 0
2024-12-05T02:32:18.1177559Z sage: P.<x,y,z> = QQ[] ## line 531 ##
2024-12-05T02:32:18.1177993Z sage: P.coerce(x*y + 1/2) ## line 535 ##
2024-12-05T02:32:18.1178403Z x*y + 1/2
2024-12-05T02:32:18.1179091Z sage: from sage.rings.polynomial.multi_polynomial_libsingular import MPolynomialRing_libsingular ## line 540 ##
2024-12-05T02:32:18.1180214Z sage: R.<x,y,z> = MPolynomialRing_libsingular(QQ,3) ## line 541 ##
2024-12-05T02:32:18.1180766Z sage: P == R ## line 542 ##
2024-12-05T02:32:18.1181129Z True
2024-12-05T02:32:18.1181415Z sage: P is R ## line 545 ##
2024-12-05T02:32:18.1181763Z False
2024-12-05T02:32:18.1182072Z sage: P.coerce(x*y + 1) ## line 548 ##
2024-12-05T02:32:18.1182465Z x*y + 1
2024-12-05T02:32:18.1182765Z sage: P.coerce(3/2) ## line 553 ##
2024-12-05T02:32:18.1183144Z 3/2
2024-12-05T02:32:18.1183437Z sage: P.coerce(ZZ(1)) ## line 558 ##
2024-12-05T02:32:18.1183826Z 1
2024-12-05T02:32:18.1184125Z sage: P.coerce(int(1)) ## line 561 ##
2024-12-05T02:32:18.1184519Z 1
2024-12-05T02:32:18.1184931Z sage: k.<a> = GF(2^8)                                                       # needs sage.rings.finite_rings ## line 564 ##
2024-12-05T02:32:18.1185702Z sage: P.<x,y> = PolynomialRing(k,2)                                         # needs sage.rings.finite_rings ## line 565 ##
2024-12-05T02:32:18.1186501Z sage: P.coerce(a)                                                           # needs sage.rings.finite_rings ## line 566 ##
2024-12-05T02:32:18.1187249Z a
2024-12-05T02:32:18.1187546Z sage: z = QQ['z'].0 ## line 569 ##
2024-12-05T02:32:18.1188211Z sage: K.<s> = NumberField(z^2 - 2)                                          # needs sage.rings.number_field ## line 570 ##
2024-12-05T02:32:18.1189051Z sage: P.<x,y> = PolynomialRing(K, 2)                                        # needs sage.rings.number_field ## line 571 ##
2024-12-05T02:32:18.1189862Z sage: P.coerce(1/2*s)                                                       # needs sage.rings.number_field ## line 572 ##
2024-12-05T02:32:18.1190451Z (1/2*s)
2024-12-05T02:32:18.1190828Z sage: P.<x,y> = PolynomialRing(GF(127)) ## line 577 ##
2024-12-05T02:32:18.1191498Z sage: P("111111111111111111111111111111111111111111111111111111111") ## line 578 ##
2024-12-05T02:32:18.1192231Z 21
2024-12-05T02:32:18.1192567Z sage: P.<x,y> = PolynomialRing(QQ) ## line 580 ##
2024-12-05T02:32:18.1193240Z sage: P("111111111111111111111111111111111111111111111111111111111") ## line 581 ##
2024-12-05T02:32:18.1193924Z 111111111111111111111111111111111111111111111111111111111
2024-12-05T02:32:18.1194420Z sage: P("31367566080") ## line 583 ##
2024-12-05T02:32:18.1194810Z 31367566080
2024-12-05T02:32:18.1195428Z sage: R.<x,y,z> = PolynomialRing(CyclotomicField(2), 3)                     # needs sage.rings.number_field ## line 588 ##
2024-12-05T02:32:18.1196311Z sage: R.coerce(1)                                                           # needs sage.rings.number_field ## line 589 ##
2024-12-05T02:32:18.1196860Z 1
2024-12-05T02:32:18.1197166Z sage: x = polygen(ZZ, 'x') ## line 594 ##
2024-12-05T02:32:18.1197811Z sage: K.<j> = NumberField(x - 1728)                                         # needs sage.rings.number_field ## line 595 ##
2024-12-05T02:32:18.1198559Z sage: R.<b,c> = K[]                                                         # needs sage.rings.number_field ## line 596 ##
2024-12-05T02:32:18.1199253Z sage: R.coerce(1)                                                           # needs sage.rings.number_field ## line 597 ##
2024-12-05T02:32:18.1199937Z 1
2024-12-05T02:32:18.1200260Z sage: P = PolynomialRing(QQ,0,'') ## line 603 ##
2024-12-05T02:32:18.1200725Z sage: R.<x,y> = QQ[] ## line 604 ##
2024-12-05T02:32:18.1201128Z sage: P(5)*x ## line 605 ##
2024-12-05T02:32:18.1201468Z 5*x
2024-12-05T02:32:18.1201796Z sage: P = PolynomialRing(ZZ,0,'') ## line 607 ##
2024-12-05T02:32:18.1202263Z sage: R.<x,y> = GF(127)[] ## line 608 ##
2024-12-05T02:32:18.1202689Z sage: R.coerce(P(5)) ## line 609 ##
2024-12-05T02:32:18.1203073Z 5
2024-12-05T02:32:18.1203361Z sage: P.<x,y,z> = QQ[] ## line 614 ##
2024-12-05T02:32:18.1203766Z sage: P('x+y + 1/4') ## line 615 ##
2024-12-05T02:32:18.1204140Z x + y + 1/4
2024-12-05T02:32:18.1204444Z sage: P._singular_() ## line 620 ##
2024-12-05T02:32:18.1204901Z polynomial ring, over a field, global ordering
2024-12-05T02:32:18.1205365Z // coefficients: QQ
2024-12-05T02:32:18.1205696Z // number of vars : 3
2024-12-05T02:32:18.1206240Z //        block   1 : ordering dp
2024-12-05T02:32:18.1206636Z //                  : names    x y z
2024-12-05T02:32:18.1207027Z //        block   2 : ordering C
2024-12-05T02:32:18.1207454Z sage: P._singular_().set_ring() ## line 628 ##
2024-12-05T02:32:18.1208090Z sage: P(singular('x + 3/4'))                                                # needs sage.rings.function_field ## line 629 ##
2024-12-05T02:32:18.1208690Z x + 3/4
2024-12-05T02:32:18.1208986Z sage: R = QQ['x,y,z'] ## line 634 ##
2024-12-05T02:32:18.1209491Z sage: var('x')                                                              # needs sage.symbolic ## line 635 ##
2024-12-05T02:32:18.1210000Z x
2024-12-05T02:32:18.1210371Z sage: R(x)                                                                  # needs sage.symbolic ## line 637 ##
2024-12-05T02:32:18.1210862Z x
2024-12-05T02:32:18.1211146Z sage: P.<x,y,z> = QQ[] ## line 642 ##
2024-12-05T02:32:18.1211554Z sage: R.<a,b,c> = ZZ[] ## line 643 ##
2024-12-05T02:32:18.1211957Z sage: P(a) ## line 644 ##
2024-12-05T02:32:18.1212305Z x
2024-12-05T02:32:18.1212588Z sage: P.<x,y> = QQ[] ## line 649 ##
2024-12-05T02:32:18.1212992Z sage: R.<a,b,c> = QQ[] ## line 650 ##
2024-12-05T02:32:18.1213387Z sage: R(x) ## line 651 ##
2024-12-05T02:32:18.1213712Z a
2024-12-05T02:32:18.1213998Z sage: P.<x,y,z> = QQ[] ## line 656 ##
2024-12-05T02:32:18.1214525Z sage: P(pari('x^2 + y'))                                                    # needs sage.libs.pari ## line 657 ##
2024-12-05T02:32:18.1215051Z x^2 + y
2024-12-05T02:32:18.1215454Z sage: P(pari('x*y'))                                                        # needs sage.libs.pari ## line 659 ##
2024-12-05T02:32:18.1215970Z x*y
2024-12-05T02:32:18.1216333Z sage: B.<x,y,z> = BooleanPolynomialRing(3) ## line 664 ##
2024-12-05T02:32:18.1216834Z sage: P.<x,y,z> = QQ[] ## line 665 ##
2024-12-05T02:32:18.1217349Z sage: P(B.gen(0)) ## line 666 ##
2024-12-05T02:32:18.1217712Z x
2024-12-05T02:32:18.1217999Z sage: R.<x,y,z> = GF(3)[] ## line 671 ##
2024-12-05T02:32:18.1218542Z sage: R(1/2)                                                                # needs sage.rings.finite_rings ## line 672 ##
2024-12-05T02:32:18.1219065Z -1
2024-12-05T02:32:18.1219408Z sage: P.<y_2, y_1, z_3, z_2, z_1> = GF(3)[] ## line 681 ##
2024-12-05T02:32:18.1219893Z sage: Q = GF(3)['y_4', 'y_3', 'y_2', 'y_1',
2024-12-05T02:32:18.1220348Z           'z_5', 'z_4', 'z_3', 'z_2', 'z_1'] ## line 682 ##
2024-12-05T02:32:18.1220797Z sage: Q(y_1*z_2^2*z_1) ## line 684 ##
2024-12-05T02:32:18.1221196Z y_1*z_2^2*z_1
2024-12-05T02:32:18.1221516Z sage: P.<a,b,c> = GF(2)[] ## line 690 ##
2024-12-05T02:32:18.1221962Z sage: Q = GF(2)['c','b','d','e'] ## line 691 ##
2024-12-05T02:32:18.1222446Z sage: f = Q.convert_map_from(P) ## line 692 ##
2024-12-05T02:32:18.1223027Z sage: f(a), f(b), f(c)                                                      # needs sage.rings.finite_rings ## line 693 ##
2024-12-05T02:32:18.1223580Z (c, b, d)
2024-12-05T02:32:18.1223888Z sage: P.<a,b,c> = GF(2)[] ## line 698 ##
2024-12-05T02:32:18.1224424Z sage: Q = GF(2)['c','b','d'] ## line 699 ##
2024-12-05T02:32:18.1224900Z sage: f = Q.convert_map_from(P) ## line 700 ##
2024-12-05T02:32:18.1225359Z sage: f(a),f(b),f(c) ## line 701 ##
2024-12-05T02:32:18.1225748Z (c, b, d)
2024-12-05T02:32:18.1226067Z sage: P.<a,b,c,f> = GF(2)[] ## line 706 ##
2024-12-05T02:32:18.1226504Z sage: Q = GF(2)['c','d','e'] ## line 707 ##
2024-12-05T02:32:18.1227740Z sage: f = Q.convert_map_from(P) ## line 708 ##
2024-12-05T02:32:18.1228327Z sage: f(a)                                                                  # needs sage.rings.finite_rings ## line 709 ##
2024-12-05T02:32:18.1228921Z sage: R.<x,y> = QQ[]; S.<xx,yy> = GF(5)[] ## line 716 ##
2024-12-05T02:32:18.1229480Z sage: S((5*x*y + x + 17*y)._mpoly_dict_recursive()) ## line 717 ##
2024-12-05T02:32:18.1229968Z xx + 2*yy
2024-12-05T02:32:18.1230356Z sage: R.<x,y> = QQ[]; S.<xx,yy> = GF(5)[]; S(5*x*y + x + 17*y) ## line 722 ##
2024-12-05T02:32:18.1230863Z xx + 2*yy
2024-12-05T02:32:18.1231167Z sage: R.<x,y> = ZZ[] ## line 727 ##
2024-12-05T02:32:18.1231918Z sage: S.<xx,yy> = GF(25,'a')[]                                              # needs sage.rings.finite_rings ## line 728 ##
2024-12-05T02:32:18.1232499Z sage: S(5*x*y + x + 17*y) ## line 729 ##
2024-12-05T02:32:18.1232912Z xx + 2*yy
2024-12-05T02:32:18.1233249Z sage: S.<xx,yy> = Integers(5)[] ## line 732 ##
2024-12-05T02:32:18.1233710Z sage: S(5*x*y + x + 17*y) ## line 733 ##
2024-12-05T02:32:18.1234112Z xx + 2*yy
2024-12-05T02:32:18.1234497Z sage: R.<x> = QQ[]; S.<q,t> = QQ[]; F = FractionField(S) ## line 738 ##
2024-12-05T02:32:18.1235019Z sage: x in S ## line 739 ##
2024-12-05T02:32:18.1235368Z False
2024-12-05T02:32:18.1235651Z sage: x in F ## line 741 ##
2024-12-05T02:32:18.1235999Z False
2024-12-05T02:32:18.1236322Z sage: P.<x,y> = Zmod(10)[]; P(0) ## line 746 ##
2024-12-05T02:32:18.1236763Z 0
2024-12-05T02:32:18.1237084Z sage: P.<x,y> = Zmod(2^10)[]; P(0) ## line 748 ##
2024-12-05T02:32:18.1237509Z 0
2024-12-05T02:32:18.1237794Z sage: F2 = GF(2) ## line 753 ##
2024-12-05T02:32:18.1238320Z sage: F.<x> = GF(2^8)                                                       # needs sage.rings.finite_rings ## line 754 ##
2024-12-05T02:32:18.1238917Z sage: R4.<a,b> = PolynomialRing(F) ## line 755 ##
2024-12-05T02:32:18.1239441Z sage: R.<u,v> = PolynomialRing(F2) ## line 756 ##
2024-12-05T02:32:18.1239916Z sage: P = a ## line 757 ##
2024-12-05T02:32:18.1240476Z sage: (P(0,0).polynomial()[0])*u                                            # needs sage.rings.finite_rings ## line 758 ##
2024-12-05T02:32:18.1241088Z 0
2024-12-05T02:32:18.1241387Z sage: P(a,b) ## line 760 ##
2024-12-05T02:32:18.1241753Z a
2024-12-05T02:32:18.1242060Z sage: R.<x,y> = GF(7)[] ## line 765 ##
2024-12-05T02:32:18.1242497Z sage: R(2^31) ## line 766 ##
2024-12-05T02:32:18.1242856Z 2
2024-12-05T02:32:18.1243200Z sage: K.<a> = QuadraticField(17) ## line 772 ##
2024-12-05T02:32:18.1243843Z sage: Q.<x,y> = K[] ## line 773 ##
2024-12-05T02:32:18.1244280Z sage: f = (-3*a)*y + (5*a) ## line 774 ##
2024-12-05T02:32:18.1244778Z sage: p = K.primes_above(5)[0] ## line 775 ##
2024-12-05T02:32:18.1245262Z sage: R = K.residue_field(p) ## line 776 ##
2024-12-05T02:32:18.1245704Z sage: S = R['x','y'] ## line 777 ##
2024-12-05T02:32:18.1246105Z sage: S(f) ## line 778 ##
2024-12-05T02:32:18.1246480Z (2*abar)*y
2024-12-05T02:32:18.1246777Z sage: T.<c,d> = QQ[] ## line 783 ##
2024-12-05T02:32:18.1247204Z sage: F = FractionField(T) ## line 784 ##
2024-12-05T02:32:18.1247645Z sage: R.<x,y,z> = F[] ## line 785 ##
2024-12-05T02:32:18.1248050Z sage: R('d*z+x^2*y') ## line 786 ##
2024-12-05T02:32:18.1248431Z x^2*y + d*z
2024-12-05T02:32:18.1248915Z sage: sig_on_count() # check sig_on/off pairings (virtual doctest) ## line 788 ##
2024-12-05T02:32:18.1249509Z 0
2024-12-05T02:32:18.1249790Z sage: P.<x,y> = QQ[] ## line 1017 ##
2024-12-05T02:32:18.1250232Z sage: P # indirect doctest ## line 1018 ##
2024-12-05T02:32:18.1250788Z Multivariate Polynomial Ring in x, y over Rational Field
2024-12-05T02:32:18.1251240Z sage: sig_on_count() # check sig_on/off pairings (virtual doctest) ## line 1020 ##
2024-12-05T02:32:18.1251937Z 0
2024-12-05T02:32:18.1252249Z sage: P.<x,y> = QQ[] ## line 1031 ##
2024-12-05T02:32:18.1252694Z sage: P.ngens() ## line 1032 ##
2024-12-05T02:32:18.1252928Z 2
2024-12-05T02:32:18.1253188Z sage: k.<a> = GF(2^16)                                                      # needs sage.rings.finite_rings ## line 1035 ##
2024-12-05T02:32:18.1253645Z sage: P = PolynomialRing(k, 1000, 'x')                                      # needs sage.rings.finite_rings ## line 1036 ##
2024-12-05T02:32:18.1254097Z sage: P.ngens()                                                             # needs sage.rings.finite_rings ## line 1037 ##
2024-12-05T02:32:18.1254404Z 1000
2024-12-05T02:32:18.1254678Z sage: sig_on_count() # check sig_on/off pairings (virtual doctest) ## line 1039 ##
2024-12-05T02:32:18.1255021Z 0
2024-12-05T02:32:18.1255196Z sage: P.<x,y,z> = QQ[] ## line 1053 ##
2024-12-05T02:32:18.1255449Z sage: P.gen(), P.gen(1) ## line 1054 ##
2024-12-05T02:32:18.1255687Z (x, y)
2024-12-05T02:32:18.1256082Z sage: P = PolynomialRing(GF(127), 1000, 'x') ## line 1057 ##
2024-12-05T02:32:18.1256389Z sage: P.gen(500) ## line 1058 ##
2024-12-05T02:32:18.1256606Z x500
2024-12-05T02:32:18.1256830Z sage: P.<SAGE,SINGULAR> = QQ[] # weird names ## line 1061 ##
2024-12-05T02:32:18.1257122Z sage: P.gen(1) ## line 1062 ##
2024-12-05T02:32:18.1257452Z SINGULAR
2024-12-05T02:32:18.1257943Z sage: sig_on_count() # check sig_on/off pairings (virtual doctest) ## line 1064 ##
2024-12-05T02:32:18.1258545Z 0
2024-12-05T02:32:18.1258853Z sage: P.<x,y,z> = QQ[] ## line 1092 ##
2024-12-05T02:32:18.1259535Z sage: sage.rings.ideal.Katsura(P)                                           # needs sage.rings.function_field ## line 1093 ##
2024-12-05T02:32:18.1260649Z Ideal (x + 2*y + 2*z - 1, x^2 + 2*y^2 + 2*z^2 - x, 2*x*y + 2*y*z - y) of Multivariate Polynomial Ring in x, y, z over Rational Field
2024-12-05T02:32:18.1261394Z sage: P.ideal([x + 2*y + 2*z-1, 2*x*y + 2*y*z-y, x^2 + 2*y^2 + 2*z^2-x]) ## line 1097 ##
2024-12-05T02:32:18.1262144Z Ideal (x + 2*y + 2*z - 1, 2*x*y + 2*y*z - y, x^2 + 2*y^2 + 2*z^2 - x) of Multivariate Polynomial Ring in x, y, z over Rational Field
2024-12-05T02:32:18.1262988Z sage: sig_on_count() # check sig_on/off pairings (virtual doctest) ## line 1100 ##
2024-12-05T02:32:18.1263508Z 0
2024-12-05T02:32:18.1263770Z sage: R.<x,y> = ZZ[] ## line 1129 ##
2024-12-05T02:32:18.1264138Z sage: R.<x,y> = QQ[] ## line 1137 ##
2024-12-05T02:32:18.1264506Z sage: R.<x,y> = GF(17)[] ## line 1141 ##
2024-12-05T02:32:18.1265036Z sage: sig_on_count() # check sig_on/off pairings (virtual doctest) ## line 1146 ##
2024-12-05T02:32:18.1265549Z 0
2024-12-05T02:32:18.1265810Z sage: P.<x,y,z> = QQ[] ## line 1182 ##
2024-12-05T02:32:18.1266183Z sage: P._singular_() ## line 1183 ##
2024-12-05T02:32:18.1266723Z polynomial ring, over a field, global ordering
2024-12-05T02:32:18.1267404Z // coefficients: QQ
2024-12-05T02:32:18.1267730Z // number of vars : 3
2024-12-05T02:32:18.1268060Z //        block   1 : ordering dp
2024-12-05T02:32:18.1268441Z //                  : names    x y z
2024-12-05T02:32:18.1268814Z //        block   2 : ordering C
2024-12-05T02:32:18.1269245Z sage: P._singular_() is P._singular_() ## line 1191 ##
2024-12-05T02:32:18.1269673Z True
2024-12-05T02:32:18.1270034Z sage: P._singular_().name() == P._singular_().name() ## line 1194 ##
2024-12-05T02:32:18.1270504Z True
2024-12-05T02:32:18.1270890Z sage: k.<a> = GF(3^3)                                                       # needs sage.rings.finite_rings ## line 1197 ##
2024-12-05T02:32:18.1271617Z sage: P.<x,y,z> = PolynomialRing(k, 3)                                      # needs sage.rings.finite_rings ## line 1198 ##
2024-12-05T02:32:18.1272367Z sage: P._singular_()                                                        # needs sage.rings.finite_rings ## line 1199 ##
2024-12-05T02:32:18.1272970Z polynomial ring, over a field, global ordering
2024-12-05T02:32:18.1273411Z // coefficients: ZZ/3[a]/(a^3-a+1)
2024-12-05T02:32:18.1273904Z // number of vars : 3
2024-12-05T02:32:18.1274225Z //        block   1 : ordering dp
2024-12-05T02:32:18.1274580Z //                  : names    x y z
2024-12-05T02:32:18.1274947Z //        block   2 : ordering C
2024-12-05T02:32:18.1275527Z sage: P._singular_() is P._singular_()                                      # needs sage.rings.finite_rings ## line 1207 ##
2024-12-05T02:32:18.1276161Z True
2024-12-05T02:32:18.1276701Z sage: P._singular_().name() == P._singular_().name()                        # needs sage.rings.finite_rings ## line 1210 ##
2024-12-05T02:32:18.1277368Z True
2024-12-05T02:32:18.1277640Z sage: P.<x> = QQ[] ## line 1215 ##
2024-12-05T02:32:18.1278024Z sage: P._singular_() ## line 1216 ##
2024-12-05T02:32:18.1278453Z polynomial ring, over a field, global ordering
2024-12-05T02:32:18.1278885Z // coefficients: QQ
2024-12-05T02:32:18.1279198Z // number of vars : 1
2024-12-05T02:32:18.1279518Z //        block   1 : ordering lp
2024-12-05T02:32:18.1279878Z //                  : names    x
2024-12-05T02:32:18.1280438Z //        block   2 : ordering C
2024-12-05T02:32:18.1280970Z sage: sig_on_count() # check sig_on/off pairings (virtual doctest) ## line 1223 ##
2024-12-05T02:32:18.1281516Z 0
2024-12-05T02:32:18.1281785Z sage: P.<x,y,z> = QQ[] ## line 1257 ##
2024-12-05T02:32:18.1282191Z sage: P._singular_init_() ## line 1258 ##
2024-12-05T02:32:18.1282625Z polynomial ring, over a field, global ordering
2024-12-05T02:32:18.1283028Z // coefficients: QQ
2024-12-05T02:32:18.1283313Z // number of vars : 3
2024-12-05T02:32:18.1283618Z //        block   1 : ordering dp
2024-12-05T02:32:18.1283962Z //                  : names    x y z
2024-12-05T02:32:18.1284324Z //        block   2 : ordering C
2024-12-05T02:32:18.1284787Z sage: P._singular_init_() is P._singular_init_() ## line 1265 ##
2024-12-05T02:32:18.1285276Z False
2024-12-05T02:32:18.1285695Z sage: P._singular_init_().name() == P._singular_init_().name() ## line 1268 ##
2024-12-05T02:32:18.1286238Z False
2024-12-05T02:32:18.1286530Z sage: w = polygen(ZZ, 'w') ## line 1271 ##
2024-12-05T02:32:18.1287261Z sage: R.<x,y> = PolynomialRing(NumberField(w^2 + 1,'s'))                    # needs sage.rings.number_field ## line 1272 ##
2024-12-05T02:32:18.1288200Z sage: singular(R)                                                           # needs sage.rings.number_field ## line 1273 ##
2024-12-05T02:32:18.1288847Z polynomial ring, over a field, global ordering
2024-12-05T02:32:18.1289324Z // coefficients: QQ[s]/(s^2+1)
2024-12-05T02:32:18.1289691Z // number of vars : 2
2024-12-05T02:32:18.1290015Z //        block   1 : ordering dp
2024-12-05T02:32:18.1290383Z //                  : names    x y
2024-12-05T02:32:18.1290756Z //        block   2 : ordering C
2024-12-05T02:32:18.1291397Z sage: R = PolynomialRing(GF(2**8,'a'),10,'x', order='invlex')               # needs sage.rings.finite_rings ## line 1281 ##
2024-12-05T02:32:18.1292344Z sage: singular(R)                                                           # needs sage.rings.finite_rings ## line 1282 ##
2024-12-05T02:32:18.1292960Z polynomial ring, over a field, global ordering
2024-12-05T02:32:18.1293423Z // coefficients: ZZ/2[a]/(a^8+a^4+a^3+a^2+1)
2024-12-05T02:32:18.1293833Z // number of vars : 10
2024-12-05T02:32:18.1294164Z //        block   1 : ordering ip
2024-12-05T02:32:18.1294561Z //                  : names    x0 x1 x2 x3 x4 x5 x6 x7 x8 x9
2024-12-05T02:32:18.1294990Z //        block   2 : ordering C
2024-12-05T02:32:18.1295492Z sage: R = PolynomialRing(GF(127),2,'x', order='invlex') ## line 1290 ##
2024-12-05T02:32:18.1296180Z sage: singular(R)                                                           # needs sage.rings.finite_rings ## line 1291 ##
2024-12-05T02:32:18.1296775Z polynomial ring, over a field, global ordering
2024-12-05T02:32:18.1297208Z // coefficients: ZZ/127
2024-12-05T02:32:18.1297532Z // number of vars : 2
2024-12-05T02:32:18.1297855Z //        block   1 : ordering ip
2024-12-05T02:32:18.1298217Z //                  : names    x0 x1
2024-12-05T02:32:18.1298593Z //        block   2 : ordering C
2024-12-05T02:32:18.1299168Z sage: R = PolynomialRing(QQ,2,'x', order='invlex') ## line 1299 ##
2024-12-05T02:32:18.1299863Z sage: singular(R)                                                           # needs sage.rings.function_field ## line 1300 ##
2024-12-05T02:32:18.1300481Z polynomial ring, over a field, global ordering
2024-12-05T02:32:18.1300913Z // coefficients: QQ
2024-12-05T02:32:18.1301222Z // number of vars : 2
2024-12-05T02:32:18.1301542Z //        block   1 : ordering ip
2024-12-05T02:32:18.1301912Z //                  : names    x0 x1
2024-12-05T02:32:18.1302308Z //        block   2 : ordering C
2024-12-05T02:32:18.1302835Z sage: R = PolynomialRing(QQ,2,'x', order='degneglex') ## line 1308 ##
2024-12-05T02:32:18.1303571Z sage: singular(R)                                                           # needs sage.rings.function_field ## line 1309 ##
2024-12-05T02:32:18.1304215Z polynomial ring, over a field, global ordering
2024-12-05T02:32:18.1304653Z // coefficients: QQ
2024-12-05T02:32:18.1305114Z // number of vars : 2
2024-12-05T02:32:18.1305441Z //        block   1 : ordering a
2024-12-05T02:32:18.1305803Z //                  : names    x0 x1
2024-12-05T02:32:18.1306170Z //                  : weights   1  1
2024-12-05T02:32:18.1306545Z //        block   2 : ordering ls
2024-12-05T02:32:18.1307194Z //                  : names    x0 x1
2024-12-05T02:32:18.1307591Z //        block   3 : ordering C
2024-12-05T02:32:18.1308006Z sage: R = PolynomialRing(QQ,'x') ## line 1320 ##
2024-12-05T02:32:18.1308605Z sage: singular(R)                                                           # needs sage.rings.function_field ## line 1321 ##
2024-12-05T02:32:18.1309219Z polynomial ring, over a field, global ordering
2024-12-05T02:32:18.1309668Z // coefficients: QQ
2024-12-05T02:32:18.1309989Z // number of vars : 1
2024-12-05T02:32:18.1310326Z //        block   1 : ordering lp
2024-12-05T02:32:18.1310695Z //                  : names    x
2024-12-05T02:32:18.1311047Z //        block   2 : ordering C
2024-12-05T02:32:18.1311463Z sage: R = PolynomialRing(GF(127),'x') ## line 1329 ##
2024-12-05T02:32:18.1312061Z sage: singular(R)                                                           # needs sage.rings.finite_rings ## line 1330 ##
2024-12-05T02:32:18.1312657Z polynomial ring, over a field, global ordering
2024-12-05T02:32:18.1313088Z // coefficients: ZZ/127
2024-12-05T02:32:18.1313410Z // number of vars : 1
2024-12-05T02:32:18.1313724Z //        block   1 : ordering lp
2024-12-05T02:32:18.1314070Z //                  : names    x
2024-12-05T02:32:18.1314419Z //        block   2 : ordering C
2024-12-05T02:32:18.1314766Z sage: R = ZZ['x,y'] ## line 1338 ##
2024-12-05T02:32:18.1315299Z sage: singular(R)                                                           # needs sage.rings.function_field ## line 1339 ##
2024-12-05T02:32:18.1316015Z polynomial ring, over a domain, global ordering
2024-12-05T02:32:18.1316439Z // coefficients: ZZ
2024-12-05T02:32:18.1316736Z // number of vars : 2
2024-12-05T02:32:18.1317042Z //        block   1 : ordering dp
2024-12-05T02:32:18.1317412Z //                  : names    x y
2024-12-05T02:32:18.1317780Z //        block   2 : ordering C
2024-12-05T02:32:18.1318193Z sage: R = IntegerModRing(1024)['x,y'] ## line 1347 ##
2024-12-05T02:32:18.1318799Z sage: singular(R)                                                           # needs sage.rings.function_field ## line 1348 ##
2024-12-05T02:32:18.1319493Z polynomial ring, over a ring (with zero-divisors), global ordering
2024-12-05T02:32:18.1320034Z // coefficients: ZZ/(2^10)
2024-12-05T02:32:18.1320376Z // number of vars : 2
2024-12-05T02:32:18.1320693Z //        block   1 : ordering dp
2024-12-05T02:32:18.1321058Z //                  : names    x y
2024-12-05T02:32:18.1321427Z //        block   2 : ordering C
2024-12-05T02:32:18.1321833Z sage: R = IntegerModRing(15)['x,y'] ## line 1356 ##
2024-12-05T02:32:18.1322466Z sage: singular(R)                                                           # needs sage.rings.function_field ## line 1357 ##
2024-12-05T02:32:18.1323323Z polynomial ring, over a ring (with zero-divisors), global ordering
2024-12-05T02:32:18.1323889Z // coefficients: ZZ/(15)
2024-12-05T02:32:18.1324241Z // number of vars : 2
2024-12-05T02:32:18.1324566Z //        block   1 : ordering dp
2024-12-05T02:32:18.1324918Z //                  : names    x y
2024-12-05T02:32:18.1341555Z //        block   2 : ordering C
2024-12-05T02:32:18.1341997Z sage: P.<x> = QQ[] ## line 1367 ##
2024-12-05T02:32:18.1342409Z sage: P._singular_init_() ## line 1368 ##
2024-12-05T02:32:18.1342866Z polynomial ring, over a field, global ordering
2024-12-05T02:32:18.1343292Z // coefficients: QQ
2024-12-05T02:32:18.1343616Z // number of vars : 1
2024-12-05T02:32:18.1343960Z //        block   1 : ordering lp
2024-12-05T02:32:18.1344340Z //                  : names    x
2024-12-05T02:32:18.1344722Z //        block   2 : ordering C
2024-12-05T02:32:18.1345267Z sage: sig_on_count() # check sig_on/off pairings (virtual doctest) ## line 1375 ##
2024-12-05T02:32:18.1345840Z 0
2024-12-05T02:32:18.1346346Z sage: P.<x,y,z> = QQ[] ## line 1405 ##
2024-12-05T02:32:18.1347012Z sage: hash(P)      # somewhat random output ## line 1406 ##
2024-12-05T02:32:18.1347498Z -6612225623030123954
2024-12-05T02:32:18.1348014Z sage: sig_on_count() # check sig_on/off pairings (virtual doctest) ## line 1408 ##
2024-12-05T02:32:18.1348599Z 0
2024-12-05T02:32:18.1348887Z sage: P.<x,y,z> = QQ[] ## line 1422 ##
2024-12-05T02:32:18.1349300Z sage: R.<x,y,z> = QQ[] ## line 1423 ##
2024-12-05T02:32:18.1349699Z sage: P == R ## line 1424 ##
2024-12-05T02:32:18.1350047Z True
2024-12-05T02:32:18.1350342Z sage: R.<x,y,z> = GF(127)[] ## line 1427 ##
2024-12-05T02:32:18.1350753Z sage: P == R ## line 1428 ##
2024-12-05T02:32:18.1351097Z False
2024-12-05T02:32:18.1351377Z sage: R.<x,y> = QQ[] ## line 1431 ##
2024-12-05T02:32:18.1351773Z sage: P == R ## line 1432 ##
2024-12-05T02:32:18.1352112Z False
2024-12-05T02:32:18.1352499Z sage: R.<x,y,z> = PolynomialRing(QQ, order='invlex') ## line 1435 ##
2024-12-05T02:32:18.1353030Z sage: P == R ## line 1436 ##
2024-12-05T02:32:18.1353372Z False
2024-12-05T02:32:18.1353665Z sage: R = QQ['x', 'y']; R ## line 1441 ##
2024-12-05T02:32:18.1354182Z Multivariate Polynomial Ring in x, y over Rational Field
2024-12-05T02:32:18.1354684Z sage: R == R ## line 1443 ##
2024-12-05T02:32:18.1355018Z True
2024-12-05T02:32:18.1355303Z sage: R == QQ['x','z'] ## line 1445 ##
2024-12-05T02:32:18.1355702Z False
2024-12-05T02:32:18.1356161Z sage: sig_on_count() # check sig_on/off pairings (virtual doctest) ## line 1447 ##
2024-12-05T02:32:18.1356725Z 0
2024-12-05T02:32:18.1357140Z sage: P.<x,y,z> = PolynomialRing(QQ, order='degrevlex') ## line 1469 ##
2024-12-05T02:32:18.1357710Z sage: P == loads(dumps(P)) ## line 1470 ##
2024-12-05T02:32:18.1358123Z True
2024-12-05T02:32:18.1358529Z sage: P.<x,y,z> = PolynomialRing(ZZ, order='degrevlex') ## line 1473 ##
2024-12-05T02:32:18.1359287Z sage: P == loads(dumps(P)) ## line 1474 ##
2024-12-05T02:32:18.1359705Z True
2024-12-05T02:32:18.1360110Z sage: P = PolynomialRing(GF(127), names='abc') ## line 1477 ##
2024-12-05T02:32:18.1360650Z sage: P == loads(dumps(P)) ## line 1478 ##
2024-12-05T02:32:18.1361062Z True
2024-12-05T02:32:18.1361618Z sage: P = PolynomialRing(GF(2^8,'F'), names='abc')                          # needs sage.rings.finite_rings ## line 1481 ##
2024-12-05T02:32:18.1362335Z sage: P == loads(dumps(P)) ## line 1482 ##
2024-12-05T02:32:18.1362748Z True
2024-12-05T02:32:18.1363288Z sage: P = PolynomialRing(GF(2^16,'B'), names='abc')                         # needs sage.rings.finite_rings ## line 1485 ##
2024-12-05T02:32:18.1363994Z sage: P == loads(dumps(P)) ## line 1486 ##
2024-12-05T02:32:18.1364407Z True
2024-12-05T02:32:18.1364681Z sage: z = QQ['z'].0 ## line 1488 ##
2024-12-05T02:32:18.1365421Z sage: P = PolynomialRing(NumberField(z^2 + 3, 'B'), names='abc')            # needs sage.rings.number_field ## line 1489 ##
2024-12-05T02:32:18.1366395Z sage: P == loads(dumps(P))                                                  # needs sage.rings.number_field ## line 1490 ##
2024-12-05T02:32:18.1367183Z True
2024-12-05T02:32:18.1367673Z sage: sig_on_count() # check sig_on/off pairings (virtual doctest) ## line 1492 ##
2024-12-05T02:32:18.1368263Z 0
2024-12-05T02:32:18.1368623Z sage: R.<x,y> = QQ[] # indirect doctest ## line 1502 ##
2024-12-05T02:32:18.1369176Z sage: with localvars(R, 'z,w'):
2024-12-05T02:32:18.1369601Z      print(x^3 + y^3 - x*y) ## line 1503 ##
2024-12-05T02:32:18.1370033Z z^3 + w^3 - z*w
2024-12-05T02:32:18.1370528Z sage: sig_on_count() # check sig_on/off pairings (virtual doctest) ## line 1506 ##
2024-12-05T02:32:18.1371093Z 0
2024-12-05T02:32:18.1371383Z sage: P.<x,y,z> = QQ[] ## line 1551 ##
2024-12-05T02:32:18.1371853Z sage: P.monomial_quotient(3/2*x*y,x) ## line 1552 ##
2024-12-05T02:32:18.1372303Z y
2024-12-05T02:32:18.1372690Z sage: P.monomial_quotient(3/2*x*y,x,coeff=True) ## line 1555 ##
2024-12-05T02:32:18.1373197Z 3/2*y
2024-12-05T02:32:18.1373536Z sage: P.monomial_quotient(2*x,3*x) ## line 1560 ##
2024-12-05T02:32:18.1373977Z 1
2024-12-05T02:32:18.1374524Z sage: P.<x,y> = PolynomialRing(ZZ) ## line 1563 ##
2024-12-05T02:32:18.1375104Z sage: P.monomial_quotient(2*x,3*x,coeff=True) ## line 1564 ##
2024-12-05T02:32:18.1375630Z sage: R.<x,y,z> = QQ[] ## line 1571 ##
2024-12-05T02:32:18.1376048Z sage: P.<x,y,z> = QQ[] ## line 1572 ##
2024-12-05T02:32:18.1376503Z sage: P.monomial_quotient(x*y,x) ## line 1573 ##
2024-12-05T02:32:18.1376937Z y
2024-12-05T02:32:18.1377288Z sage: P.monomial_quotient(x*y,R.gen()) ## line 1576 ##
2024-12-05T02:32:18.1377743Z y
2024-12-05T02:32:18.1378071Z sage: P.monomial_quotient(P(0),P(1)) ## line 1579 ##
2024-12-05T02:32:18.1378513Z 0
2024-12-05T02:32:18.1378844Z sage: P.monomial_quotient(P(1),P(0)) ## line 1582 ##
2024-12-05T02:32:18.1379448Z sage: P.monomial_quotient(P(3/2),P(2/3), coeff=True) ## line 1587 ##
2024-12-05T02:32:18.1379985Z 9/4
2024-12-05T02:32:18.1380404Z sage: P.monomial_quotient(x,y) # Note the wrong result ## line 1590 ##
2024-12-05T02:32:18.1380949Z x*y^1048575*z^1048575
2024-12-05T02:32:18.1381336Z sage: P.monomial_quotient(x,P(1)) ## line 1594 ##
2024-12-05T02:32:18.1381770Z x
2024-12-05T02:32:18.1382223Z sage: sig_on_count() # check sig_on/off pairings (virtual doctest) ## line 1602 ##
2024-12-05T02:32:18.1382793Z 0
2024-12-05T02:32:18.1383067Z sage: P.<x,y,z> = QQ[] ## line 1645 ##
2024-12-05T02:32:18.1383560Z sage: P.monomial_divides(x*y*z, x^3*y^2*z^4) ## line 1646 ##
2024-12-05T02:32:18.1384039Z True
2024-12-05T02:32:18.1384403Z sage: P.monomial_divides(x^3*y^2*z^4, x*y*z) ## line 1648 ##
2024-12-05T02:32:18.1384880Z False
2024-12-05T02:32:18.1385173Z sage: P.<x,y,z> = QQ[] ## line 1653 ##
2024-12-05T02:32:18.1385636Z sage: P.monomial_divides(P(1), P(0)) ## line 1654 ##
2024-12-05T02:32:18.1386083Z True
2024-12-05T02:32:18.1386404Z sage: P.monomial_divides(P(1), x) ## line 1656 ##
2024-12-05T02:32:18.1387213Z True
2024-12-05T02:32:18.1387672Z sage: sig_on_count() # check sig_on/off pairings (virtual doctest) ## line 1658 ##
2024-12-05T02:32:18.1388293Z 0
2024-12-05T02:32:18.1388591Z sage: P.<x,y,z> = QQ[] ## line 1691 ##
2024-12-05T02:32:18.1389036Z sage: P.monomial_lcm(3/2*x*y,x) ## line 1692 ##
2024-12-05T02:32:18.1389458Z x*y
2024-12-05T02:32:18.1389739Z sage: R.<x,y,z> = QQ[] ## line 1697 ##
2024-12-05T02:32:18.1390138Z sage: P.<x,y,z> = QQ[] ## line 1698 ##
2024-12-05T02:32:18.1390575Z sage: P.monomial_lcm(x*y,R.gen()) ## line 1699 ##
2024-12-05T02:32:18.1391004Z x*y
2024-12-05T02:32:18.1391330Z sage: P.monomial_lcm(P(3/2),P(2/3)) ## line 1702 ##
2024-12-05T02:32:18.1391765Z 1
2024-12-05T02:32:18.1392065Z sage: P.monomial_lcm(x,P(1)) ## line 1705 ##
2024-12-05T02:32:18.1392471Z x
2024-12-05T02:32:18.1392911Z sage: sig_on_count() # check sig_on/off pairings (virtual doctest) ## line 1707 ##
2024-12-05T02:32:18.1393475Z 0
2024-12-05T02:32:18.1393759Z sage: P.<x,y,z> = QQ[] ## line 1748 ##
2024-12-05T02:32:18.1394158Z sage: f = x*y^2 ## line 1749 ##
2024-12-05T02:32:18.1394590Z sage: G = [ 3/2*x^3 + y^2 + 1/2, 1/4*x*y + 2/7, 1/2  ] ## line 1750 ##
2024-12-05T02:32:18.1395097Z sage: P.monomial_reduce(f,G) ## line 1751 ##
2024-12-05T02:32:18.1395633Z (y, 1/4*x*y + 2/7)
2024-12-05T02:32:18.1395959Z sage: P.<x,y,z> = QQ[] ## line 1756 ##
2024-12-05T02:32:18.1396357Z sage: f = x*y^2 ## line 1757 ##
2024-12-05T02:32:18.1396775Z sage: G = [ 3/2*x^3 + y^2 + 1/2, 1/4*x*y + 2/7, 1/2  ] ## line 1758 ##
2024-12-05T02:32:18.1397290Z sage: P.monomial_reduce(P(0),G) ## line 1760 ##
2024-12-05T02:32:18.1397711Z (0, 0)
2024-12-05T02:32:18.1398036Z sage: P.monomial_reduce(f,[P(0)]) ## line 1763 ##
2024-12-05T02:32:18.1398469Z (0, 0)
2024-12-05T02:32:18.1398915Z sage: sig_on_count() # check sig_on/off pairings (virtual doctest) ## line 1765 ##
2024-12-05T02:32:18.1399483Z 0
2024-12-05T02:32:18.1399765Z sage: P.<x,y,z> = QQ[] ## line 1798 ##
2024-12-05T02:32:18.1400268Z sage: P.monomial_pairwise_prime(x^2*z^3, y^4) ## line 1799 ##
2024-12-05T02:32:18.1400755Z True
2024-12-05T02:32:18.1401158Z sage: P.monomial_pairwise_prime(1/2*x^3*y^2, 3/4*y^3) ## line 1802 ##
2024-12-05T02:32:18.1401677Z False
2024-12-05T02:32:18.1402150Z sage: Q.<x,y,z> = QQ[] ## line 1807 ##
2024-12-05T02:32:18.1402557Z sage: P.<x,y,z> = QQ[] ## line 1808 ##
2024-12-05T02:32:18.1403077Z sage: P.monomial_pairwise_prime(x^2*z^3, Q('y^4')) ## line 1809 ##
2024-12-05T02:32:18.1403585Z True
2024-12-05T02:32:18.1403974Z sage: P.monomial_pairwise_prime(1/2*x^3*y^2, Q(0)) ## line 1812 ##
2024-12-05T02:32:18.1404461Z True
2024-12-05T02:32:18.1404824Z sage: P.monomial_pairwise_prime(P(1/2),x) ## line 1815 ##
2024-12-05T02:32:18.1405289Z False
2024-12-05T02:32:18.1405738Z sage: sig_on_count() # check sig_on/off pairings (virtual doctest) ## line 1817 ##
2024-12-05T02:32:18.1406299Z 0
2024-12-05T02:32:18.1406574Z sage: P.<x,y,z> = QQ[] ## line 1859 ##
2024-12-05T02:32:18.1407036Z sage: P.monomial_all_divisors(x^2*z^3) ## line 1860 ##
2024-12-05T02:32:18.1407562Z [x, x^2, z, x*z, x^2*z, z^2, x*z^2, x^2*z^2, z^3, x*z^3, x^2*z^3]
2024-12-05T02:32:18.1408187Z sage: sig_on_count() # check sig_on/off pairings (virtual doctest) ## line 1864 ##
2024-12-05T02:32:18.1408747Z 0
2024-12-05T02:32:18.1409077Z sage: P.<x,y> = PolynomialRing(QQ) ## line 1886 ##
2024-12-05T02:32:18.1409625Z sage: loads(dumps(P)) is P # indirect doctest ## line 1887 ##
2024-12-05T02:32:18.1410098Z True
2024-12-05T02:32:18.1410548Z sage: sig_on_count() # check sig_on/off pairings (virtual doctest) ## line 1889 ##
2024-12-05T02:32:18.1411108Z 0
2024-12-05T02:32:18.1411762Z sage: from sage.rings.polynomial.multi_polynomial_libsingular import MPolynomial_libsingular ## line 1906 ##
2024-12-05T02:32:18.1412786Z sage: P = PolynomialRing(GF(32003), 3, 'x')                                 # needs sage.rings.finite_rings ## line 1907 ##
2024-12-05T02:32:18.1413679Z sage: MPolynomial_libsingular(P)                                            # needs sage.rings.finite_rings ## line 1908 ##
2024-12-05T02:32:18.1414429Z 0
2024-12-05T02:32:18.1414901Z sage: sig_on_count() # check sig_on/off pairings (virtual doctest) ## line 1910 ##
2024-12-05T02:32:18.1415468Z 0
2024-12-05T02:32:18.1415744Z sage: F.<a> = GF(7^2) ## line 1934 ##
2024-12-05T02:32:18.1416145Z sage: R.<x,y> = F[] ## line 1935 ##
2024-12-05T02:32:18.1416556Z sage: p = a*x^2 + y + a^3; p ## line 1936 ##
2024-12-05T02:32:18.1416963Z a*x^2 + y + (-2*a - 3)
2024-12-05T02:32:18.1417296Z sage: q = copy(p) ## line 1938 ##
2024-12-05T02:32:18.1417678Z sage: p == q ## line 1939 ##
2024-12-05T02:32:18.1418022Z True
2024-12-05T02:32:18.1418294Z sage: p is q ## line 1941 ##
2024-12-05T02:32:18.1418634Z False
2024-12-05T02:32:18.1418914Z sage: lst = [p,q] ## line 1943 ##
2024-12-05T02:32:18.1419414Z sage: matrix(ZZ, 2, 2, lambda i,j: bool(lst[i]==lst[j])) ## line 1944 ##
2024-12-05T02:32:18.1419919Z [1 1]
2024-12-05T02:32:18.1420169Z [1 1]
2024-12-05T02:32:18.1420552Z sage: matrix(ZZ, 2, 2, lambda i,j: bool(lst[i] is lst[j])) ## line 1947 ##
2024-12-05T02:32:18.1421060Z [1 0]
2024-12-05T02:32:18.1421325Z [0 1]
2024-12-05T02:32:18.1421772Z sage: sig_on_count() # check sig_on/off pairings (virtual doctest) ## line 1950 ##
2024-12-05T02:32:18.1422328Z 0
2024-12-05T02:32:18.1422698Z sage: R.<x,y> = QQ[] ## line 1959 ##
2024-12-05T02:32:18.1423092Z sage: p = x^2 + y^2 ## line 1960 ##
2024-12-05T02:32:18.1423492Z sage: p is deepcopy(p) ## line 1961 ##
2024-12-05T02:32:18.1423903Z False
2024-12-05T02:32:18.1424194Z sage: p == deepcopy(p) ## line 1963 ##
2024-12-05T02:32:18.1424563Z True
2024-12-05T02:32:18.1424921Z sage: p.parent() is deepcopy(p).parent() ## line 1965 ##
2024-12-05T02:32:18.1425384Z True
2024-12-05T02:32:18.1425828Z sage: sig_on_count() # check sig_on/off pairings (virtual doctest) ## line 1967 ##
2024-12-05T02:32:18.1426383Z 0
2024-12-05T02:32:18.1426653Z sage: R.<x,y> = QQ[] ## line 1983 ##
2024-12-05T02:32:18.1427273Z sage: x._new_constant_poly(2/1,R) ## line 1984 ##
2024-12-05T02:32:18.1427706Z 2
2024-12-05T02:32:18.1428149Z sage: sig_on_count() # check sig_on/off pairings (virtual doctest) ## line 1986 ##
2024-12-05T02:32:18.1428715Z 0
2024-12-05T02:32:18.1428991Z sage: P.<x,y,z> = QQ[] ## line 2007 ##
2024-12-05T02:32:18.1429619Z sage: f = 3/2*x^2*y + 1/7 * y^2 + 13/27 ## line 2008 ##
2024-12-05T02:32:18.1430073Z sage: f(0,0,0) ## line 2009 ##
2024-12-05T02:32:18.1430417Z 13/27
2024-12-05T02:32:18.1430686Z sage: f(1,1,1) ## line 2012 ##
2024-12-05T02:32:18.1431023Z 803/378
2024-12-05T02:32:18.1431304Z sage: 3/2 + 1/7 + 13/27 ## line 2014 ##
2024-12-05T02:32:18.1431674Z 803/378
2024-12-05T02:32:18.1431949Z sage: f(45/2,19/3,1) ## line 2017 ##
2024-12-05T02:32:18.1432312Z 7281167/1512
2024-12-05T02:32:18.1432608Z sage: f(1,2,3).parent() ## line 2020 ##
2024-12-05T02:32:18.1432993Z Rational Field
2024-12-05T02:32:18.1433310Z sage: P.<x,y,z> = QQ[] ## line 2025 ##
2024-12-05T02:32:18.1433703Z sage: P(0)(1,2,3) ## line 2026 ##
2024-12-05T02:32:18.1434057Z 0
2024-12-05T02:32:18.1434319Z sage: P(3/2)(1,2,3) ## line 2028 ##
2024-12-05T02:32:18.1434678Z 3/2
2024-12-05T02:32:18.1434955Z sage: R.<a,b,y> = QQ[] ## line 2031 ##
2024-12-05T02:32:18.1435379Z sage: f = a*y^3 + b*y - 3*a*b*y ## line 2032 ##
2024-12-05T02:32:18.1435817Z sage: f(a=5,b=3,y=10) ## line 2033 ##
2024-12-05T02:32:18.1436192Z 4580
2024-12-05T02:32:18.1436453Z sage: f(5,3,10) ## line 2035 ##
2024-12-05T02:32:18.1436795Z 4580
2024-12-05T02:32:18.1437077Z sage: x = polygen(QQ) ## line 2041 ##
2024-12-05T02:32:18.1437514Z sage: K.<t> = NumberField(x^2 + 47) ## line 2042 ##
2024-12-05T02:32:18.1437959Z sage: R.<X,Y,Z> = K[] ## line 2043 ##
2024-12-05T02:32:18.1438350Z sage: f = X + Y + Z ## line 2044 ##
2024-12-05T02:32:18.1438736Z sage: a = f(t, t, t); a ## line 2045 ##
2024-12-05T02:32:18.1439110Z 3*t
2024-12-05T02:32:18.1439398Z sage: a.parent() is K ## line 2047 ##
2024-12-05T02:32:18.1439768Z True
2024-12-05T02:32:18.1440038Z sage: R.<X,Y,Z> = QQ[] ## line 2050 ##
2024-12-05T02:32:18.1440427Z sage: f = X+Y+Z ## line 2051 ##
2024-12-05T02:32:18.1440789Z sage: a = f(2,3,4); a ## line 2052 ##
2024-12-05T02:32:18.1441306Z 9
2024-12-05T02:32:18.1441595Z sage: a.parent() is QQ ## line 2054 ##
2024-12-05T02:32:18.1441978Z True
2024-12-05T02:32:18.1442254Z sage: k.<a> = GF(2^4) ## line 2060 ##
2024-12-05T02:32:18.1442692Z sage: R.<x> = PolynomialRing(k, 1) ## line 2061 ##
2024-12-05T02:32:18.1443136Z sage: f = R(1) ## line 2062 ##
2024-12-05T02:32:18.1443537Z sage: S.<y> = PolynomialRing(k, 1) ## line 2063 ##
2024-12-05T02:32:18.1443974Z sage: f(y).parent() ## line 2064 ##
2024-12-05T02:32:18.1444519Z Multivariate Polynomial Ring in y over Finite Field in a of size 2^4
2024-12-05T02:32:18.1445254Z sage: sig_on_count() # check sig_on/off pairings (virtual doctest) ## line 2066 ##
2024-12-05T02:32:18.1445819Z 0
2024-12-05T02:32:18.1446086Z sage: R.<x>=QQ[] ## line 2122 ##
2024-12-05T02:32:18.1446463Z sage: S.<x,y>=QQ[] ## line 2123 ##
2024-12-05T02:32:18.1447026Z sage: hash(S(1/2))==hash(1/2)  # respect inclusions of the rationals ## line 2124 ##
2024-12-05T02:32:18.1447598Z True
2024-12-05T02:32:18.1448045Z sage: hash(S.0)==hash(R.0)  # respect inclusions into mpoly rings ## line 2126 ##
2024-12-05T02:32:18.1448606Z True
2024-12-05T02:32:18.1448890Z sage: d={S.0:12} ## line 2129 ##
2024-12-05T02:32:18.1449268Z sage: d[R.0] ## line 2130 ##
2024-12-05T02:32:18.1449762Z 12
2024-12-05T02:32:18.1450225Z sage: sig_on_count() # check sig_on/off pairings (virtual doctest) ## line 2132 ##
2024-12-05T02:32:18.1450614Z 0
2024-12-05T02:32:18.1450853Z sage: P.<x,y,z> = PolynomialRing(QQ,order='degrevlex') ## line 2141 ##
2024-12-05T02:32:18.1451160Z sage: x == x ## line 2142 ##
2024-12-05T02:32:18.1451362Z True
2024-12-05T02:32:18.1451527Z sage: x > y ## line 2145 ##
2024-12-05T02:32:18.1451734Z True
2024-12-05T02:32:18.1451900Z sage: y^2 > x ## line 2147 ##
2024-12-05T02:32:18.1452104Z True
2024-12-05T02:32:18.1452303Z sage: (2/3*x^2 + 1/2*y + 3) > (2/3*x^2 + 1/4*y + 10) ## line 2150 ##
2024-12-05T02:32:18.1452565Z True
2024-12-05T02:32:18.1452803Z sage: P.<x,y,z> = PolynomialRing(QQ, order='degrevlex') ## line 2155 ##
2024-12-05T02:32:18.1453121Z sage: x > P(0) ## line 2156 ##
2024-12-05T02:32:18.1453331Z True
2024-12-05T02:32:18.1453499Z sage: P(0) == P(0) ## line 2159 ##
2024-12-05T02:32:18.1453720Z True
2024-12-05T02:32:18.1454016Z sage: P(0) < P(1) ## line 2162 ##
2024-12-05T02:32:18.1454238Z True
2024-12-05T02:32:18.1454402Z sage: x > P(1) ## line 2165 ##
2024-12-05T02:32:18.1454600Z True
2024-12-05T02:32:18.1454766Z sage: 1/2*x < 3/4*x ## line 2168 ##
2024-12-05T02:32:18.1454987Z True
2024-12-05T02:32:18.1455151Z sage: (x+1) > x ## line 2171 ##
2024-12-05T02:32:18.1455354Z True
2024-12-05T02:32:18.1455537Z sage: f = 3/4*x^2*y + 1/2*x + 2/7 ## line 2174 ##
2024-12-05T02:32:18.1455791Z sage: f > f ## line 2175 ##
2024-12-05T02:32:18.1455989Z False
2024-12-05T02:32:18.1456157Z sage: f < f ## line 2177 ##
2024-12-05T02:32:18.1456351Z False
2024-12-05T02:32:18.1456513Z sage: f == f ## line 2179 ##
2024-12-05T02:32:18.1456710Z True
2024-12-05T02:32:18.1456962Z sage: P.<x,y,z> = PolynomialRing(GF(127), order='degrevlex') ## line 2182 ##
2024-12-05T02:32:18.1457313Z sage: (66*x^2 + 23) > (66*x^2 + 2) ## line 2183 ##
2024-12-05T02:32:18.1457560Z True
2024-12-05T02:32:18.1457826Z sage: sig_on_count() # check sig_on/off pairings (virtual doctest) ## line 2185 ##
2024-12-05T02:32:18.1458176Z 0
2024-12-05T02:32:18.1458388Z sage: P.<x,y,z>=PolynomialRing(QQ,3) ## line 2199 ##
2024-12-05T02:32:18.1458707Z sage: 3/2*x + 1/2*y + 1 #indirect doctest ## line 2200 ##
2024-12-05T02:32:18.1458973Z 3/2*x + 1/2*y + 1
2024-12-05T02:32:18.1459256Z sage: sig_on_count() # check sig_on/off pairings (virtual doctest) ## line 2202 ##
2024-12-05T02:32:18.1459585Z 0
2024-12-05T02:32:18.1459791Z sage: P.<x,y,z>=PolynomialRing(QQ,3) ## line 2215 ##
2024-12-05T02:32:18.1460100Z sage: 3/2*x - 1/2*y - 1 #indirect doctest ## line 2216 ##
2024-12-05T02:32:18.1460370Z 3/2*x - 1/2*y - 1
2024-12-05T02:32:18.1460653Z sage: sig_on_count() # check sig_on/off pairings (virtual doctest) ## line 2218 ##
2024-12-05T02:32:18.1460977Z 0
2024-12-05T02:32:18.1461171Z sage: P.<x,y,z>=PolynomialRing(QQ,3) ## line 2232 ##
2024-12-05T02:32:18.1461536Z sage: 3/2*x # indirect doctest ## line 2233 ##
2024-12-05T02:32:18.1461783Z 3/2*x
2024-12-05T02:32:18.1461983Z sage: P.<x,y,z>=PolynomialRing(QQ,3) ## line 2238 ##
2024-12-05T02:32:18.1462304Z sage: (3/2*x - 1/2*y - 1) * (3/2) # indirect doctest ## line 2239 ##
2024-12-05T02:32:18.1462583Z 9/4*x - 3/4*y - 3/2
2024-12-05T02:32:18.1462870Z sage: sig_on_count() # check sig_on/off pairings (virtual doctest) ## line 2241 ##
2024-12-05T02:32:18.1463193Z 0
2024-12-05T02:32:18.1463387Z sage: P.<x,y,z>=PolynomialRing(QQ,3) ## line 2256 ##
2024-12-05T02:32:18.1463706Z sage: (3/2*x - 1/2*y - 1) * (3/2*x + 1/2*y + 1) # indirect doctest ## line 2257 ##
2024-12-05T02:32:18.1464000Z 9/4*x^2 - 1/4*y^2 - y - 1
2024-12-05T02:32:18.1464264Z sage: P.<x,y> = PolynomialRing(QQ,order='lex') ## line 2260 ##
2024-12-05T02:32:18.1464794Z sage: (x^2^32) * x^2^32 ## line 2261 ##
2024-12-05T02:32:18.1465382Z sage: sig_on_count() # check sig_on/off pairings (virtual doctest) ## line 2265 ##
2024-12-05T02:32:18.1465960Z 0
2024-12-05T02:32:18.1466167Z sage: R.<x,y>=PolynomialRing(QQ,2) ## line 2280 ##
2024-12-05T02:32:18.1466485Z sage: f = (x + y)/3 # indirect doctest ## line 2281 ##
2024-12-05T02:32:18.1467042Z sage: f.parent() ## line 2282 ##
2024-12-05T02:32:18.1467415Z Multivariate Polynomial Ring in x, y over Rational Field
2024-12-05T02:32:18.1467744Z sage: R.<x,y>=PolynomialRing(QQ,2) ## line 2289 ##
2024-12-05T02:32:18.1468010Z sage: f = x^3 + y ## line 2290 ##
2024-12-05T02:32:18.1468236Z sage: g = x ## line 2291 ##
2024-12-05T02:32:18.1468450Z sage: h = f/g; h ## line 2292 ##
2024-12-05T02:32:18.1468661Z (x^3 + y)/x
2024-12-05T02:32:18.1468843Z sage: h.parent() ## line 2294 ##
2024-12-05T02:32:18.1469182Z Fraction Field of Multivariate Polynomial Ring in x, y over Rational Field
2024-12-05T02:32:18.1469535Z sage: R.<x,y> = ZZ[] ## line 2300 ##
2024-12-05T02:32:18.1469769Z sage: f = (x + y)/3 ## line 2301 ##
2024-12-05T02:32:18.1469995Z sage: f.parent() ## line 2302 ##
2024-12-05T02:32:18.1470282Z Multivariate Polynomial Ring in x, y over Rational Field
2024-12-05T02:32:18.1470580Z sage: f = (x + y) * 1/3 ## line 2304 ##
2024-12-05T02:32:18.1470818Z sage: f.parent() ## line 2305 ##
2024-12-05T02:32:18.1471315Z Multivariate Polynomial Ring in x, y over Rational Field
2024-12-05T02:32:18.1471621Z sage: f = x/y ## line 2311 ##
2024-12-05T02:32:18.1471847Z sage: f.parent() ## line 2312 ##
2024-12-05T02:32:18.1472180Z Fraction Field of Multivariate Polynomial Ring in x, y over Integer Ring
2024-12-05T02:32:18.1472541Z sage: P.<x,y> = Zmod(1024)[] ## line 2317 ##
2024-12-05T02:32:18.1472795Z sage: x/P(3) ## line 2318 ##
2024-12-05T02:32:18.1473009Z sage: x/3 ## line 2323 ##
2024-12-05T02:32:18.1473245Z sage: R.<x,y>=PolynomialRing(QQ,2) ## line 2330 ##
2024-12-05T02:32:18.1473509Z sage: x/0 ## line 2331 ##
2024-12-05T02:32:18.1473776Z sage: R.<x,y> = PolynomialRing(QQ, order='neglex') ## line 2338 ##
2024-12-05T02:32:18.1474076Z sage: f = 1 + y ## line 2339 ##
2024-12-05T02:32:18.1474297Z sage: g = 1 + x ## line 2340 ##
2024-12-05T02:32:18.1474514Z sage: h = f/g ## line 2341 ##
2024-12-05T02:32:18.1474732Z sage: h*g == f ## line 2342 ##
2024-12-05T02:32:18.1474939Z True
2024-12-05T02:32:18.1475225Z sage: sig_on_count() # check sig_on/off pairings (virtual doctest) ## line 2344 ##
2024-12-05T02:32:18.1475565Z 0
2024-12-05T02:32:18.1475771Z sage: R.<x,y> = PolynomialRing(QQ,2) ## line 2366 ##
2024-12-05T02:32:18.1476040Z sage: f = x^3 + y ## line 2367 ##
2024-12-05T02:32:18.1476267Z sage: f^2 ## line 2368 ##
2024-12-05T02:32:18.1476471Z x^6 + 2*x^3*y + y^2
2024-12-05T02:32:18.1476666Z sage: g = f^(-1); g ## line 2370 ##
2024-12-05T02:32:18.1476891Z 1/(x^3 + y)
2024-12-05T02:32:18.1477072Z sage: type(g) ## line 2372 ##
2024-12-05T02:32:18.1477379Z <class 'sage.rings.fraction_field_element.FractionFieldElement'>
2024-12-05T02:32:18.1477755Z sage: P.<x,y> = PolynomialRing(ZZ) ## line 2375 ##
2024-12-05T02:32:18.1478034Z sage: P(2)**(-1) ## line 2376 ##
2024-12-05T02:32:18.1478244Z 1/2
2024-12-05T02:32:18.1478527Z sage: P.<u,v> = PolynomialRing(QQ, 2) ## line 2379 ##
2024-12-05T02:32:18.1478797Z sage: u^(1/2) ## line 2380 ##
2024-12-05T02:32:18.1479062Z sage: P.<x,y> = PolynomialRing(QQ,order='lex') ## line 2385 ##
2024-12-05T02:32:18.1479359Z sage: (x+y^2^32)^10 ## line 2386 ##
2024-12-05T02:32:18.1479593Z sage: P.<R, S> = ZZ[] ## line 2394 ##
2024-12-05T02:32:18.1479858Z sage: (R^3 + 6*R^2*S + 12*R*S^2 + 8*S^3)^(1/3) ## line 2395 ##
2024-12-05T02:32:18.1480117Z R + 2*S
2024-12-05T02:32:18.1480292Z sage: _.parent() ## line 2397 ##
2024-12-05T02:32:18.1480571Z Multivariate Polynomial Ring in R, S over Integer Ring
2024-12-05T02:32:18.1480857Z sage: P(4)^(1/2) ## line 2399 ##
2024-12-05T02:32:18.1481062Z 2
2024-12-05T02:32:18.1481223Z sage: _.parent() ## line 2401 ##
2024-12-05T02:32:18.1481493Z Multivariate Polynomial Ring in R, S over Integer Ring
2024-12-05T02:32:18.1481776Z sage: (R^2 + 3)^(1/2) ## line 2404 ##
2024-12-05T02:32:18.1482011Z sage: P(2)^P(2) ## line 2408 ##
2024-12-05T02:32:18.1482220Z 4
2024-12-05T02:32:18.1482385Z sage: (R + 1)^P(2) ## line 2410 ##
2024-12-05T02:32:18.1482606Z R^2 + 2*R + 1
2024-12-05T02:32:18.1482785Z sage: (R + 1)^R ## line 2412 ##
2024-12-05T02:32:18.1483085Z sage: 2^R ## line 2416 ##
2024-12-05T02:32:18.1483333Z sage: R.<x,y,z> = PolynomialRing(ZZ) ## line 2423 ##
2024-12-05T02:32:18.1483618Z sage: pow(x + y + z, 2, x) ## line 2424 ##
2024-12-05T02:32:18.1483961Z sage: sig_on_count() # check sig_on/off pairings (virtual doctest) ## line 2428 ##
2024-12-05T02:32:18.1484289Z 0
2024-12-05T02:32:18.1484486Z sage: R.<x,y>=PolynomialRing(QQ,2) ## line 2466 ##
2024-12-05T02:32:18.1484747Z sage: f = x^3 + y ## line 2467 ##
2024-12-05T02:32:18.1484992Z sage: -f ## line 2468 ##
2024-12-05T02:32:18.1485340Z -x^3 - y
2024-12-05T02:32:18.1485805Z sage: sig_on_count() # check sig_on/off pairings (virtual doctest) ## line 2470 ##
2024-12-05T02:32:18.1486374Z 0
2024-12-05T02:32:18.1486695Z sage: R.<x,y>=PolynomialRing(QQ,2) ## line 2481 ##
2024-12-05T02:32:18.1487137Z sage: f = x^3 + y ## line 2482 ##
2024-12-05T02:32:18.1487551Z sage: f # indirect doctest ## line 2483 ##
2024-12-05T02:32:18.1488001Z x^3 + y
2024-12-05T02:32:18.1488642Z sage: sig_on_count() # check sig_on/off pairings (virtual doctest) ## line 2485 ##
2024-12-05T02:32:18.1489257Z 0
2024-12-05T02:32:18.1489591Z sage: R.<x,y>=PolynomialRing(QQ,2) ## line 2497 ##
2024-12-05T02:32:18.1490053Z sage: f = x^3 + y ## line 2498 ##
2024-12-05T02:32:18.1490450Z sage: f._repr_short_() ## line 2499 ##
2024-12-05T02:32:18.1490848Z 'x3+y'
2024-12-05T02:32:18.1491309Z sage: sig_on_count() # check sig_on/off pairings (virtual doctest) ## line 2501 ##
2024-12-05T02:32:18.1491887Z 0
2024-12-05T02:32:18.1492178Z sage: P.<x,y,z> = QQ[] ## line 2518 ##
2024-12-05T02:32:18.1492624Z sage: f = - 1*x^2*y - 25/27 * y^3 - z^2 ## line 2519 ##
2024-12-05T02:32:18.1493116Z sage: latex(f)  # indirect doctest ## line 2520 ##
2024-12-05T02:32:18.1493569Z -x^{2} y - \frac{25}{27} y^{3} - z^{2}
2024-12-05T02:32:18.1494136Z sage: sig_on_count() # check sig_on/off pairings (virtual doctest) ## line 2522 ##
2024-12-05T02:32:18.1494704Z 0
2024-12-05T02:32:18.1494987Z sage: P.<x,y,z> = QQ[] ## line 2535 ##
2024-12-05T02:32:18.1495439Z sage: f = - 1*x^2*y - 25/27 * y^3 - z^2 ## line 2536 ##
2024-12-05T02:32:18.1496089Z sage: print(f._repr_with_changed_varnames(['FOO', 'BAR', 'FOOBAR'])) ## line 2537 ##
2024-12-05T02:32:18.1496713Z -FOO^2*BAR - 25/27*BAR^3 - FOOBAR^2
2024-12-05T02:32:18.1497283Z sage: sig_on_count() # check sig_on/off pairings (virtual doctest) ## line 2539 ##
2024-12-05T02:32:18.1497847Z 0
2024-12-05T02:32:18.1498120Z sage: R.<x, y> = QQ[] ## line 2562 ##
2024-12-05T02:32:18.1498526Z sage: f = y^2 - x^9 - x ## line 2563 ##
2024-12-05T02:32:18.1498930Z sage: f.degree(x) ## line 2564 ##
2024-12-05T02:32:18.1499293Z 9
2024-12-05T02:32:18.1499566Z sage: f.degree(y) ## line 2566 ##
2024-12-05T02:32:18.1499933Z 2
2024-12-05T02:32:18.1500278Z sage: (y^10*x - 7*x^2*y^5 + 5*x^3).degree(x) ## line 2568 ##
2024-12-05T02:32:18.1500734Z 3
2024-12-05T02:32:18.1501185Z sage: (y^10*x - 7*x^2*y^5 + 5*x^3).degree(y) ## line 2570 ##
2024-12-05T02:32:18.1501627Z 10
2024-12-05T02:32:18.1501976Z sage: T = TermOrder("wdegrevlex", (2, 3)) ## line 2576 ##
2024-12-05T02:32:18.1502542Z sage: R.<x, y> = PolynomialRing(QQ, order=T) ## line 2577 ##
2024-12-05T02:32:18.1503022Z sage: f = x^2 * y + y^4 ## line 2578 ##
2024-12-05T02:32:18.1503429Z sage: f.degree() ## line 2579 ##
2024-12-05T02:32:18.1503787Z 12
2024-12-05T02:32:18.1504064Z sage: f.degree(x) ## line 2581 ##
2024-12-05T02:32:18.1504402Z 2
2024-12-05T02:32:18.1504653Z sage: f.degree(y) ## line 2583 ##
2024-12-05T02:32:18.1504977Z 4
2024-12-05T02:32:18.1505295Z sage: T = TermOrder('wdegrevlex', (1,2,3,4)) ## line 2589 ##
2024-12-05T02:32:18.1505891Z sage: R = PolynomialRing(QQ, 'x', 12, order=T+T+T) ## line 2590 ##
2024-12-05T02:32:18.1506417Z sage: [x.degree() for x in R.gens()] ## line 2591 ##
2024-12-05T02:32:18.1507099Z [1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4]
2024-12-05T02:32:18.1507517Z sage: m = matrix(3, [3,2,1,1,1,0,1,0,0]) ## line 2597 ##
2024-12-05T02:32:18.1507968Z sage: m ## line 2598 ##
2024-12-05T02:32:18.1508288Z [3 2 1]
2024-12-05T02:32:18.1508548Z [1 1 0]
2024-12-05T02:32:18.1508799Z [1 0 0]
2024-12-05T02:32:18.1509346Z sage: R.<x,y,z> = PolynomialRing(QQ, order=TermOrder(m)) ## line 2602 ##
2024-12-05T02:32:18.1510001Z sage: x.degree(), y.degree(), z.degree() ## line 2603 ##
2024-12-05T02:32:18.1510470Z (3, 2, 1)
2024-12-05T02:32:18.1510774Z sage: f = x^3*y + x*z^4 ## line 2605 ##
2024-12-05T02:32:18.1511180Z sage: f.degree() ## line 2606 ##
2024-12-05T02:32:18.1511528Z 11
2024-12-05T02:32:18.1511854Z sage: m = matrix(3, [3,0,1,1,1,0,1,0,0]) ## line 2611 ##
2024-12-05T02:32:18.1512297Z sage: m ## line 2612 ##
2024-12-05T02:32:18.1512609Z [3 0 1]
2024-12-05T02:32:18.1512869Z [1 1 0]
2024-12-05T02:32:18.1513119Z [1 0 0]
2024-12-05T02:32:18.1513518Z sage: R.<x,y,z> = PolynomialRing(QQ, order=TermOrder(m)) ## line 2616 ##
2024-12-05T02:32:18.1514124Z sage: x.degree(), y.degree(), z.degree() ## line 2617 ##
2024-12-05T02:32:18.1514584Z (1, 1, 1)
2024-12-05T02:32:18.1514870Z sage: f = x^3*y + x*z^4 ## line 2619 ##
2024-12-05T02:32:18.1515257Z sage: f.degree() ## line 2620 ##
2024-12-05T02:32:18.1515604Z 5
2024-12-05T02:32:18.1516118Z sage: f.degree(std_grading=True) ## line 2626 ##
2024-12-05T02:32:18.1516547Z 5
2024-12-05T02:32:18.1516822Z sage: P.<x, y> = QQ[] ## line 2631 ##
2024-12-05T02:32:18.1517228Z sage: P(0).degree(x) ## line 2632 ##
2024-12-05T02:32:18.1517600Z -1
2024-12-05T02:32:18.1517879Z sage: P(1).degree(x) ## line 2634 ##
2024-12-05T02:32:18.1518244Z 0
2024-12-05T02:32:18.1518525Z sage: R.<p,q,t> = ZZ[] ## line 2639 ##
2024-12-05T02:32:18.1518941Z sage: poly = p + q^2 + t^3 ## line 2640 ##
2024-12-05T02:32:18.1519411Z sage: poly = poly.polynomial(t)[0] ## line 2641 ##
2024-12-05T02:32:18.1519877Z sage: poly ## line 2642 ##
2024-12-05T02:32:18.1520220Z q^2 + p
2024-12-05T02:32:18.1520508Z sage: poly.degree(q) ## line 2648 ##
2024-12-05T02:32:18.1520993Z sage: poly.degree(poly.parent()(q)) ## line 2657 ##
2024-12-05T02:32:18.1521464Z 2
2024-12-05T02:32:18.1521803Z sage: poly.degree(poly.parent()(p)) ## line 2659 ##
2024-12-05T02:32:18.1522250Z 1
2024-12-05T02:32:18.1522524Z sage: T.<x,y> = ZZ[] ## line 2661 ##
2024-12-05T02:32:18.1523163Z sage: poly.degree(poly.parent()(x))  # noncanonical coercions can be confusing ## line 2662 ##
2024-12-05T02:32:18.1523785Z 1
2024-12-05T02:32:18.1524088Z sage: pp = poly.parent().gen(0) ## line 2667 ##
2024-12-05T02:32:18.1524537Z sage: poly.degree(pp) ## line 2668 ##
2024-12-05T02:32:18.1524910Z 1
2024-12-05T02:32:18.1525191Z sage: poly.degree(pp+1) ## line 2670 ##
2024-12-05T02:32:18.1525601Z sage: S = ZZ['p,q'] ## line 2677 ##
2024-12-05T02:32:18.1525998Z sage: poly.degree(S.0) ## line 2678 ##
2024-12-05T02:32:18.1526374Z 1
2024-12-05T02:32:18.1526644Z sage: poly.degree(S.1) ## line 2680 ##
2024-12-05T02:32:18.1527016Z 2
2024-12-05T02:32:18.1527277Z sage: R.<x, y> = QQ[] ## line 2685 ##
2024-12-05T02:32:18.1527661Z sage: f = x + y + 1 ## line 2686 ##
2024-12-05T02:32:18.1528154Z sage: type(f.degree()) ## line 2687 ##
2024-12-05T02:32:18.1528565Z <class 'sage.rings.integer.Integer'>
2024-12-05T02:32:18.1528980Z sage: type(f.degree(x)) ## line 2689 ##
2024-12-05T02:32:18.1529410Z <class 'sage.rings.integer.Integer'>
2024-12-05T02:32:18.1529828Z sage: type(f.degree(y)) ## line 2691 ##
2024-12-05T02:32:18.1530251Z <class 'sage.rings.integer.Integer'>
2024-12-05T02:32:18.1530825Z sage: sig_on_count() # check sig_on/off pairings (virtual doctest) ## line 2693 ##
2024-12-05T02:32:18.1531396Z 0
2024-12-05T02:32:18.1531669Z sage: R.<x,y,z> = QQ[] ## line 2718 ##
2024-12-05T02:32:18.1532059Z sage: f = 2*x*y^3*z^2 ## line 2719 ##
2024-12-05T02:32:18.1532453Z sage: f.total_degree() ## line 2720 ##
2024-12-05T02:32:18.1532825Z 6
2024-12-05T02:32:18.1533095Z sage: f = 4*x^2*y^2*z^3 ## line 2722 ##
2024-12-05T02:32:18.1533495Z sage: f.total_degree() ## line 2723 ##
2024-12-05T02:32:18.1533869Z 7
2024-12-05T02:32:18.1534146Z sage: f = 99*x^6*y^3*z^9 ## line 2725 ##
2024-12-05T02:32:18.1534573Z sage: f.total_degree() ## line 2726 ##
2024-12-05T02:32:18.1534686Z 18
2024-12-05T02:32:18.1534839Z sage: f = x*y^3*z^6+3*x^2 ## line 2728 ##
2024-12-05T02:32:18.1534984Z sage: f.total_degree() ## line 2729 ##
2024-12-05T02:32:18.1535203Z 10
2024-12-05T02:32:18.1535348Z sage: f = z^3+8*x^4*y^5*z ## line 2731 ##
2024-12-05T02:32:18.1535499Z sage: f.total_degree() ## line 2732 ##
2024-12-05T02:32:18.1535610Z 10
2024-12-05T02:32:18.1535762Z sage: f = z^9+10*x^4+y^8*x^2 ## line 2734 ##
2024-12-05T02:32:18.1535908Z sage: f.total_degree() ## line 2735 ##
2024-12-05T02:32:18.1536017Z 10
2024-12-05T02:32:18.1536274Z sage: tord = TermOrder(matrix(3, [3,2,1,1,1,0,1,0,0])) ## line 2741 ##
2024-12-05T02:32:18.1536401Z sage: tord ## line 2742 ##
2024-12-05T02:32:18.1536541Z Matrix term order with matrix
2024-12-05T02:32:18.1536648Z [3 2 1]
2024-12-05T02:32:18.1536762Z [1 1 0]
2024-12-05T02:32:18.1536869Z [1 0 0]
2024-12-05T02:32:18.1537093Z sage: R.<x,y,z> = PolynomialRing(QQ, order=tord) ## line 2747 ##
2024-12-05T02:32:18.1537224Z sage: f = x^2*y ## line 2748 ##
2024-12-05T02:32:18.1537368Z sage: f.total_degree() ## line 2749 ##
2024-12-05T02:32:18.1537473Z 8
2024-12-05T02:32:18.1537816Z sage: f.total_degree(std_grading=True) ## line 2751 ##
2024-12-05T02:32:18.1537931Z 3
2024-12-05T02:32:18.1538066Z sage: R.<x,y,z> = QQ[] ## line 2756 ##
2024-12-05T02:32:18.1538213Z sage: R(0).total_degree() ## line 2757 ##
2024-12-05T02:32:18.1538315Z -1
2024-12-05T02:32:18.1538457Z sage: R(1).total_degree() ## line 2759 ##
2024-12-05T02:32:18.1538562Z 0
2024-12-05T02:32:18.1538697Z sage: R.<x,y,z> = QQ[] ## line 2763 ##
2024-12-05T02:32:18.1538826Z sage: f = x^4 + y + z ## line 2764 ##
2024-12-05T02:32:18.1538966Z sage: f.total_degree() ## line 2765 ##
2024-12-05T02:32:18.1539071Z 4
2024-12-05T02:32:18.1539231Z sage: type(f.total_degree()) ## line 2767 ##
2024-12-05T02:32:18.1539378Z <class 'sage.rings.integer.Integer'>
2024-12-05T02:32:18.1539680Z sage: sig_on_count() # check sig_on/off pairings (virtual doctest) ## line 2769 ##
2024-12-05T02:32:18.1539790Z 0
2024-12-05T02:32:18.1539992Z sage: R.<y0,y1,y2> = PolynomialRing(QQ,3) ## line 2790 ##
2024-12-05T02:32:18.1540134Z sage: q = 3*y0*y1*y1*y2; q ## line 2791 ##
2024-12-05T02:32:18.1540252Z 3*y0*y1^2*y2
2024-12-05T02:32:18.1540392Z sage: q.degrees() ## line 2793 ##
2024-12-05T02:32:18.1540499Z (1, 2, 1)
2024-12-05T02:32:18.1540650Z sage: (q + y0^5).degrees() ## line 2795 ##
2024-12-05T02:32:18.1540755Z (5, 2, 1)
2024-12-05T02:32:18.1540888Z sage: R.<x,y,z> = QQ[] ## line 2802 ##
2024-12-05T02:32:18.1541014Z sage: f = x^4 + y + z ## line 2803 ##
2024-12-05T02:32:18.1541145Z sage: f.degrees() ## line 2804 ##
2024-12-05T02:32:18.1541248Z (4, 1, 1)
2024-12-05T02:32:18.1541393Z sage: type(f.degrees()[0]) ## line 2806 ##
2024-12-05T02:32:18.1541541Z <class 'sage.rings.integer.Integer'>
2024-12-05T02:32:18.1541845Z sage: sig_on_count() # check sig_on/off pairings (virtual doctest) ## line 2808 ##
2024-12-05T02:32:18.1541954Z 0
2024-12-05T02:32:18.1542081Z sage: R.<x,y> = QQ[] ## line 2847 ##
2024-12-05T02:32:18.1542298Z sage: f=x*y+y+5 ## line 2848 ##
2024-12-05T02:32:18.1542475Z sage: f.coefficient({x:0,y:1}) ## line 2849 ##
2024-12-05T02:32:18.1542586Z 1
2024-12-05T02:32:18.1542740Z sage: f.coefficient({x:0}) ## line 2851 ##
2024-12-05T02:32:18.1542852Z y + 5
2024-12-05T02:32:18.1542991Z sage: f=(1+y+y^2)*(1+x+x^2) ## line 2853 ##
2024-12-05T02:32:18.1543140Z sage: f.coefficient({x:0}) ## line 2854 ##
2024-12-05T02:32:18.1543248Z y^2 + y + 1
2024-12-05T02:32:18.1543411Z sage: f.coefficient([0,None]) ## line 2856 ##
2024-12-05T02:32:18.1543519Z y^2 + y + 1
2024-12-05T02:32:18.1543663Z sage: f.coefficient(x) ## line 2858 ##
2024-12-05T02:32:18.1543770Z y^2 + y + 1
2024-12-05T02:32:18.1543966Z sage: x.coefficient(x.exponents()[0]) ## line 2863 ##
2024-12-05T02:32:18.1544069Z 1
2024-12-05T02:32:18.1544214Z sage: f.coefficient([1,0]) ## line 2865 ##
2024-12-05T02:32:18.1544315Z 1
2024-12-05T02:32:18.1544475Z sage: f.coefficient({x:1,y:0}) ## line 2867 ##
2024-12-05T02:32:18.1544583Z 1
2024-12-05T02:32:18.1544847Z sage: f.coefficient(x^0) # outputs the full polynomial ## line 2874 ##
2024-12-05T02:32:18.1545005Z x^2*y^2 + x^2*y + x*y^2 + x^2 + x*y + y^2 + x + y + 1
2024-12-05T02:32:18.1545236Z sage: R.<x,y> = GF(389)[] ## line 2876 ##
2024-12-05T02:32:18.1545367Z sage: f = x*y + 5 ## line 2877 ##
2024-12-05T02:32:18.1545544Z sage: c = f.coefficient({x:0, y:0}); c ## line 2878 ##
2024-12-05T02:32:18.1545653Z 5
2024-12-05T02:32:18.1545781Z sage: parent(c) ## line 2880 ##
2024-12-05T02:32:18.1546058Z Multivariate Polynomial Ring in x, y over Finite Field of size 389
2024-12-05T02:32:18.1546343Z sage: sig_on_count() # check sig_on/off pairings (virtual doctest) ## line 2886 ##
2024-12-05T02:32:18.1546451Z 0
2024-12-05T02:32:18.1546576Z sage: P.<x,y> = QQ[] ## line 2970 ##
2024-12-05T02:32:18.1546706Z sage: f = 2 * x * y ## line 2973 ##
2024-12-05T02:32:18.1547102Z sage: c = f.monomial_coefficient(x*y); c ## line 2974 ##
2024-12-05T02:32:18.1547217Z 2
2024-12-05T02:32:18.1547349Z sage: c.parent() ## line 2976 ##
2024-12-05T02:32:18.1547467Z Rational Field
2024-12-05T02:32:18.1547648Z sage: f = y^2 + y^2*x - x^9 - 7*x + 5*x*y ## line 2979 ##
2024-12-05T02:32:18.1547819Z sage: f.monomial_coefficient(y^2) ## line 2980 ##
2024-12-05T02:32:18.1548115Z 1
2024-12-05T02:32:18.1548291Z sage: f.monomial_coefficient(x*y) ## line 2982 ##
2024-12-05T02:32:18.1548401Z 5
2024-12-05T02:32:18.1548566Z sage: f.monomial_coefficient(x^9) ## line 2984 ##
2024-12-05T02:32:18.1548675Z -1
2024-12-05T02:32:18.1548843Z sage: f.monomial_coefficient(x^10) ## line 2986 ##
2024-12-05T02:32:18.1548949Z 0
2024-12-05T02:32:18.1549236Z sage: sig_on_count() # check sig_on/off pairings (virtual doctest) ## line 2988 ##
2024-12-05T02:32:18.1549345Z 0
2024-12-05T02:32:18.1549474Z sage: R.<x,y,z> = QQ[] ## line 3011 ##
2024-12-05T02:32:18.1549640Z sage: f = 2*x*y^3*z^2 + 1/7*x^2 + 2/3 ## line 3012 ##
2024-12-05T02:32:18.1549807Z sage: f.monomial_coefficients() ## line 3013 ##
2024-12-05T02:32:18.1549932Z {(0, 0, 0): 2/3, (1, 3, 2): 2, (2, 0, 0): 1/7}
2024-12-05T02:32:18.1550067Z sage: f.dict() ## line 3018 ##
2024-12-05T02:32:18.1550194Z {(0, 0, 0): 2/3, (1, 3, 2): 2, (2, 0, 0): 1/7}
2024-12-05T02:32:18.1550491Z sage: sig_on_count() # check sig_on/off pairings (virtual doctest) ## line 3020 ##
2024-12-05T02:32:18.1550598Z 0
2024-12-05T02:32:18.1550733Z sage: R.<a,b,c> = QQ[] ## line 3054 ##
2024-12-05T02:32:18.1550878Z sage: f = a*c^3 + a^2*b + 2*b^4 ## line 3055 ##
2024-12-05T02:32:18.1551056Z sage: list(f.iterator_exp_coeff()) ## line 3056 ##
2024-12-05T02:32:18.1551186Z [((0, 4, 0), 2), ((1, 0, 3), 1), ((2, 1, 0), 1)]
2024-12-05T02:32:18.1551440Z sage: list(f.iterator_exp_coeff(as_ETuples=False)) ## line 3058 ##
2024-12-05T02:32:18.1551566Z [((0, 4, 0), 2), ((1, 0, 3), 1), ((2, 1, 0), 1)]
2024-12-05T02:32:18.1551800Z sage: R.<a,b,c> = PolynomialRing(QQ, 3, order='lex') ## line 3061 ##
2024-12-05T02:32:18.1551947Z sage: f = a*c^3 + a^2*b + 2*b^4 ## line 3062 ##
2024-12-05T02:32:18.1552125Z sage: list(f.iterator_exp_coeff()) ## line 3063 ##
2024-12-05T02:32:18.1552357Z [((2, 1, 0), 1), ((1, 0, 3), 1), ((0, 4, 0), 2)]
2024-12-05T02:32:18.1552649Z sage: sig_on_count() # check sig_on/off pairings (virtual doctest) ## line 3065 ##
2024-12-05T02:32:18.1552756Z 0
2024-12-05T02:32:18.1552895Z sage: R.<x, y> = ZZ[] ## line 3096 ##
2024-12-05T02:32:18.1553022Z sage: f = x^3 - y ## line 3097 ##
2024-12-05T02:32:18.1553167Z sage: f.number_of_terms() ## line 3098 ##
2024-12-05T02:32:18.1553278Z 2
2024-12-05T02:32:18.1553433Z sage: R(0).number_of_terms() ## line 3100 ##
2024-12-05T02:32:18.1553547Z 0
2024-12-05T02:32:18.1553669Z sage: f = (x+y)^100 ## line 3102 ##
2024-12-05T02:32:18.1553815Z sage: f.number_of_terms() ## line 3103 ##
2024-12-05T02:32:18.1553918Z 101
2024-12-05T02:32:18.1554068Z sage: f.hamming_weight() ## line 3108 ##
2024-12-05T02:32:18.1554171Z 101
2024-12-05T02:32:18.1554466Z sage: sig_on_count() # check sig_on/off pairings (virtual doctest) ## line 3110 ##
2024-12-05T02:32:18.1554568Z 0
2024-12-05T02:32:18.1554701Z sage: R.<x, y> = QQ[] ## line 3163 ##
2024-12-05T02:32:18.1554850Z sage: f = -10*x^3*y + 17*x*y ## line 3164 ##
2024-12-05T02:32:18.1554979Z sage: f[3,1] ## line 3165 ##
2024-12-05T02:32:18.1555083Z -10
2024-12-05T02:32:18.1555315Z sage: f[1,1] ## line 3167 ##
2024-12-05T02:32:18.1555428Z 17
2024-12-05T02:32:18.1555548Z sage: f[0,1] ## line 3169 ##
2024-12-05T02:32:18.1555656Z 0
2024-12-05T02:32:18.1555955Z sage: R.<x> = PolynomialRing(GF(7), implementation='singular'); R ## line 3172 ##
2024-12-05T02:32:18.1556216Z Multivariate Polynomial Ring in x over Finite Field of size 7
2024-12-05T02:32:18.1556346Z sage: f = 5*x^2 + 3; f ## line 3174 ##
2024-12-05T02:32:18.1556461Z -2*x^2 + 3
2024-12-05T02:32:18.1556582Z sage: f[2] ## line 3176 ##
2024-12-05T02:32:18.1556692Z 5
2024-12-05T02:32:18.1556982Z sage: sig_on_count() # check sig_on/off pairings (virtual doctest) ## line 3178 ##
2024-12-05T02:32:18.1557092Z 0
2024-12-05T02:32:18.1557332Z sage: R.<x,y,z> = PolynomialRing(QQ, order='degrevlex') ## line 3220 ##
2024-12-05T02:32:18.1557498Z sage: f = 23*x^6*y^7 + x^3*y+6*x^7*z ## line 3221 ##
2024-12-05T02:32:18.1557628Z sage: list(f) ## line 3222 ##
2024-12-05T02:32:18.1557753Z [(23, x^6*y^7), (6, x^7*z), (1, x^3*y)]
2024-12-05T02:32:18.1558039Z sage: list(R.zero()) ## line 3224 ##
2024-12-05T02:32:18.1558147Z []
2024-12-05T02:32:18.1558373Z sage: R.<x,y,z> = PolynomialRing(QQ, order='lex') ## line 3227 ##
2024-12-05T02:32:18.1558531Z sage: f = 23*x^6*y^7 + x^3*y+6*x^7*z ## line 3228 ##
2024-12-05T02:32:18.1558661Z sage: list(f) ## line 3229 ##
2024-12-05T02:32:18.1558789Z [(6, x^7*z), (23, x^6*y^7), (1, x^3*y)]
2024-12-05T02:32:18.1559101Z sage: sig_on_count() # check sig_on/off pairings (virtual doctest) ## line 3231 ##
2024-12-05T02:32:18.1559213Z 0
2024-12-05T02:32:18.1559357Z sage: R.<a,b,c> = QQ[] ## line 3260 ##
2024-12-05T02:32:18.1559501Z sage: f = a^3 + b + 2*b^2 ## line 3261 ##
2024-12-05T02:32:18.1559651Z sage: f.exponents() ## line 3262 ##
2024-12-05T02:32:18.1559772Z [(3, 0, 0), (0, 2, 0), (0, 1, 0)]
2024-12-05T02:32:18.1559966Z sage: f.exponents(as_ETuples=False) ## line 3264 ##
2024-12-05T02:32:18.1560087Z [(3, 0, 0), (0, 2, 0), (0, 1, 0)]
2024-12-05T02:32:18.1560388Z sage: sig_on_count() # check sig_on/off pairings (virtual doctest) ## line 3266 ##
2024-12-05T02:32:18.1560502Z 0
2024-12-05T02:32:18.1560630Z sage: R.<x,y> = QQ[] ## line 3294 ##
2024-12-05T02:32:18.1560780Z sage: x.inverse_of_unit() ## line 3295 ##
2024-12-05T02:32:18.1560942Z sage: R(1/2).inverse_of_unit() ## line 3300 ##
2024-12-05T02:32:18.1561056Z 2
2024-12-05T02:32:18.1561351Z sage: sig_on_count() # check sig_on/off pairings (virtual doctest) ## line 3302 ##
2024-12-05T02:32:18.1561465Z 0
2024-12-05T02:32:18.1561703Z sage: P.<x,y> = PolynomialRing(RationalField(), 2) ## line 3321 ##
2024-12-05T02:32:18.1561864Z sage: (x+y).is_homogeneous() ## line 3322 ##
2024-12-05T02:32:18.1561969Z True
2024-12-05T02:32:18.1562176Z sage: (x.parent()(0)).is_homogeneous() ## line 3324 ##
2024-12-05T02:32:18.1562282Z True
2024-12-05T02:32:18.1562449Z sage: (x+y^2).is_homogeneous() ## line 3326 ##
2024-12-05T02:32:18.1562645Z False
2024-12-05T02:32:18.1562817Z sage: (x^2 + y^2).is_homogeneous() ## line 3328 ##
2024-12-05T02:32:18.1562927Z True
2024-12-05T02:32:18.1563104Z sage: (x^2 + y^2*x).is_homogeneous() ## line 3330 ##
2024-12-05T02:32:18.1563222Z False
2024-12-05T02:32:18.1563401Z sage: (x^2*y + y^2*x).is_homogeneous() ## line 3332 ##
2024-12-05T02:32:18.1563513Z True
2024-12-05T02:32:18.1563810Z sage: sig_on_count() # check sig_on/off pairings (virtual doctest) ## line 3334 ##
2024-12-05T02:32:18.1563923Z 0
2024-12-05T02:32:18.1564053Z sage: P.<x,y> = QQ[] ## line 3355 ##
2024-12-05T02:32:18.1564213Z sage: f = x^2 + y + 1 + 5*x*y^10 ## line 3356 ##
2024-12-05T02:32:18.1564447Z sage: g = f.homogenize('z'); g # indirect doctest ## line 3357 ##
2024-12-05T02:32:18.1564583Z 5*x*y^10 + x^2*z^9 + y*z^10 + z^11
2024-12-05T02:32:18.1564719Z sage: g.parent() ## line 3359 ##
2024-12-05T02:32:18.1564972Z Multivariate Polynomial Ring in x, y, z over Rational Field
2024-12-05T02:32:18.1565118Z sage: f._homogenize(0) ## line 3361 ##
2024-12-05T02:32:18.1565245Z 2*x^11 + x^10*y + 5*x*y^10
2024-12-05T02:32:18.1565547Z sage: sig_on_count() # check sig_on/off pairings (virtual doctest) ## line 3365 ##
2024-12-05T02:32:18.1565755Z 0
2024-12-05T02:32:18.1565941Z sage: P.<x,y,z> = PolynomialRing(QQ) ## line 3386 ##
2024-12-05T02:32:18.1566084Z sage: x.is_monomial() ## line 3387 ##
2024-12-05T02:32:18.1566199Z True
2024-12-05T02:32:18.1566347Z sage: (2*x).is_monomial() ## line 3389 ##
2024-12-05T02:32:18.1566461Z False
2024-12-05T02:32:18.1566610Z sage: (x*y).is_monomial() ## line 3391 ##
2024-12-05T02:32:18.1566724Z True
2024-12-05T02:32:18.1566884Z sage: (x*y + x).is_monomial() ## line 3393 ##
2024-12-05T02:32:18.1566998Z False
2024-12-05T02:32:18.1567147Z sage: P(2).is_monomial() ## line 3395 ##
2024-12-05T02:32:18.1567262Z False
2024-12-05T02:32:18.1567423Z sage: P.zero().is_monomial() ## line 3397 ##
2024-12-05T02:32:18.1567538Z False
2024-12-05T02:32:18.1567838Z sage: sig_on_count() # check sig_on/off pairings (virtual doctest) ## line 3399 ##
2024-12-05T02:32:18.1567955Z 0
2024-12-05T02:32:18.1568138Z sage: P.<x,y,z> = PolynomialRing(QQ) ## line 3429 ##
2024-12-05T02:32:18.1568271Z sage: x.is_term() ## line 3430 ##
2024-12-05T02:32:18.1568555Z True
2024-12-05T02:32:18.1568695Z sage: (2*x).is_term() ## line 3432 ##
2024-12-05T02:32:18.1568811Z True
2024-12-05T02:32:18.1568948Z sage: (x*y).is_term() ## line 3434 ##
2024-12-05T02:32:18.1569060Z True
2024-12-05T02:32:18.1569203Z sage: (x*y + x).is_term() ## line 3436 ##
2024-12-05T02:32:18.1569319Z False
2024-12-05T02:32:18.1569458Z sage: P(2).is_term() ## line 3438 ##
2024-12-05T02:32:18.1569580Z True
2024-12-05T02:32:18.1569732Z sage: P.zero().is_term() ## line 3440 ##
2024-12-05T02:32:18.1569854Z False
2024-12-05T02:32:18.1570167Z sage: sig_on_count() # check sig_on/off pairings (virtual doctest) ## line 3442 ##
2024-12-05T02:32:18.1570283Z 0
2024-12-05T02:32:18.1570422Z sage: R.<x,y> = QQ[] ## line 3467 ##
2024-12-05T02:32:18.1570582Z sage: f = x^2 + y + x^2*y^2 + 5 ## line 3468 ##
2024-12-05T02:32:18.1570731Z sage: f(5,y) ## line 3469 ##
2024-12-05T02:32:18.1570854Z 25*y^2 + y + 30
2024-12-05T02:32:18.1571013Z sage: f.subs({x: 5}) ## line 3471 ##
2024-12-05T02:32:18.1571180Z 25*y^2 + y + 30
2024-12-05T02:32:18.1571410Z sage: f.subs(x=5) ## line 3473 ##
2024-12-05T02:32:18.1571588Z 25*y^2 + y + 30
2024-12-05T02:32:18.1571804Z sage: P.<x,y,z> = PolynomialRing(GF(2), 3) ## line 3476 ##
2024-12-05T02:32:18.1571938Z sage: f = x + y + 1 ## line 3477 ##
2024-12-05T02:32:18.1572099Z sage: f.subs({x:y+1}) ## line 3478 ##
2024-12-05T02:32:18.1572213Z 0
2024-12-05T02:32:18.1572364Z sage: f.subs(x=y) ## line 3480 ##
2024-12-05T02:32:18.1572479Z 1
2024-12-05T02:32:18.1572621Z sage: f.subs(x=x) ## line 3482 ##
2024-12-05T02:32:18.1572744Z x + y + 1
2024-12-05T02:32:18.1572889Z sage: f.subs({x: z}) ## line 3484 ##
2024-12-05T02:32:18.1573016Z y + z + 1
2024-12-05T02:32:18.1573162Z sage: f.subs(x=z + 1) ## line 3486 ##
2024-12-05T02:32:18.1573288Z y + z
2024-12-05T02:32:18.1573537Z sage: f.subs(x=1/y) ## line 3489 ##
2024-12-05T02:32:18.1573663Z (y^2 + y + 1)/y
2024-12-05T02:32:18.1573809Z sage: f.subs({x: 1/y}) ## line 3491 ##
2024-12-05T02:32:18.1573926Z (y^2 + y + 1)/y
2024-12-05T02:32:18.1574067Z sage: R.<x,y>=QQ[] ## line 3496 ##
2024-12-05T02:32:18.1574207Z sage: g=x+y ## line 3497 ##
2024-12-05T02:32:18.1574365Z sage: g.subs({x:x+1,y:x*y}) ## line 3498 ##
2024-12-05T02:32:18.1574491Z x*y + x + 1
2024-12-05T02:32:18.1574675Z sage: g.subs({x:x+1}).subs({y:x*y}) ## line 3500 ##
2024-12-05T02:32:18.1574792Z x*y + x + 1
2024-12-05T02:32:18.1574979Z sage: g.subs({y:x*y}).subs({x:x+1}) ## line 3502 ##
2024-12-05T02:32:18.1575102Z x*y + x + y + 1
2024-12-05T02:32:18.1575248Z sage: R.<x,y> = QQ[] ## line 3507 ##
2024-12-05T02:32:18.1575387Z sage: f = x + 2*y ## line 3508 ##
2024-12-05T02:32:18.1575539Z sage: f.subs(x=y,y=x) ## line 3509 ##
2024-12-05T02:32:18.1575656Z 2*x + y
2024-12-05T02:32:18.1575815Z sage: P.<x,y,z> = QQ[] ## line 3514 ##
2024-12-05T02:32:18.1575951Z sage: f = y ## line 3515 ##
2024-12-05T02:32:18.1576139Z sage: f.subs({y:x}).subs({x:z}) ## line 3516 ##
2024-12-05T02:32:18.1576255Z z
2024-12-05T02:32:18.1576407Z sage: P = QQ['x,y'] ## line 3521 ##
2024-12-05T02:32:18.1576789Z sage: x = var('x')                                                          # needs sage.symbolic ## line 3522 ##
2024-12-05T02:32:18.1577120Z sage: parent(P.zero().subs(x=x))                                            # needs sage.symbolic ## line 3523 ##
2024-12-05T02:32:18.1577250Z Symbolic Ring
2024-12-05T02:32:18.1577392Z sage: R.<x,y> = QQ[] ## line 3528 ##
2024-12-05T02:32:18.1577537Z sage: n=100; f = x^n ## line 3529 ##
2024-12-05T02:32:18.1577659Z sage: try:
2024-12-05T02:32:18.1577796Z     f.subs(x = x^n)
2024-12-05T02:32:18.1577934Z     print("no overflow")
2024-12-05T02:32:18.1578083Z except OverflowError:
2024-12-05T02:32:18.1578232Z     print("overflow") ## line 3530 ##
2024-12-05T02:32:18.1578357Z x^10000
2024-12-05T02:32:18.1578478Z no overflow
2024-12-05T02:32:18.1578619Z sage: n = 100000 ## line 3538 ##
2024-12-05T02:32:18.1578739Z sage: try:
2024-12-05T02:32:18.1578857Z     f = x^n
2024-12-05T02:32:18.1578980Z     f.subs(x = x^n)
2024-12-05T02:32:18.1579111Z     print("no overflow")
2024-12-05T02:32:18.1579419Z except OverflowError:
2024-12-05T02:32:18.1579571Z     print("overflow") ## line 3539 ##
2024-12-05T02:32:18.1579701Z overflow
2024-12-05T02:32:18.1579845Z sage: R.<x,y,z> = QQ[] ## line 3550 ##
2024-12-05T02:32:18.1579982Z sage: for vx in [0,x,y,z]:
2024-12-05T02:32:18.1580106Z     for vy in [0,x,y,z]:
2024-12-05T02:32:18.1580238Z         for vz in [0,x,y,z]:
2024-12-05T02:32:18.1580367Z             d = {x:vx, y:vy, z:vz}
2024-12-05T02:32:18.1580514Z             ds = {'x': vx, 'y': vy, 'z': vz}
2024-12-05T02:32:18.1580671Z             assert x.subs(d) == x.subs(**ds) == vx
2024-12-05T02:32:18.1580830Z             assert y.subs(d) == y.subs(**ds) == vy
2024-12-05T02:32:18.1580985Z             assert z.subs(d) == z.subs(**ds) == vz
2024-12-05T02:32:18.1581228Z             assert (x+y).subs(d) == (x+y).subs(**ds) == vx+vy ## line 3551 ##
2024-12-05T02:32:18.1581502Z sage: F = PolynomialRing(QQ,'c,d').fraction_field() ## line 3563 ##
2024-12-05T02:32:18.1581671Z sage: F.inject_variables() ## line 3564 ##
2024-12-05T02:32:18.1581795Z Defining c, d
2024-12-05T02:32:18.1581931Z sage: R.<x,y,z> = F[] ## line 3566 ##
2024-12-05T02:32:18.1582099Z sage: f = R(d*z^2 + c*y*z^2) ## line 3567 ##
2024-12-05T02:32:18.1582247Z sage: f.subs({x:z^2,y:1}) ## line 3568 ##
2024-12-05T02:32:18.1582368Z (c + d)*z^2
2024-12-05T02:32:18.1582507Z sage: f.subs({z:x+1}) ## line 3570 ##
2024-12-05T02:32:18.1582660Z c*x^2*y + d*x^2 + (2*c)*x*y + (2*d)*x + c*y + d
2024-12-05T02:32:18.1582975Z sage: sig_on_count() # check sig_on/off pairings (virtual doctest) ## line 3572 ##
2024-12-05T02:32:18.1583090Z 0
2024-12-05T02:32:18.1583232Z sage: P.<x,y,z> = QQ[] ## line 3697 ##
2024-12-05T02:32:18.1583394Z sage: f = x + 3/2*y*z^2 + 2/3 ## line 3698 ##
2024-12-05T02:32:18.1583532Z sage: f.monomials() ## line 3699 ##
2024-12-05T02:32:18.1583752Z [y*z^2, x, 1]
2024-12-05T02:32:18.1583889Z sage: f = P(3/2) ## line 3701 ##
2024-12-05T02:32:18.1584033Z sage: f.monomials() ## line 3702 ##
2024-12-05T02:32:18.1584149Z [1]
2024-12-05T02:32:18.1584294Z sage: P.<x,y,z> = QQ[] ## line 3707 ##
2024-12-05T02:32:18.1584430Z sage: f = x ## line 3708 ##
2024-12-05T02:32:18.1584570Z sage: f.monomials() ## line 3709 ##
2024-12-05T02:32:18.1584688Z [x]
2024-12-05T02:32:18.1584821Z sage: f = P(0) ## line 3714 ##
2024-12-05T02:32:18.1584965Z sage: f.monomials() ## line 3715 ##
2024-12-05T02:32:18.1585076Z []
2024-12-05T02:32:18.1585232Z sage: x = polygen(ZZ, 'x') ## line 3720 ##
2024-12-05T02:32:18.1585424Z sage: K.<rho> = NumberField(x**2 + 1) ## line 3721 ##
2024-12-05T02:32:18.1585563Z sage: R.<x,y> = QQ[] ## line 3722 ##
2024-12-05T02:32:18.1585698Z sage: p = rho*x ## line 3723 ##
2024-12-05T02:32:18.1585836Z sage: q = x ## line 3724 ##
2024-12-05T02:32:18.1585975Z sage: p.monomials() ## line 3725 ##
2024-12-05T02:32:18.1586093Z [x]
2024-12-05T02:32:18.1586236Z sage: q.monomials() ## line 3727 ##
2024-12-05T02:32:18.1586349Z [x]
2024-12-05T02:32:18.1586496Z sage: p.monomials() ## line 3729 ##
2024-12-05T02:32:18.1586607Z [x]
2024-12-05T02:32:18.1587225Z sage: sig_on_count() # check sig_on/off pairings (virtual doctest) ## line 3731 ##
2024-12-05T02:32:18.1587339Z 0
2024-12-05T02:32:18.1587480Z sage: P.<x, y> = QQ[] ## line 3757 ##
2024-12-05T02:32:18.1587654Z sage: f = 3*x^2 - 2*y + 7*x^2*y^2 + 5 ## line 3758 ##
2024-12-05T02:32:18.1587834Z sage: f.constant_coefficient() ## line 3759 ##
2024-12-05T02:32:18.1587984Z 5
2024-12-05T02:32:18.1588121Z sage: f = 3*x^2 ## line 3761 ##
2024-12-05T02:32:18.1588293Z sage: f.constant_coefficient() ## line 3762 ##
2024-12-05T02:32:18.1588408Z 0
2024-12-05T02:32:18.1588718Z sage: sig_on_count() # check sig_on/off pairings (virtual doctest) ## line 3764 ##
2024-12-05T02:32:18.1588835Z 0
2024-12-05T02:32:18.1588971Z sage: R.<x, y> = QQ[] ## line 3795 ##
2024-12-05T02:32:18.1589144Z sage: f = 3*x^2 - 2*y + 7*x^2*y^2 + 5 ## line 3796 ##
2024-12-05T02:32:18.1589342Z sage: f.univariate_polynomial() ## line 3797 ##
2024-12-05T02:32:18.1589493Z sage: g = f.subs({x:10}); g ## line 3801 ##
2024-12-05T02:32:18.1589823Z 700*y^2 - 2*y + 305
2024-12-05T02:32:18.1590011Z sage: g.univariate_polynomial () ## line 3803 ##
2024-12-05T02:32:18.1590139Z 700*y^2 - 2*y + 305
2024-12-05T02:32:18.1590429Z sage: g.univariate_polynomial(PolynomialRing(QQ,'z')) ## line 3805 ##
2024-12-05T02:32:18.1590558Z 700*z^2 - 2*z + 305
2024-12-05T02:32:18.1590688Z sage: g = R(1) ## line 3810 ##
2024-12-05T02:32:18.1590890Z sage: h = g.univariate_polynomial(); h ## line 3811 ##
2024-12-05T02:32:18.1591001Z 1
2024-12-05T02:32:18.1591144Z sage: h.parent() ## line 3813 ##
2024-12-05T02:32:18.1591347Z Univariate Polynomial Ring in x over Rational Field
2024-12-05T02:32:18.1591662Z sage: sig_on_count() # check sig_on/off pairings (virtual doctest) ## line 3815 ##
2024-12-05T02:32:18.1591775Z 0
2024-12-05T02:32:18.1591938Z sage: P.<x,y,z> = GF(2)[] ## line 3860 ##
2024-12-05T02:32:18.1592072Z sage: f = x^2 + 1 ## line 3861 ##
2024-12-05T02:32:18.1592220Z sage: f.is_univariate() ## line 3862 ##
2024-12-05T02:32:18.1592335Z True
2024-12-05T02:32:18.1592473Z sage: f = y*x^2 + 1 ## line 3864 ##
2024-12-05T02:32:18.1592620Z sage: f.is_univariate() ## line 3865 ##
2024-12-05T02:32:18.1592733Z False
2024-12-05T02:32:18.1592873Z sage: f = P(0) ## line 3867 ##
2024-12-05T02:32:18.1593024Z sage: f.is_univariate() ## line 3868 ##
2024-12-05T02:32:18.1593142Z True
2024-12-05T02:32:18.1593448Z sage: sig_on_count() # check sig_on/off pairings (virtual doctest) ## line 3870 ##
2024-12-05T02:32:18.1593565Z 0
2024-12-05T02:32:18.1593710Z sage: P.<x,y,z> = GF(2)[] ## line 3885 ##
2024-12-05T02:32:18.1593849Z sage: f = x*z^2 + z + 1 ## line 3886 ##
2024-12-05T02:32:18.1594009Z sage: f._variable_indices_() ## line 3887 ##
2024-12-05T02:32:18.1594135Z [0, 2]
2024-12-05T02:32:18.1594437Z sage: sig_on_count() # check sig_on/off pairings (virtual doctest) ## line 3889 ##
2024-12-05T02:32:18.1594660Z 0
2024-12-05T02:32:18.1594812Z sage: P.<x,y,z> = GF(2)[] ## line 3911 ##
2024-12-05T02:32:18.1594949Z sage: f = x*z^2 + z + 1 ## line 3912 ##
2024-12-05T02:32:18.1595098Z sage: f.variables() ## line 3913 ##
2024-12-05T02:32:18.1595213Z (x, z)
2024-12-05T02:32:18.1595526Z sage: sig_on_count() # check sig_on/off pairings (virtual doctest) ## line 3915 ##
2024-12-05T02:32:18.1595639Z 0
2024-12-05T02:32:18.1595790Z sage: P.<x,y,z> = GF(2)[] ## line 3943 ##
2024-12-05T02:32:18.1595926Z sage: f = x*z^2 + z + 1 ## line 3944 ##
2024-12-05T02:32:18.1596070Z sage: f.variables() ## line 3945 ##
2024-12-05T02:32:18.1596182Z (x, z)
2024-12-05T02:32:18.1596324Z sage: f.variable(1) ## line 3947 ##
2024-12-05T02:32:18.1596435Z z
2024-12-05T02:32:18.1596748Z sage: sig_on_count() # check sig_on/off pairings (virtual doctest) ## line 3949 ##
2024-12-05T02:32:18.1596861Z 0
2024-12-05T02:32:18.1597064Z sage: P.<x,y,z> = PolynomialRing(GF(127)) ## line 3958 ##
2024-12-05T02:32:18.1597202Z sage: f = x*y + z ## line 3959 ##
2024-12-05T02:32:18.1597347Z sage: f.nvariables() ## line 3960 ##
2024-12-05T02:32:18.1597462Z 3
2024-12-05T02:32:18.1597594Z sage: f = x + y ## line 3962 ##
2024-12-05T02:32:18.1597866Z sage: f.nvariables() ## line 3963 ##
2024-12-05T02:32:18.1597983Z 2
2024-12-05T02:32:18.1598310Z sage: sig_on_count() # check sig_on/off pairings (virtual doctest) ## line 3965 ##
2024-12-05T02:32:18.1598427Z 0
2024-12-05T02:32:18.1598638Z sage: P.<x,y,z> = PolynomialRing(GF(127)) ## line 3974 ##
2024-12-05T02:32:18.1598788Z sage: x.is_constant() ## line 3975 ##
2024-12-05T02:32:18.1598903Z False
2024-12-05T02:32:18.1599051Z sage: P(1).is_constant() ## line 3977 ##
2024-12-05T02:32:18.1599170Z True
2024-12-05T02:32:18.1599479Z sage: sig_on_count() # check sig_on/off pairings (virtual doctest) ## line 3979 ##
2024-12-05T02:32:18.1599592Z 0
2024-12-05T02:32:18.1599853Z sage: R.<x,y,z> = PolynomialRing(GF(7), 3, order='lex') ## line 3990 ##
2024-12-05T02:32:18.1600009Z sage: f = x^1*y^2 + y^3*z^4 ## line 3991 ##
2024-12-05T02:32:18.1600153Z sage: f.lm() ## line 3992 ##
2024-12-05T02:32:18.1600265Z x*y^2
2024-12-05T02:32:18.1600436Z sage: f = x^3*y^2*z^4 + x^3*y^2*z^1 ## line 3994 ##
2024-12-05T02:32:18.1600731Z sage: f.lm() ## line 3995 ##
2024-12-05T02:32:18.1600860Z x^3*y^2*z^4
2024-12-05T02:32:18.1601125Z sage: R.<x,y,z>=PolynomialRing(QQ, 3, order='deglex') ## line 3998 ##
2024-12-05T02:32:18.1601302Z sage: f = x^1*y^2*z^3 + x^3*y^2*z^0 ## line 3999 ##
2024-12-05T02:32:18.1601441Z sage: f.lm() ## line 4000 ##
2024-12-05T02:32:18.1601570Z x*y^2*z^3
2024-12-05T02:32:18.1601741Z sage: f = x^1*y^2*z^4 + x^1*y^1*z^5 ## line 4002 ##
2024-12-05T02:32:18.1601882Z sage: f.lm() ## line 4003 ##
2024-12-05T02:32:18.1601994Z x*y^2*z^4
2024-12-05T02:32:18.1602289Z sage: R.<x,y,z>=PolynomialRing(GF(127), 3, order='degrevlex') ## line 4006 ##
2024-12-05T02:32:18.1602457Z sage: f = x^1*y^5*z^2 + x^4*y^1*z^3 ## line 4007 ##
2024-12-05T02:32:18.1602607Z sage: f.lm() ## line 4008 ##
2024-12-05T02:32:18.1602774Z x*y^5*z^2
2024-12-05T02:32:18.1603109Z sage: f = x^4*y^7*z^1 + x^4*y^2*z^3 ## line 4010 ##
2024-12-05T02:32:18.1603253Z sage: f.lm() ## line 4011 ##
2024-12-05T02:32:18.1603374Z x^4*y^7*z
2024-12-05T02:32:18.1603713Z sage: sig_on_count() # check sig_on/off pairings (virtual doctest) ## line 4013 ##
2024-12-05T02:32:18.1603832Z 0
2024-12-05T02:32:18.1604098Z sage: R.<x,y,z> = PolynomialRing(GF(7), 3, order='lex') ## line 4030 ##
2024-12-05T02:32:18.1604261Z sage: f = 3*x^1*y^2 + 2*y^3*z^4 ## line 4031 ##
2024-12-05T02:32:18.1604407Z sage: f.lc() ## line 4032 ##
2024-12-05T02:32:18.1604523Z 3
2024-12-05T02:32:18.1604711Z sage: f = 5*x^3*y^2*z^4 + 4*x^3*y^2*z^1 ## line 4035 ##
2024-12-05T02:32:18.1604851Z sage: f.lc() ## line 4036 ##
2024-12-05T02:32:18.1604973Z 5
2024-12-05T02:32:18.1605289Z sage: sig_on_count() # check sig_on/off pairings (virtual doctest) ## line 4038 ##
2024-12-05T02:32:18.1605408Z 0
2024-12-05T02:32:18.1605663Z sage: R.<x,y,z> = PolynomialRing(GF(7), 3, order='lex') ## line 4064 ##
2024-12-05T02:32:18.1605932Z sage: f = 3*x^1*y^2 + 2*y^3*z^4 ## line 4065 ##
2024-12-05T02:32:18.1606067Z sage: f.lt() ## line 4066 ##
2024-12-05T02:32:18.1606183Z 3*x*y^2
2024-12-05T02:32:18.1606382Z sage: f = 5*x^3*y^2*z^4 + 4*x^3*y^2*z^1 ## line 4069 ##
2024-12-05T02:32:18.1606523Z sage: f.lt() ## line 4070 ##
2024-12-05T02:32:18.1606643Z -2*x^3*y^2*z^4
2024-12-05T02:32:18.1606932Z sage: sig_on_count() # check sig_on/off pairings (virtual doctest) ## line 4072 ##
2024-12-05T02:32:18.1607042Z 0
2024-12-05T02:32:18.1607222Z sage: P.<x,y> = PolynomialRing(QQ) ## line 4083 ##
2024-12-05T02:32:18.1607365Z sage: x.is_zero() ## line 4084 ##
2024-12-05T02:32:18.1607478Z False
2024-12-05T02:32:18.1607638Z sage: (x - x).is_zero() ## line 4086 ##
2024-12-05T02:32:18.1607746Z True
2024-12-05T02:32:18.1608056Z sage: sig_on_count() # check sig_on/off pairings (virtual doctest) ## line 4088 ##
2024-12-05T02:32:18.1608174Z 0
2024-12-05T02:32:18.1608364Z sage: P.<x,y> = PolynomialRing(QQ) ## line 4098 ##
2024-12-05T02:32:18.1608559Z sage: bool(x) # indirect doctest ## line 4099 ##
2024-12-05T02:32:18.1608685Z True
2024-12-05T02:32:18.1608834Z sage: bool(x-x) ## line 4101 ##
2024-12-05T02:32:18.1608950Z False
2024-12-05T02:32:18.1609282Z sage: sig_on_count() # check sig_on/off pairings (virtual doctest) ## line 4103 ##
2024-12-05T02:32:18.1609568Z 0
2024-12-05T02:32:18.1609755Z sage: R.<x,y,z> = GF(32003)[] ## line 4121 ##
2024-12-05T02:32:18.1609903Z sage: f = y*x^2 + x + 1 ## line 4122 ##
2024-12-05T02:32:18.1610047Z sage: f//x ## line 4123 ##
2024-12-05T02:32:18.1610165Z x*y + 1
2024-12-05T02:32:18.1610304Z sage: f//y ## line 4125 ##
2024-12-05T02:32:18.1610420Z x^2
2024-12-05T02:32:18.1610575Z sage: P.<x,y> = ZZ[] ## line 4128 ##
2024-12-05T02:32:18.1610710Z sage: x//y ## line 4129 ##
2024-12-05T02:32:18.1610826Z 0
2024-12-05T02:32:18.1610972Z sage: (x+y)//y ## line 4131 ##
2024-12-05T02:32:18.1611087Z 1
2024-12-05T02:32:18.1611239Z sage: P.<x,y> = QQ[] ## line 4134 ##
2024-12-05T02:32:18.1611377Z sage: (x+y)//y ## line 4135 ##
2024-12-05T02:32:18.1611498Z 1
2024-12-05T02:32:18.1611630Z sage: (x)//y ## line 4137 ##
2024-12-05T02:32:18.1611742Z 0
2024-12-05T02:32:18.1611894Z sage: P.<x,y> = Zmod(1024)[] ## line 4140 ##
2024-12-05T02:32:18.1612213Z sage: (x+y)//x ## line 4141 ##
2024-12-05T02:32:18.1612333Z 1
2024-12-05T02:32:18.1612481Z sage: (x+y)//(2*x) ## line 4143 ##
2024-12-05T02:32:18.1612623Z sage: P.<x,y> = ZZ[] ## line 4150 ##
2024-12-05T02:32:18.1612859Z sage: p = 3*(-x^8*y^2 - x*y^9 + 6*x^8*y + 17*x^2*y^6 - x^3*y^2) ## line 4151 ##
2024-12-05T02:32:18.1613030Z sage: q = 7*(x^2 + x*y + y^2 + 1) ## line 4152 ##
2024-12-05T02:32:18.1613172Z sage: p*q//q == p ## line 4153 ##
2024-12-05T02:32:18.1613292Z True
2024-12-05T02:32:18.1613429Z sage: p*q//p == q ## line 4155 ##
2024-12-05T02:32:18.1613546Z True
2024-12-05T02:32:18.1613705Z sage: R.<x,y,z>=GF(2^32+15)[] ## line 4160 ##
2024-12-05T02:32:18.1613861Z sage: ((x+y)^3+x+z)//(x+y) ## line 4161 ##
2024-12-05T02:32:18.1614024Z sage: R.<x,y,z>=Zmod(2^29-3)[] ## line 4165 ##
2024-12-05T02:32:18.1614182Z sage: ((x+y)^3+x+z)//(x+y) ## line 4166 ##
2024-12-05T02:32:18.1614338Z sage: R.<x,y,z>=GF(2^29+11)[] ## line 4170 ##
2024-12-05T02:32:18.1614489Z sage: ((x+y)^3+x+z)//(x+y) ## line 4171 ##
2024-12-05T02:32:18.1614661Z sage: R.<x,y,z>=Zmod(2^29+10)[] ## line 4175 ##
2024-12-05T02:32:18.1614807Z sage: ((x+y)^3+x+z)//(x+y) ## line 4176 ##
2024-12-05T02:32:18.1614960Z sage: R.<x,y,z>=GF((2^29-3)^2)[] ## line 4180 ##
2024-12-05T02:32:18.1615121Z sage: ((x+y)^3+x+z)//(x+y) ## line 4181 ##
2024-12-05T02:32:18.1615241Z x^2 + 2*x*y + y^2
2024-12-05T02:32:18.1615398Z sage: R.<x,y,z>=Zmod(7^2)[] ## line 4183 ##
2024-12-05T02:32:18.1615553Z sage: ((x+y)^3+x+z)//(x+y) ## line 4184 ##
2024-12-05T02:32:18.1615875Z sage: sig_on_count() # check sig_on/off pairings (virtual doctest) ## line 4188 ##
2024-12-05T02:32:18.1616002Z 0
2024-12-05T02:32:18.1616144Z sage: R.<x, y> = QQ[] ## line 4250 ##
2024-12-05T02:32:18.1616342Z sage: f = (x^3 + 2*y^2*x) * (x^2 + x + 1); f ## line 4251 ##
2024-12-05T02:32:18.1616495Z x^5 + 2*x^3*y^2 + x^4 + 2*x^2*y^2 + x^3 + 2*x*y^2
2024-12-05T02:32:18.1616770Z sage: F = f.factor(); F ## line 4253 ##
2024-12-05T02:32:18.1616902Z x * (x^2 + x + 1) * (x^2 + 2*y^2)
2024-12-05T02:32:18.1617063Z sage: R.<x, y> = GF(3)[] ## line 4259 ##
2024-12-05T02:32:18.1617250Z sage: f = (x^3 + 2*y^2*x) * (x^2 + x + 1); f ## line 4260 ##
2024-12-05T02:32:18.1617410Z x^5 - x^3*y^2 + x^4 - x^2*y^2 + x^3 - x*y^2
2024-12-05T02:32:18.1617551Z sage: F = f.factor() ## line 4262 ##
2024-12-05T02:32:18.1617743Z sage: F  # order is somewhat random ## line 4263 ##
2024-12-05T02:32:18.1617883Z (-1) * x * (x + y) * (-x + y) * (x - 1)^2
2024-12-05T02:32:18.1618029Z sage: K.<a> = GF(3^2) ## line 4269 ##
2024-12-05T02:32:18.1618163Z sage: R.<x, y> = K[] ## line 4270 ##
2024-12-05T02:32:18.1618350Z sage: f = (x^3 + 2*a*y^2*x) * (x^2 + x + 1); f ## line 4271 ##
2024-12-05T02:32:18.1618524Z x^5 + (-a)*x^3*y^2 + x^4 + (-a)*x^2*y^2 + x^3 + (-a)*x*y^2
2024-12-05T02:32:18.1618671Z sage: F = f.factor(); F ## line 4273 ##
2024-12-05T02:32:18.1618829Z ((-a)) * x * (x - 1)^2 * ((-a + 1)*x^2 + y^2)
2024-12-05T02:32:18.1618961Z sage: f - F ## line 4275 ##
2024-12-05T02:32:18.1619078Z 0
2024-12-05T02:32:18.1619240Z sage: p = polygen(ZZ, 'p') ## line 4281 ##
2024-12-05T02:32:18.1619542Z sage: K.<s> = NumberField(p^3 - 2) ## line 4282 ##
2024-12-05T02:32:18.1619684Z sage: KXY.<x,y> = K[] ## line 4283 ##
2024-12-05T02:32:18.1619843Z sage: factor(x^3 - 2*y^3) ## line 4284 ##
2024-12-05T02:32:18.1619979Z (x + (-s)*y) * (x^2 + s*x*y + (s^2)*y^2)
2024-12-05T02:32:18.1620179Z sage: k = (x^3-2*y^3)^5*(x+s*y)^2*(2/3 + s^2) ## line 4286 ##
2024-12-05T02:32:18.1620319Z sage: k.factor() ## line 4287 ##
2024-12-05T02:32:18.1620520Z ((s^2 + 2/3)) * (x + s*y)^2 * (x + (-s)*y)^5 * (x^2 + s*x*y + (s^2)*y^2)^5
2024-12-05T02:32:18.1620676Z sage: x = polygen(ZZ, 'x') ## line 4294 ##
2024-12-05T02:32:18.1620851Z sage: K.<a> = NumberField(x^2 + 1) ## line 4295 ##
2024-12-05T02:32:18.1621030Z sage: R.<y, z> = PolynomialRing(K) ## line 4296 ##
2024-12-05T02:32:18.1621179Z sage: f = 2*y^2 + 2*z^2 ## line 4297 ##
2024-12-05T02:32:18.1621347Z sage: F = f.factor(); F.unit() ## line 4298 ##
2024-12-05T02:32:18.1621464Z 2
2024-12-05T02:32:18.1621949Z sage: R.<x,y,z> = GF(32003)[]                                               # needs sage.rings.finite_rings ## line 4303 ##
2024-12-05T02:32:18.1622240Z sage: f = 9*(x-1)^2*(y+z)                                                   # needs sage.rings.finite_rings ## line 4304 ##
2024-12-05T02:32:18.1622545Z sage: f.factor()                                                            # needs sage.rings.finite_rings ## line 4305 ##
2024-12-05T02:32:18.1622688Z (9) * (y + z) * (x - 1)^2
2024-12-05T02:32:18.1622873Z sage: R.<x,w,v,u> = QQ['x','w','v','u'] ## line 4308 ##
2024-12-05T02:32:18.1623022Z sage: p = (4*v^4*u^2 - 16*v^2*u^4 + 16*u^6 - 4*v^4*u + 8*v^2*u^3 + v^4) ## line 4309 ##
2024-12-05T02:32:18.1623111Z sage: p.factor() ## line 4310 ##
2024-12-05T02:32:18.1623187Z (-2*v^2*u + 4*u^3 + v^2)^2
2024-12-05T02:32:18.1623277Z sage: R.<a,b,c,d> = QQ[] ## line 4312 ##
2024-12-05T02:32:18.1623425Z sage: f =  (-2) * (a - d) * (-a + b) * (b - d) * (a - c) * (b - c) * (c - d) ## line 4313 ##
2024-12-05T02:32:18.1623515Z sage: F = f.factor(); F ## line 4314 ##
2024-12-05T02:32:18.1623632Z (-2) * (c - d) * (-b + c) * (b - d) * (-a + c) * (-a + b) * (a - d)
2024-12-05T02:32:18.1623714Z sage: F[0][0] ## line 4316 ##
2024-12-05T02:32:18.1623781Z c - d
2024-12-05T02:32:18.1623868Z sage: F.unit() ## line 4318 ##
2024-12-05T02:32:18.1623933Z -2
2024-12-05T02:32:18.1624020Z sage: P.<x,y> = ZZ[] ## line 4323 ##
2024-12-05T02:32:18.1624106Z sage: P(2^3*7).factor() ## line 4324 ##
2024-12-05T02:32:18.1624176Z 2^3 * 7
2024-12-05T02:32:18.1624258Z sage: P.<x,y> = GF(2)[] ## line 4326 ##
2024-12-05T02:32:18.1624339Z sage: P(1).factor() ## line 4327 ##
2024-12-05T02:32:18.1624408Z 1
2024-12-05T02:32:18.1624484Z sage: q = 1073741789 ## line 4333 ##
2024-12-05T02:32:18.1624703Z sage: T.<aa, bb> = PolynomialRing(GF(q))                                    # needs sage.rings.finite_rings ## line 4334 ##
2024-12-05T02:32:18.1625006Z sage: f = aa^2 + 12124343*bb*aa + 32434598*bb^2                             # needs sage.rings.finite_rings ## line 4335 ##
2024-12-05T02:32:18.1625176Z sage: f.factor()                                                            # needs sage.rings.finite_rings ## line 4336 ##
2024-12-05T02:32:18.1625285Z sage: P.<x,y> = PolynomialRing(ZZ) ## line 4344 ##
2024-12-05T02:32:18.1625408Z sage: f = 12 * (3*x*y + 4) * (5*x - 2) * (2*y + 7)^2 ## line 4345 ##
2024-12-05T02:32:18.1625488Z sage: f.factor() ## line 4346 ##
2024-12-05T02:32:18.1625582Z 2^2 * 3 * (2*y + 7)^2 * (5*x - 2) * (3*x*y + 4)
2024-12-05T02:32:18.1625673Z sage: g = -12 * (x^2 - y^2) ## line 4348 ##
2024-12-05T02:32:18.1625756Z sage: g.factor() ## line 4349 ##
2024-12-05T02:32:18.1625833Z (-1) * 2^2 * 3 * (x - y) * (x + y)
2024-12-05T02:32:18.1625952Z sage: factor(-4*x*y - 2*x + 2*y + 1) ## line 4351 ##
2024-12-05T02:32:18.1626028Z (-1) * (2*y + 1) * (2*x - 1)
2024-12-05T02:32:18.1626150Z sage: R.<x,y> = PolynomialRing(Zmod(4)) ## line 4356 ##
2024-12-05T02:32:18.1626248Z sage: f = (2*x + 1) * (x^2 + x + 1) ## line 4357 ##
2024-12-05T02:32:18.1626333Z sage: f.factor() ## line 4358 ##
2024-12-05T02:32:18.1626491Z sage: R.<x,y,z> = GF(3)[] ## line 4368 ##
2024-12-05T02:32:18.1626585Z sage: f = x^2*z^2+x*y*z-y^2 ## line 4369 ##
2024-12-05T02:32:18.1626706Z sage: f.factor() ## line 4370 ##
2024-12-05T02:32:18.1626995Z x^2*z^2 + x*y*z - y^2
2024-12-05T02:32:18.1627144Z sage: K = GF(4,'a') ## line 4376 ##
2024-12-05T02:32:18.1627288Z sage: a = K.gens()[0] ## line 4377 ##
2024-12-05T02:32:18.1627429Z sage: R.<x,y> = K[] ## line 4378 ##
2024-12-05T02:32:18.1627623Z sage: p=x^8*y^3 + x^2*y^9 + a*x^9 + a*x*y^4 ## line 4379 ##
2024-12-05T02:32:18.1627812Z sage: q=y^11 + (a)*y^10 + (a + 1)*x*y^3 ## line 4380 ##
2024-12-05T02:32:18.1627951Z sage: f = p*q ## line 4381 ##
2024-12-05T02:32:18.1628094Z sage: f.factor() ## line 4382 ##
2024-12-05T02:32:18.1628286Z x * y^3 * (y^8 + a*y^7 + (a + 1)*x) * (x^7*y^3 + x*y^9 + a*x^8 + a*y^4)
2024-12-05T02:32:18.1628444Z sage: R.<x,y> = GF(2)[] ## line 4388 ##
2024-12-05T02:32:18.1628629Z sage: p = x^3*y^7 + x^2*y^6 + x^2*y^3 ## line 4389 ##
2024-12-05T02:32:18.1628991Z sage: q = x^3*y^5 ## line 4390 ##
2024-12-05T02:32:18.1629141Z sage: f = p*q ## line 4391 ##
2024-12-05T02:32:18.1629313Z sage: p.factor()*q.factor() ## line 4392 ##
2024-12-05T02:32:18.1629440Z x^5 * y^8 * (x*y^4 + y^3 + 1)
2024-12-05T02:32:18.1629584Z sage: f.factor() ## line 4394 ##
2024-12-05T02:32:18.1629710Z x^5 * y^8 * (x*y^4 + y^3 + 1)
2024-12-05T02:32:18.1629888Z sage: f.factor().expand() == f ## line 4396 ##
2024-12-05T02:32:18.1630016Z True
2024-12-05T02:32:18.1630166Z sage: R.<x,y> = GF(2)[] ## line 4401 ##
2024-12-05T02:32:18.1630345Z sage: p = x^8 + y^8; q=x^2*y^4 + x ## line 4402 ##
2024-12-05T02:32:18.1630456Z sage: f = p*q ## line 4403 ##
2024-12-05T02:32:18.1630549Z sage: lf = f.factor() ## line 4404 ##
2024-12-05T02:32:18.1630628Z sage: f-lf ## line 4405 ##
2024-12-05T02:32:18.1630699Z 0
2024-12-05T02:32:18.1630785Z sage: R.<x,y> = GF(3)[] ## line 4410 ##
2024-12-05T02:32:18.1630873Z sage: p = -x*y^9 + x ## line 4411 ##
2024-12-05T02:32:18.1630954Z sage: q = -x^8*y^2 ## line 4412 ##
2024-12-05T02:32:18.1631042Z sage: f = p*q ## line 4413 ##
2024-12-05T02:32:18.1631115Z sage: f ## line 4414 ##
2024-12-05T02:32:18.1631195Z x^9*y^11 - x^9*y^2
2024-12-05T02:32:18.1631276Z sage: f.factor() ## line 4416 ##
2024-12-05T02:32:18.1631349Z y^2 * (y - 1)^9 * x^9
2024-12-05T02:32:18.1631436Z sage: f - f.factor() ## line 4418 ##
2024-12-05T02:32:18.1631501Z 0
2024-12-05T02:32:18.1631590Z sage: R.<x,y> = GF(5)[] ## line 4423 ##
2024-12-05T02:32:18.1631731Z sage: p = x^27*y^9 + x^32*y^3 + 2*x^20*y^10 - x^4*y^24 - 2*x^17*y ## line 4424 ##
2024-12-05T02:32:18.1631852Z sage: q = -2*x^10*y^24 + x^9*y^24 - 2*x^3*y^30 ## line 4425 ##
2024-12-05T02:32:18.1631950Z sage: f = p*q; f - f.factor() ## line 4426 ##
2024-12-05T02:32:18.1632019Z 0
2024-12-05T02:32:18.1632099Z sage: R.<x,y> = GF(7)[] ## line 4431 ##
2024-12-05T02:32:18.1632284Z sage: p = -3*x^47*y^24 ## line 4432 ##
2024-12-05T02:32:18.1632433Z sage: q = -3*x^47*y^37 - 3*x^24*y^49 + 2*x^56*y^8 + 3*x^29*y^15 - x^2*y^33 ## line 4433 ##
2024-12-05T02:32:18.1632521Z sage: f = p*q ## line 4434 ##
2024-12-05T02:32:18.1632607Z sage: f - f.factor() ## line 4435 ##
2024-12-05T02:32:18.1632676Z 0
2024-12-05T02:32:18.1632756Z sage: R.<x,y> = GF(2)[] ## line 4441 ##
2024-12-05T02:32:18.1632848Z sage: f = x^6 + x^5 + y^5 + y^4 ## line 4442 ##
2024-12-05T02:32:18.1632934Z sage: f.factor() ## line 4443 ##
2024-12-05T02:32:18.1633005Z x^6 + x^5 + y^5 + y^4
2024-12-05T02:32:18.1633135Z sage: f = x^16*y + x^10*y + x^9*y + x^6*y + x^5 + x*y + y^2 ## line 4445 ##
2024-12-05T02:32:18.1633213Z sage: f.factor() ## line 4446 ##
2024-12-05T02:32:18.1633312Z x^16*y + x^10*y + x^9*y + x^6*y + x^5 + x*y + y^2
2024-12-05T02:32:18.1633392Z sage: R.<x,y> = GF(2)[] ## line 4451 ##
2024-12-05T02:32:18.1633490Z sage: p = x^2 + y^2 + x + 1 ## line 4452 ##
2024-12-05T02:32:18.1633610Z sage: q = x^4 + x^2*y^2 + y^4 + x*y^2 + x^2 + y^2 + 1 ## line 4453 ##
2024-12-05T02:32:18.1633701Z sage: factor(p*q) ## line 4454 ##
2024-12-05T02:32:18.1633806Z (x^2 + y^2 + x + 1) * (x^4 + x^2*y^2 + y^4 + x*y^2 + x^2 + y^2 + 1)
2024-12-05T02:32:18.1633974Z sage: U.<y,t> = GF(2)[] ## line 4459 ##
2024-12-05T02:32:18.1634133Z sage: f = y*t^8 + y^5*t^2 + y*t^6 + t^7 + y^6 + y^5*t + y^2*t^4 + y^2*t^2 + y^2*t + t^3 + y^2 + t^2 ## line 4460 ##
2024-12-05T02:32:18.1634218Z sage: l = f.factor() ## line 4461 ##
2024-12-05T02:32:18.1634349Z sage: l[0][0] == t^2 + y + t + 1 or l[1][0] == t^2 + y + t + 1 ## line 4462 ##
2024-12-05T02:32:18.1634418Z True
2024-12-05T02:32:18.1634500Z sage: K.<a> = GF(4) ## line 4470 ##
2024-12-05T02:32:18.1634582Z sage: R.<x,y> = K[] ## line 4471 ##
2024-12-05T02:32:18.1634726Z sage: f = (a + 1)*x^145*y^84 + (a + 1)*x^205*y^17 + x^32*y^112 + x^92*y^45 ## line 4472 ##
2024-12-05T02:32:18.1634813Z sage: for i in range(100):
2024-12-05T02:32:18.1634911Z     assert len(f.factor()) == 4 ## line 4473 ##
2024-12-05T02:32:18.1635014Z sage: x,y = polygen(ZZ,'x,y') ## line 4478 ##
2024-12-05T02:32:18.1635109Z sage: p = x**2 - y**2 ## line 4479 ##
2024-12-05T02:32:18.1635196Z sage: z = factor(p); z ## line 4480 ##
2024-12-05T02:32:18.1635455Z (x - y) * (x + y)
2024-12-05T02:32:18.1635547Z sage: z[0][0].parent() ## line 4482 ##
2024-12-05T02:32:18.1635691Z Multivariate Polynomial Ring in x, y over Integer Ring
2024-12-05T02:32:18.1635794Z sage: R.<a,r,v,n,g,f,h,o> = QQ[] ## line 4487 ##
2024-12-05T02:32:18.1636538Z sage: f = 248301045*a^2*r^10*n^2*o^10+570807000*a^2*r^9*n*o^9-137945025*a^2*r^8*n^2*o^8+328050000*a^2*r^8*o^8-253692000*a^2*r^7*n*o^7+30654450*a^2*r^6*n^2*o^6-109350000*a^2*r^6*o^6+42282000*a^2*r^5*n*o^5-3406050*a^2*r^4*n^2*o^4-22457088*a*r^2*v*n^2*o^6+12150000*a^2*r^4*o^4-3132000*a^2*r^3*n*o^3+189225*a^2*r^2*n^2*o^2+2495232*a*v*n^2*o^4-450000*a^2*r^2*o^2+87000*a^2*r*n*o-4205*a^2*n^2 ## line 4488 ##
2024-12-05T02:32:18.1636621Z sage: len(factor(f)) ## line 4489 ##
2024-12-05T02:32:18.1636691Z 4
2024-12-05T02:32:18.1636807Z sage: R.<z,a,b> = PolynomialRing(QQ) ## line 4494 ##
2024-12-05T02:32:18.1637211Z sage: N = -a^4*z^8 + 2*a^2*b^2*z^8 - b^4*z^8 - 16*a^3*b*z^7 + 16*a*b^3*z^7 + 28*a^4*z^6 - 56*a^2*b^2*z^6 + 28*b^4*z^6 + 112*a^3*b*z^5 - 112*a*b^3*z^5 - 70*a^4*z^4 + 140*a^2*b^2*z^4 - 70*b^4*z^4 - 112*a^3*b*z^3 + 112*a*b^3*z^3 + 28*a^4*z^2 - 56*a^2*b^2*z^2 + 28*b^4*z^2 + 16*a^3*b*z - 16*a*b^3*z - a^4 + 2*a^2*b^2 - b^4 ## line 4495 ##
2024-12-05T02:32:18.1637295Z sage: N.factor() ## line 4496 ##
2024-12-05T02:32:18.1637523Z (-1) * (-a + b) * (a + b) * (-z^4*a + z^4*b - 4*z^3*a - 4*z^3*b + 6*z^2*a - 6*z^2*b + 4*z*a + 4*z*b - a + b) * (z^4*a + z^4*b - 4*z^3*a + 4*z^3*b - 6*z^2*a - 6*z^2*b + 4*z*a - 4*z*b + a + b)
2024-12-05T02:32:18.1637621Z sage: R.<x,y,z>=GF(2^32+15)[] ## line 4501 ##
2024-12-05T02:32:18.1637726Z sage: ((x+y)^2*(x+z)^3).factor() ## line 4502 ##
2024-12-05T02:32:18.1637821Z sage: R.<x,y,z>=Zmod(2^29-3)[] ## line 4506 ##
2024-12-05T02:32:18.1637920Z sage: ((x+y)^2*(x+z)^3).factor() ## line 4507 ##
2024-12-05T02:32:18.1638071Z (x + y)^2 * (x + z)^3
2024-12-05T02:32:18.1638167Z sage: R.<x,y,z>=GF(2^29+11)[] ## line 4509 ##
2024-12-05T02:32:18.1638258Z sage: ((x+y)^2*(x+z)^3).factor() ## line 4510 ##
2024-12-05T02:32:18.1638362Z sage: R.<x,y,z>=Zmod(2^29+10)[] ## line 4514 ##
2024-12-05T02:32:18.1638464Z sage: ((x+y)^2*(x+z)^3).factor() ## line 4515 ##
2024-12-05T02:32:18.1638568Z sage: R.<x,y,z>=GF((2^29-3)^2)[] ## line 4519 ##
2024-12-05T02:32:18.1638663Z sage: ((x+y)^2*(x+z)^3).factor() ## line 4520 ##
2024-12-05T02:32:18.1638739Z (x + y)^2 * (x + z)^3
2024-12-05T02:32:18.1638828Z sage: R.<x,y,z>=Zmod(7^2)[] ## line 4522 ##
2024-12-05T02:32:18.1638923Z sage: ((x+y)^2*(x+z)^3).factor() ## line 4523 ##
2024-12-05T02:32:18.1639005Z sage: R.<x,y,z> = QQ[] ## line 4530 ##
2024-12-05T02:32:18.1639218Z sage: n = 11  # chosen so that the computation takes > 1 second but not excessively long.
2024-12-05T02:32:18.1639446Z # when Singular improves the algorithm or hardware gets faster, increase n. ## line 4531 ##
2024-12-05T02:32:18.1639582Z sage: alarm(0.5); h = (x^2^n-y^2^n).factor() ## line 4533 ##
2024-12-05T02:32:18.1639697Z sage: alarm(0.5); h = (x^2^n-y^2^n).factor() ## line 4537 ##
2024-12-05T02:32:18.1639859Z sage: h = (x^2^n-y^2^n).factor() ## line 4541 ##
2024-12-05T02:32:18.1639939Z sage: h ## line 4542 ##
2024-12-05T02:32:18.1640147Z (x - y) * (x + y) * (x^2 + y^2) * (x^4 + y^4) * (x^8 + y^8) * (x^16 + y^16) * (x^32 + y^32) * (x^64 + y^64) * (x^128 + y^128) * (x^256 + y^256) * (x^512 + y^512) * (x^1024 + y^1024)
2024-12-05T02:32:18.1640339Z sage: sig_on_count() # check sig_on/off pairings (virtual doctest) ## line 4544 ##
2024-12-05T02:32:18.1640404Z 0
2024-12-05T02:32:18.1640567Z sage: A.<x,y> = PolynomialRing(QQ,2,order='degrevlex') ## line 4603 ##
2024-12-05T02:32:18.1640700Z sage: I = A.ideal([x^10 + x^9*y^2, y^8 - x^2*y^7 ]) ## line 4604 ##
2024-12-05T02:32:18.1640786Z sage: f = x*y^13 + y^12 ## line 4605 ##
2024-12-05T02:32:18.1640866Z sage: M = f.lift(I) ## line 4606 ##
2024-12-05T02:32:18.1640947Z sage: M ## line 4607 ##
2024-12-05T02:32:18.1641069Z [y^7, x^7*y^2 + x^8 + x^5*y^3 + x^6*y + x^3*y^4 + x^4*y^2 + x*y^5 + x^2*y^3 + y^4]
2024-12-05T02:32:18.1641311Z sage: sum( map( mul , zip( M, I.gens() ) ) ) == f ## line 4609 ##
2024-12-05T02:32:18.1641381Z True
2024-12-05T02:32:18.1641468Z sage: R.<x1,x2> = QQ[] ## line 4614 ##
2024-12-05T02:32:18.1641591Z sage: I = R.ideal(x2**2 + x1 - 2, x1**2 - 1) ## line 4615 ##
2024-12-05T02:32:18.1641692Z sage: f = I.gen(0) + x2*I.gen(1) ## line 4616 ##
2024-12-05T02:32:18.1641772Z sage: f.lift(I) ## line 4617 ##
2024-12-05T02:32:18.1641846Z [1, x2]
2024-12-05T02:32:18.1641925Z sage: (f+1).lift(I) ## line 4619 ##
2024-12-05T02:32:18.1642006Z sage: R.<x1,x2> = ZZ[] ## line 4626 ##
2024-12-05T02:32:18.1642125Z sage: I = R.ideal(x2**2 + x1 - 2, x1**2 - 1) ## line 4627 ##
2024-12-05T02:32:18.1642217Z sage: f = I.gen(0) + x2*I.gen(1) ## line 4628 ##
2024-12-05T02:32:18.1642303Z sage: f.lift(I) ## line 4629 ##
2024-12-05T02:32:18.1642370Z [1, x2]
2024-12-05T02:32:18.1642455Z sage: (f+1).lift(I) ## line 4631 ##
2024-12-05T02:32:18.1642604Z sage: A.<x,y> = PolynomialRing(ZZ,2,order='degrevlex') ## line 4635 ##
2024-12-05T02:32:18.1642737Z sage: I = A.ideal([x^10 + x^9*y^2, y^8 - x^2*y^7 ]) ## line 4636 ##
2024-12-05T02:32:18.1642821Z sage: f = x*y^13 + y^12 ## line 4637 ##
2024-12-05T02:32:18.1642905Z sage: M = f.lift(I) ## line 4638 ##
2024-12-05T02:32:18.1642978Z sage: M ## line 4639 ##
2024-12-05T02:32:18.1643101Z [y^7, x^7*y^2 + x^8 + x^5*y^3 + x^6*y + x^3*y^4 + x^4*y^2 + x*y^5 + x^2*y^3 + y^4]
2024-12-05T02:32:18.1643181Z sage: R.<x1,x2> = QQ[] ## line 4646 ##
2024-12-05T02:32:18.1643300Z sage: I = R.ideal(x2**2 + x1 - 2, x1**2 - 1) ## line 4647 ##
2024-12-05T02:32:18.1643385Z sage: R.one().lift(I) ## line 4648 ##
2024-12-05T02:32:18.1643584Z sage: foo = I.complete_primary_decomposition() # indirect doctest ## line 4652 ##
2024-12-05T02:32:18.1643661Z sage: foo[0][0] ## line 4653 ##
2024-12-05T02:32:18.1643851Z Ideal (x1 + 1, x2^2 - 3) of Multivariate Polynomial Ring in x1, x2 over Rational Field
2024-12-05T02:32:18.1643996Z sage: R.<x,y> = QQ[] ## line 4658 ##
2024-12-05T02:32:18.1644198Z sage: n = 15  # chosen so that the computation takes > 1 second but not excessively long.
2024-12-05T02:32:18.1644431Z # when Singular improves the algorithm or hardware gets faster, increase n. ## line 4659 ##
2024-12-05T02:32:18.1644588Z sage: I = R.ideal([(x-i)*(y-j) for i in (0..n) for j in (0..n)]) ## line 4661 ##
2024-12-05T02:32:18.1644731Z sage: f = prod((x-i)*(y-j) for i in (0..n) for j in (0..n)) ## line 4662 ##
2024-12-05T02:32:18.1644821Z sage: alarm(0.5); f.lift(I) ## line 4663 ##
2024-12-05T02:32:18.1644914Z sage: alarm(0.5); f.lift(I) ## line 4667 ##
2024-12-05T02:32:18.1644921Z 
2024-12-05T02:32:18.1645015Z **********************************************************************
2024-12-05T02:32:18.1645107Z Traceback (most recent call last):
2024-12-05T02:32:18.1645445Z   File "/usr/share/miniconda3/envs/sage/lib/python3.9/site-packages/sage/doctest/forker.py", line 2596, in __call__
2024-12-05T02:32:18.1645647Z     doctests, extras = self._run(runner, options, results)
2024-12-05T02:32:18.1646072Z   File "/usr/share/miniconda3/envs/sage/lib/python3.9/site-packages/sage/doctest/forker.py", line 2644, in _run
2024-12-05T02:32:18.1646246Z     result = runner.run(test)
2024-12-05T02:32:18.1646573Z   File "/usr/share/miniconda3/envs/sage/lib/python3.9/site-packages/sage/doctest/forker.py", line 905, in run
2024-12-05T02:32:18.1646680Z     return self._run(test, compileflags, out)
2024-12-05T02:32:18.1647014Z   File "/usr/share/miniconda3/envs/sage/lib/python3.9/site-packages/sage/doctest/forker.py", line 800, in _run
2024-12-05T02:32:18.1647282Z     self.total_walltime += example.walltime + check_timer.walltime
2024-12-05T02:32:18.1647548Z AttributeError: 'Example' object has no attribute 'walltime'
2024-12-05T02:32:18.1647556Z 

which… is pretty weird because as far as I can see all route leads to that line must have filled in that attribute already.

            try:
                # Don't blink!  This is where the user's code gets run.
                self.compile_and_execute(example, compiler, test.globs)
            except (SignalError, SystemExit):

        if isinstance(globs, RecordingDict):
            globs.start()
        example.sequence_number = len(self.history)
        if not hasattr(example, 'warnings'):
            example.warnings = []
        self.history.append(example)
        timer = Timer().start()
        try:
            compiled = compiler(example)
            timer.start()    # reset timer
            exec(compiled, globs)
        finally:
            timer.stop().annotate(example)

        object.cputime = self.cputime
        object.walltime = self.walltime

Unless one of the following lines

        if isinstance(globs, RecordingDict):
            globs.start()
        example.sequence_number = len(self.history)
        if not hasattr(example, 'warnings'):
            example.warnings = []
        self.history.append(example)
        timer = Timer().start()

can error out. (my best guess is Timer().start() fails because the thread can't be started somehow…) can't happen right…?

Edit: actually thinking about it the test server is passing -p4 to sage -t, and the parallelism may interfere with signals etc. somehow…

@user202729
Copy link
Contributor Author

Maybe @mantepse would be interested in reviewing?

_res = self.call_handler.handle_call(argument_list, si_ring)
sig_off()
finally:
s = check_error()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe a more descriptive name, e.g., e, or error, instead of s would be good?

Comment on lines 1493 to 1494
if currentVoice:
currentVoice = NULL
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could not find any use of currentVoice within sage, do you know what this is? (It does appear in local/include/singular/Singular/sdb.h and local/include/singular/Singular/fevoices.h)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No idea, but given the naming, my best guess is "who is speaking to Singular" i.e. "where is Singular taking commands from". The example has currentVoice=feInitStdin(NULL); (read: stdin) and we certainly don't want it to read from stdin.

@mantepse
Copy link
Collaborator

mantepse commented Dec 7, 2024

I'm very sorry, but it seems that I somehow mistested my code. I have no idea what's going wrong, but I guess the best way is to reinstate the old version. Perhaps cython's support of := has problems.

diff --git a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx
index 423b5c0e603..adc8f503f6c 100644
--- a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx
+++ b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx
@@ -4579,8 +4579,9 @@ cdef class MPolynomial_libsingular(MPolynomial_libsingular_base):
                     raise NotImplementedError("Factorization of multivariate polynomials over prime fields with characteristic > 2^29 is not implemented.")
 
             ivv = iv.ivGetVec()
-            v = [(f, ivv[i]) for i in range(1, I.ncols)
-                 if (f := new_MP(parent, p_Copy(I.m[i], _ring))) != 0]
+            v = [(new_MP(parent, p_Copy(I.m[i], _ring)), ivv[i])
+                 for i in range(1, I.ncols)]
+            v = [(f, m) for f, m in v if f != 0]  # we might have zero in there
             unit = new_MP(parent, p_Copy(I.m[0], _ring))
 
             F = Factorization(v, unit)

@user202729
Copy link
Contributor Author

Time to report bug to Cython I guess.

Co-authored-by: Martin Rubey <axiomize@yahoo.de>
@mantepse
Copy link
Collaborator

mantepse commented Dec 8, 2024

Time to report bug to Cython I guess.

Wow, you are quick. For reference: cython/cython#6546

Copy link
Collaborator

@mantepse mantepse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! To me this looks good. However, since I feel not qualified enough, I'll ask for an additional look, let's say, within a week, on sage-devel. Otherwise I'll carry the responsibility :-)

Copy link
Collaborator

@mantepse mantepse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's go!

vbraun pushed a commit to vbraun/sage that referenced this pull request Dec 15, 2024
…rk signal detection system

    
Somewhat related: sagemath#33319

Anyway, this allows many more rings to be used with libsingular.
Previously it fallback to the expect interface.

It seems weird that both Sage and Singular has different types for
`GF(5)` and `Zmod(5)`, but okay.

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->

- [x] The title is concise and informative.
- [x] The description explains in detail what this PR is about.
- [x] I have linked a relevant issue or discussion.
- [x] I have created tests covering the changes.
- [ ] I have updated the documentation and checked the documentation
preview.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on. For example,
-->
<!-- - sagemath#12345: short description why this is a dependency -->
<!-- - sagemath#34567: ... -->
    
URL: sagemath#39075
Reported by: user202729
Reviewer(s): Martin Rubey, user202729
@vbraun
Copy link
Member

vbraun commented Dec 18, 2024

I'm getting (possibly computer too fast? Ryzen 9900X)

sage -t --long --warn-long 30.0 --random-seed=123 src/sage/rings/polynomial/multi_polynomial_libsingular.pyx
**********************************************************************
File "src/sage/rings/polynomial/multi_polynomial_libsingular.pyx", line 4663, in sage.rings.polynomial.multi_polynomial_libsingular.MPolynomial_libsingular.lift
Failed example:
    alarm(0.5); f.lift(I)
Expected:
    Traceback (most recent call last):
    ...
    AlarmInterrupt
Got:
    Polynomial Sequence with 256 Polynomials in 2 Variables
**********************************************************************
File "src/sage/rings/polynomial/multi_polynomial_libsingular.pyx", line 4667, in sage.rings.polynomial.multi_polynomial_libsingular.MPolynomial_libsingular.lift
Failed example:
    alarm(0.5); f.lift(I)
Expected:
    Traceback (most recent call last):
    ...
    AlarmInterrupt
Got:
    Polynomial Sequence with 256 Polynomials in 2 Variables
**********************************************************************
File "src/sage/rings/polynomial/multi_polynomial_libsingular.pyx", line 4671, in sage.rings.polynomial.multi_polynomial_libsingular.MPolynomial_libsingular.lift
Failed example:
    f.lift(I)
Exception raised:
    Traceback (most recent call last):
      File "/home/release/Sage/src/sage/doctest/forker.py", line 716, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/home/release/Sage/src/sage/doctest/forker.py", line 1137, in compile_and_execute
        exec(compiled, globs)
      File "<doctest sage.rings.polynomial.multi_polynomial_libsingular.MPolynomial_libsingular.lift[32]>", line 1, in <module>
        f.lift(I)
      File "sage/rings/polynomial/multi_polynomial_libsingular.pyx", line 4707, in sage.rings.polynomial.multi_polynomial_libsingular.MPolynomial_libsingular.lift
        sig_on()
    cysignals.signals.AlarmInterrupt
**********************************************************************
1 item had failures:
   3 of  34 in sage.rings.polynomial.multi_polynomial_libsingular.MPolynomial_libsingular.lift
    [1338 tests, 3 failures, 9.79s wall]
----------------------------------------------------------------------
sage -t --long --warn-long 30.0 --random-seed=123 src/sage/rings/polynomial/multi_polynomial_libsingular.pyx  # 3 doctests failed
----------------------------------------------------------------------

@user202729
Copy link
Contributor Author

Sounds about right.

I already made the buffer 2× on my computer though. Will make it 4×.

@user202729 user202729 requested a review from mantepse December 19, 2024 00:56
@user202729 user202729 mentioned this pull request Dec 20, 2024
5 tasks
Copy link
Collaborator

@mantepse mantepse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you!

@vbraun vbraun merged commit 5473422 into sagemath:develop Dec 22, 2024
21 of 23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants