Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Change of variables in symbolic computation

I need to change Y into 1/2 *( y - a1 * x - a3) so that I can change variables in Elliptic curves.

var("X,Y,Z,x,y,a1,a2,a3,a4,a5,a6")
F = Y^2  *Z + a1 * X*Y *Z + a3 *Y *Z^2 - X^3 - a2 *X^2 * Z + a4*X*Z^ 2 + a6*Z^3
print(F)
F.substitute_expression(Y == 1/2 *( y - a1 * x - a3))  
print(F)

This produces an error on the 4th line;

AttributeError: 'sage.symbolic.expression.Expression' object has no attribute 'substitute_expression'

What is the proper way to change the variables?