ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Fri, 17 Jul 2020 00:46:45 +0200Replacing Polynomials with another Polynomialhttps://ask.sagemath.org/question/52518/replacing-polynomials-with-another-polynomial/So I am working with quotient rings so I want to be able to replace terms as there can be many representatives. Let's say I have a polynomial ring of four variables quotiented off by some ideal. Futhermore, we have
x*w "=" x*y+y*z
in the quotient. Is there some replace function that will let me replace polynomial expressions with one another? For example, if I had 3*x*w+x*y, is there something like
replace(3*x*w+x*y, x*w for x*y+y*z)
which should output
4*x*y+3*y*z whatupmattFri, 17 Jul 2020 00:46:45 +0200https://ask.sagemath.org/question/52518/Solving a polynomial system in a quotient ringhttps://ask.sagemath.org/question/52254/solving-a-polynomial-system-in-a-quotient-ring/I want to compute all solutions in $\mathbb{Z}_9[\sqrt2,x]$, where $x$ is such that $(x+\sqrt2)^2=2(x+\sqrt2)$, of the equation
$$X^2=1.$$
I'm first defining the polynomial ring over $\mathbb{Z}_9$ in variables $x,y$, then factoring by the ideal generated by
$$y^2-2, (x+y)^2-2(x+y),$$
to get the ring $S$, but then I don't know which command to use in order to get the solutions of $X^2-1$. I have tried "solve" and "variety" (defining $S[X]$ first and then the ideal of $X^2-1$), but they do not seem to work. The code up to this point is just
R.<x,y> = PolynomialRing(IntegerModRing(9),order='lex')
J= R.ideal(x^2-2,(x+y)^2-2*(x+y))
S=R.quotient(J)
Which function should I use?Jose BroxMon, 29 Jun 2020 16:55:09 +0200https://ask.sagemath.org/question/52254/How to compute syzygy module of an ideal in a quotient ring?https://ask.sagemath.org/question/37320/how-to-compute-syzygy-module-of-an-ideal-in-a-quotient-ring/I am trying to compute the syzygy module of an ideal generated by two polynomials `<p,q>` modulo `I`, where `I` is another ideal. This means to compute a generating set `[(p1,q1),...,(ps,qs)]` of the module `{(g,h): gp+hq is in I}`. I know that in Sage, we can use singular command to compute syzygy module:
R.<x,y> = PolynomialRing(QQ, order='lex')
f=2*x^2+y
g=y
h=2*f+g
I=ideal(f,g,h)
M = I.syzygy_module();M
[ -2 -1 1]
[ -y 2*x^2 + y 0]
But this does not work with modulo `I`:
R.<x,y> = PolynomialRing(QQ, order='lex')
S.<a,b>=R.quo(x^2+y^2)
I=ideal(a^2,b^2);I
M = I.syzygy_module();M
Ideal (-b^2, b^2) of Quotient of Multivariate Polynomial Ring in x, y over Rational Field by the ideal (x^2 + y^2)
Error in lines 4-4
Traceback (most recent call last):
Is there a way to do that?KittyLTue, 18 Apr 2017 11:34:27 +0200https://ask.sagemath.org/question/37320/Ideal moduli and residue symbolshttps://ask.sagemath.org/question/26042/ideal-moduli-and-residue-symbols/ Hi, everyone;
I'm fairly new to sage, but I feel like I have some heavy lifting to do. I'm attempting to do a couple of things:
1) I need to see if two complex numbers are equivalent mod an ideal, eg pi == 1 mod 2+2i. It might be a dumb question but my searching thus far has come up short
2) I need to compute residue symbols, and I'm using the Number Field residue symbol method, but I'm having trouble. I have the following:
C = ComplexField()
I = C.0
r = C.ideal(b).residue_symbol(D,4)
with a and b complex numbers. Help!jwiebeFri, 06 Mar 2015 02:37:25 +0100https://ask.sagemath.org/question/26042/Declare arithmetic with formal variableshttps://ask.sagemath.org/question/10863/declare-arithmetic-with-formal-variables/I want to create variables in SAGE and and declare arithmetic relations between them. For example, it is easy enough to declare that x1, ..., xn and y1, ..., yn be variables. Is there a way to state that
xi*xj = 0 (in the ring of polynomials, if necessary)
or that
x1 < y1 < x2 < y2 < ...?
Zach HSat, 28 Dec 2013 00:50:04 +0100https://ask.sagemath.org/question/10863/scary muli_polynomial_ring warninghttps://ask.sagemath.org/question/10426/scary-muli_polynomial_ring-warning/Thw following warning message looks pretty scary, since it is accompanied by a stack trace. And I have absolutely no idea (yet) as to what it is trying to tell me. Is the result it prints in the end reliable? If so, why the fuss? And if not, what is causing this problem? Is this an indication of a bug?
sage: R1.<cosAlpha, sinAlpha> = AA[]
sage: QR1 = R1.quotient(R1.ideal(cosAlpha^2 + sinAlpha^2 - 1))
sage: QR1(-8*sinAlpha - 4*sinAlpha*cosAlpha + 5*2*(2*sinAlpha*cosAlpha)*(cosAlpha*cosAlpha - sinAlpha*sinAlpha))
verbose 0 (3490: multi_polynomial_ideal.py, groebner_basis) Warning: falling back to very slow toy implementation.
singular_ring_delete(ring*) called with NULL pointer.
File "<stdin>", line 1, in <module>
File "_sage_input_4.py", line 10, in <module>
exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("UVIxKC04KnNpbkFscGhhIC0gNCpzaW5BbHBoYSpjb3NBbHBoYSArIDUqMiooMipzaW5BbHBoYSpjb3NBbHBoYSkqKGNvc0FscGhhKmNvc0FscGhhIC0gc2luQWxwaGEqc2luQWxwaGEpKQ=="),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))' + '\n', '', 'single')
File "", line 1, in <module>
File "/tmp/tmpKfaoEi/___code___.py", line 3, in <module>
exec compile(u'QR1(-_sage_const_8 *sinAlpha - _sage_const_4 *sinAlpha*cosAlpha + _sage_const_5 *_sage_const_2 *(_sage_const_2 *sinAlpha*cosAlpha)*(cosAlpha*cosAlpha - sinAlpha*sinAlpha))' + '\n', '', 'single')
File "", line 1, in <module>
File "sage/rings/quotient_ring.py", line 993, in _element_constructor_
return self.element_class(self, x)
File "sage/rings/quotient_ring_element.py", line 99, in __init__
self._reduce_()
File "sage/rings/quotient_ring_element.py", line 118, in _reduce_
self.__rep = I.reduce(self.__rep)
File "sage/rings/polynomial/multi_polynomial_ideal.py", line 4019, in reduce
strat = self._groebner_strategy()
File "sage/rings/polynomial/multi_polynomial_ideal.py", line 910, in _groebner_strategy
return GroebnerStrategy(MPolynomialIdeal(self.ring(), self.groebner_basis()))
Exception KeyError: (The ring pointer 0x0,) in 'sage.libs.singular.ring.singular_ring_delete' ignored
-40*cosAlphabar*sinAlphabar^3 + 16*cosAlphabar*sinAlphabar - 8*sinAlphabarMvGWed, 07 Aug 2013 10:06:35 +0200https://ask.sagemath.org/question/10426/Quotienting a ring of integershttps://ask.sagemath.org/question/9556/quotienting-a-ring-of-integers/I was trying to play within the ring of integers of a number field, when I decided to quotient by an ideal. It raised an "IndexError: the number of names must equal the number of generators" exception, which was quite unexpected ; here is an example:
K=NumberField(x**2+1,x)
O=K.ring_of_integers()
O.quo(O.ideal(3))
as you see, I'm using the same ring to define the ideal I want to quotient with, so there is mathematically no problem... so I think either I found a bug or something needs to be documented better. How does one work in a quotient of a ring of integers?SnarkThu, 22 Nov 2012 01:52:30 +0100https://ask.sagemath.org/question/9556/Quotient of ideals in powerseries ringhttps://ask.sagemath.org/question/8333/quotient-of-ideals-in-powerseries-ring/Is it possible to take quotient (colon) of two ideals in a multivariable powerseries ring over a field?
e.g. the following code gives me error(s):
sage: R.<x,y,z> = PolynomialRing(QQ,3)
sage: I = Ideal([x^2+x*y*z,y^2-z^3*y,z^3+y^5*x*z])
sage: J = Ideal([x])
sage: Q = I.quotient(J)
Thanks and regards
--VInay
VInay WaghTue, 20 Sep 2011 04:17:26 +0200https://ask.sagemath.org/question/8333/