1
$\begingroup$

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?

$\endgroup$
3
  • $\begingroup$ There are over 1000 valid C even when restricted to [-1,1] integer domain for elements. What C are you after? $\endgroup$
    – ciao
    Jun 19, 2021 at 0:04
  • 1
    $\begingroup$ Related: math.stackexchange.com/questions/284890/… $\endgroup$
    – Michael E2
    Jun 19, 2021 at 0:29
  • $\begingroup$ All I need is that C should be invertible! $\endgroup$
    – Mike
    Jun 19, 2021 at 9:27

2 Answers 2

3
$\begingroup$
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

$\endgroup$
3
  • $\begingroup$ Thanks. Unfortunately this particular choice of C doesn't seem good for me. How can I obtain more such forms? $\endgroup$
    – Mike
    Jun 19, 2021 at 9:28
  • $\begingroup$ @Mike 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$
    – cvgmt
    Jun 19, 2021 at 10:17
  • $\begingroup$ Thanks....my question definitely deserves a like:-) $\endgroup$
    – Mike
    Jun 19, 2021 at 13:52
2
$\begingroup$

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}}}
$\endgroup$
1
  • $\begingroup$ The warning is that only some of the variable are solved for (that is, given rules var -> expression). The others are free variables that parametrize the solution space. (+1) $\endgroup$
    – Michael E2
    Jun 19, 2021 at 4:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.