Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

multivars eq ?

how do I get SageMath to give me both solutions?

# R.<theta_0,theta_1>=QQ[]
thetaVars=var('theta_0','theta_1')
aVars=var(['a_00', 'a_01', 'a_10', 'a_11'])
eqL=[]
eqL.append(3*theta_0^2 + 9*theta_0*theta_1 + 5*theta_1^2 == \
           a_00*theta_0^2 + a_01*theta_0*theta_1 + a_10*theta_0*theta_1 + a_11*theta_1^2)
eqL.append(-a_01*a_10 + a_00*a_11 == 1)

for eq in eqL :
    show(eq)
#how do I get SageMath to give me both solutions?    
# 2 solutions 
#s0=a_00==3,a_01==7,a_10==2,a_11==5
#s1=a_00==3,a_01==2,a_10==7,a_11==5