Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

It sounds like you have an expression s in x,y,z,w,a,b,c,d from which you want to obtain a different expression, let's say t in which you substitute x=d,y=c,z=b,w=a. You can make multiple substitutions at once using s.subs(...) but you need to pass it a python dictionary:

sage: s=x^2+y^2+z^2+w^2+a+b+c+d
sage: s.subs({V2[i]:V2[7-i] for i in [0..3]})
a^2 + b^2 + c^2 + d^2 + a + b + c + d

If your system of linear equations is represented by a python list L then you can make your substitutions using

sage: D = {V2[i]:V2[7-i] for i in [0..3]}
sage: [s.subs(D) for s in L]