Given
A={{0,1,1,0},{1,0,0,-1},{-1,0,0,1},{0,1,1,0}}
and
B={{0,1,0,0},{0,0,0,0},{0,0,0,1},{0,0,0,0}}
and
A=C.B.C
, how to find C
?
Mathematica Stack Exchange is a question and answer site for users of Wolfram Mathematica. It only takes a minute to sign up.
Sign up to join this communityGiven
A={{0,1,1,0},{1,0,0,-1},{-1,0,0,1},{0,1,1,0}}
and
B={{0,1,0,0},{0,0,0,0},{0,0,0,1},{0,0,0,0}}
and
A=C.B.C
, how to find C
?
a = {{0, 1, 1, 0}, {1, 0, 0, -1}, {-1, 0, 0, 1}, {0, 1, 1, 0}};
b = {{0, 1, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 1}, {0, 0, 0, 0}};
c = Array[x, {4, 4}];
sol1 = FindInstance[a == c . b . c, Flatten[c], Reals, 1];
c /. sol1[[1]]
a == c . b . c /. sol1[[1]]
{{0, 99/5, -1, 12/5}, {1, 0, 0, -1}, {-1, -(28/5), 0, 79/ 5}, {0, -1, -1, 0}}
True
a = {{0, 1, 1, 0}, {1, 0, 0, -1}, {-1, 0, 0, 1}, {0, 1, 1, 0}}; b = {{0, 1, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 1}, {0, 0, 0, 0}}; c = Array[x, {4, 4}]; sol1 = Solve[a == c . b . c, Flatten[c]]; c /. sol1[[1]] /. {x[2, 3] -> x, x[1, 2] -> y, x[2, 1] -> z, x[1, 4] -> w, x[3, 2] -> t, x[3, 4] -> s}
$\endgroup$
Brute force?
A={{0,1,1,0},{1,0,0,-1},{-1,0,0,1},{0,1,1,0}};
B={{0,1,0,0},{0,0,0,0},{0,0,0,1},{0,0,0,0}};
cC={{a,b,c,d},{e,f,g,h},{i,j,k,l},{m,n,o,p}};
cC/.Solve[A==cC.B.cC,{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p}]
which returns a caution that this may not be all solutions, but gives seven solutions.
{{{(1-e^2)/g,b,-e,d},{e,g,g,-e},{-e,j,-g,l},{(1-e^2)/g,-e,-e,(-1+e^2)/g}},
{{m,b,1,d},{-1,0,0,1},{1,j,0,l},{m,1,1,-m}},
{{m,b,-1,d},{1,0,0,-1},{-1,j,0,l},{m,-1,-1,-m}},
{{0,b,-1,d},{-1,0,0,1},{1,j,0,l},{0,-1,-1,0}},
{{0,b,1,d},{-1,0,0,1},{1,j,0,l},{0,1,1,0}},
{{0,b,-1,d},{1,0,0,-1},{-1,j,0,l},{0,-1,-1,0}},
{{0,b,1,d},{1,0,0,-1},{-1,j,0,l},{0,1,1,0}}}
var -> expression
). The others are free variables that parametrize the solution space. (+1)
$\endgroup$
Jun 19, 2021 at 4:53