# From this collection, I want to find (if there is any) three matrices A,B,C satisfying A+B=C

 M = MatrixSpace(ZZ,2,2)
s=matrix([[1,0],[0,1]])
for A in M:
if A^3==s:
show(A)


From this collection, I want to find (if there is any) three matrices $A,B,C$ satisfying $A+B=C$. But I am not getting that..

edit retag close merge delete

Sort by ยป oldest newest most voted

First off, it's infeasible to perform the for A in M loop since M is an infinite set.

Instead you can employ the method of undetermined coefficients by assuming that the elements of your three matrices are variables satisfying the equations $A^3 = B^3 = C^3 = I_2$ and $A+B=C$. These equations translate into a system of polynomial equations w.r.t. the matrix elements, and Sage does provide a functionality for solving such system.

The following code show that the matrix in question do not exist even if we allow their elements be rational numbers:

K = PolynomialRing(QQ,12,'x')
x = K.gens()                                                           # variables over QQ
M = [Matrix(2,2,x[s:s+4]) for s in range(0,len(x),4)]  # three matrices formed by variables
pols = []
for A in M:
pols.extend( (A^3 - identity_matrix(2)).list() )    # equations from A^3 = I_2
pols.extend( (M[0]+M[1]-M[2]).list() )                     # equations from M[0] + M[1] = M[2]
J = K.ideal(pols)
print('Solutions:', J.variety())


It prints

 Solutions: []


meaning that the resulting system of polynomial equations has no solutions.

more

Thank you..

in place of s, if I put A, then what will be the resultant code? Now I want $A^3=A,B^3=B, C^3=C$ and $A^2+B^2=C^2$

( 2024-05-15 21:24:41 +0200 )edit

You can also use brute force and just list all of the solutions to $A^3=I$, if you're willing to work mod 3. Then since there are only 9 solutions, you can just try all triples to see if there is a solution to A+B=C, and there isn't.

( 2024-05-15 21:41:46 +0200 )edit

In the case of $A^3=A$, you will obviously get the solutions where $A=0$ and $B=C$.

( 2024-05-15 21:44:46 +0200 )edit

## Stats

Seen: 103 times

Last updated: May 15