Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Members of a Polynomial Ring don't respond to solve

R = PolynomialRing(RR,['a','b','c','d'])
S = matrix(R,2,R.gens())
S

yields $$\newcommand{\Bold}[1]{\mathbf{#1}}\left(\begin{array}{rr} a & b \ c & d \end{array}\right)$$ as expected, but then solve does not respond -

solve([S[0][0]==S[0][1],S[1][0]==S[1][1]],[a,b])

outputs

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "_sage_input_13.py", line 10, in <module>
    exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("c29sdmUoW1NbMF1bMF09PVNbMF1bMV0sU1sxXVswXT09U1sxXVsxXV0sW2EsYl0p"),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))
  File "", line 1, in <module>

  File "/tmp/tmpBgHnJ8/___code___.py", line 3, in <module>
    exec compile(u'solve([S[_sage_const_0 ][_sage_const_0 ]==S[_sage_const_0 ][_sage_const_1 ],S[_sage_const_1 ][_sage_const_0 ]==S[_sage_const_1 ][_sage_const_1 ]],[a,b])
  File "", line 1, in <module>

NameError: name 'a' is not defined

But all the same, the .subs() command works - as the elements of the Symbolic Ring, produced by var('x'). Is there a substitute to solve for the PolynomialRing?