0
$\begingroup$

I want to solve the problem of this post. After trying, I found a strange problem.

When I specify the solution field as a real field, the code runs all the time:

Q = {{x1, x2, 1/Sqrt[2]}, {x3, x4, 0}, {x5, x6, 1/Sqrt[2]}}; 
A = Array[x, {3, 3}]; 
FindInstance[
 Transpose[Q] . A . Q == {{1, 0, 0}, {0, 1, 0}, {0, 0, 0}} && 
     Transpose[Q] . Q == IdentityMatrix[3], 
 Join[{x1, x2, x3, x4, x5, x6}, 
     Flatten[A]], Reals]

When I remove the Reals option, I can get the results quickly, although the results are still real numbers:

Q = {{x1, x2, 1/Sqrt[2]}, {x3, x4, 0}, {x5, x6, 1/Sqrt[2]}}; 
A = Array[x, {3, 3}]; 
FindInstance[
 Transpose[Q] . A . Q == {{1, 0, 0}, {0, 1, 0}, {0, 0, 0}} && 
     Transpose[Q] . Q == IdentityMatrix[3], 
 Join[{x1, x2, x3, x4, x5, x6}, 
     Flatten[A]]]

(*{{x1 -> 0, x2 -> -(1/Sqrt[2]), x3 -> -1, x4 -> 0, x5 -> 0, 
     x6 -> 1/Sqrt[2], x[1, 1] -> 1/2, x[1, 2] -> 0, 
     x[1, 3] -> -(1/2), x[2, 1] -> 0, x[2, 2] -> 1, 
     x[2, 3] -> 0, x[3, 1] -> -(1/2), x[3, 2] -> 0, 
     x[3, 3] -> 1/2}}*)

I want to know why the Reals option seriously affects the speed of solution.

$\endgroup$
1
  • 2
    $\begingroup$ Different domains can imply different algorithms, extra checking....I don't know if anyone here has the knowledge of the internal algorithms to be more specific. $\endgroup$ – Michael E2 Aug 13 '20 at 22:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.