5
$\begingroup$

I have a matrix

M = {{-num11/(2*den), num12/den}, {num12/den, num22/(2*den)}};

with

den=4*x1^2*x7^2 + 8*I*x1*x2*x7^2 - 4*x2^2*x7^2 + (I*x5 + 4*I*x3*x7 - 4*x4*x7 + 2*x8 + 2*x9)*(I*x6 + 2*(x10 + x9));

    num11=16*x1^2*x7^2*(-2*x4*x7 + x8) + 8*x1*x2*x7^2*(x5 + 4*x3*x7 - 4*I*x4*x7 + 2*I*x8 - 2*I*x9) + 
   8*x2^2*x7^2*(I*(x5 + 4*x3*x7) + 2*x9) + ((-I)*x5 - 4*I*x3*x7 - 4*x4*x7 + 2*x8 - 2*x9)*
    (I*x5 + 4*I*x3*x7 - 4*x4*x7 + 2*x8 + 2*x9)*(I*x6 + 2*(x10 + x9));

    num12=(I*x1 + x2)*x7*(8*x1^2*x7^2 + 16*I*x1*x2*x7^2 - 8*x2^2*x7^2 + (I*x5 +    4*I*x3*x7 - 4*x4*x7 + 2*x8 + 2*x9)*
     (I*x6 + 2*(x10 + x9)));

    num22=-16*x1^2*x10*x7^2 - 8*I*x2^2*x7^2*(x6 - 2*I*x9) + (-4*x10^2 - (x6 - 2*I*x9)^2)*
    (I*x5 + 4*I*x3*x7 - 4*x4*x7 + 2*x8 + 2*x9) - 8*x1*x2*x7^2*(x6 - 2*I*(-x10 + x9));

I want to find (some) real values for $x_1, x_2, \dots, x_{10}$ such that $$ \det \rm M = 0,\quad \rm tr\, \rm M=0, $$ are simultaneously satisfied under the following constraints:

  • All variables $x_1, \dots, x_{10}$ are real.
  • $x_5, x_6, x_7, x_8, x_9, x_{10} > 0$ (strictly positive).
  • $x_1, x_2, x_3, x_4$ can be negative.
  • $x_1$ and $x_2$ cannot be simultaneously zero.
  • $x_3$ and $x_4$ cannot be simultaneously zero.

I tried working with the FindInstance but it doesn't seem to lead to what I'm looking for: Following the excellent answer by @azerbajdzan this question, I tried the following:

 det = Det[M] // Factor // Numerator // ReIm // ComplexExpand;
trace = Tr[M] // Factor // Numerator // ReIm // ComplexExpand;


Cases[{Thread[
      DeleteCases[{x1, x4, x5, x6, x7, x8, x9, x10}, 
        Alternatives @@ {x5, x8}] -> #], 
     Solve[det == 0 && trace == 0 /. 
       Join[{x2 -> 0, x3 -> 0}, 
        Thread[DeleteCases[{x1, x4, x5, x6, x7, x8, x9, x10}, 
           Alternatives @@ {x5, x8}] -> #]], PositiveRationals]} & /@ 
   Tuples[{1, 2, 3}, {6}], Except[{___, {}}]];

Sort /@ Join @@@ 
  Flatten[Tuples[{{#[[1]]}, #[[2]], {{x2 -> 0, x3 -> 0}}}] & /@ %, 1]

Unfortunately, it doesn't lead to any values. Is this approach fine or I am missing something?

$\endgroup$
4
  • $\begingroup$ I used PositiveRationals because I wanted the most simple solution but maybe with your additional equation no rational solution exists so use Reals or PositiveReals instead. Also since you have 4 equations instead of 2 you should use, say {x5, x8, x6, x10} instead of {x5, x8} and Tuples[{1, 2, 3}, {4}] instead of Tuples[{1, 2, 3}, {6}]. But still solution may not exist. $\endgroup$ Commented Dec 11, 2025 at 11:58
  • $\begingroup$ This way you may find for example: Join[det, trace] /. Thread[{x1, x2, x3, x4, x5, x6, x7, x8, x9, x10} -> {2, 2, -1, 2, 1/5 (12 - 2 Sqrt[31]), -8 + 2 Sqrt[31], 1, 2, 3, 2}] // RootReduce All positive except x3->-1 but this is allowed in your constraints. $\endgroup$ Commented Dec 11, 2025 at 12:04
  • 1
    $\begingroup$ You can safely ignore den because $\mathrm{det} M = \mathrm{Tr} M = 0$ is equivalent to $\mathrm{det} N = \mathrm{Tr} N = 0$. Here, $N = \mathrm{den}\, M$ and $\mathrm{den}\neq 0$. $\endgroup$ Commented Dec 11, 2025 at 12:47
  • 1
    $\begingroup$ Any matrix that satisfies your conditions must be of the form {{a*b, a^2}, {-b^2, -a*b}} or its negative. Maybe you can guess your result from this. $\endgroup$ Commented Dec 12, 2025 at 14:12

1 Answer 1

2
$\begingroup$

Modifying my previous code leads to this two solutions:

(Take definitions of det and trace from OP.)

Cases[{Thread[
      DeleteCases[{x1, x4, x5, x6, x7, x8, x9, x10}, 
        Alternatives @@ {x5, x8, x6, x10}] -> #], 
     Solve[Join[det, trace] == 0 /. 
       Join[{x2 -> 2, x3 -> -1}, 
        Thread[DeleteCases[{x1, x4, x5, x6, x7, x8, x9, x10}, 
           Alternatives @@ {x5, x8, x6, x10}] -> #]], 
      PositiveReals]} & /@ Tuples[{1, 2, 3}, {4}], Except[{___, {}}]];

Sort /@ Join @@@ 
  Flatten[Tuples[{{#[[1]]}, #[[2]], {{x2 -> 2, x3 -> -1}}}] & /@ %, 1]

Join[det, trace] /. % // RootReduce

enter image description here

Using {1, 2, 5} instead {1, 2, 3} leads to these three additional solutions:

enter image description here

$\endgroup$
3
  • $\begingroup$ Thanks @azerbajdzan, my system requirements force me to look for $x5=x6=x7=x8=1$ and your code--which is perfect to answer to my question--could not yield a solution with these conditions. This is not a complaint--but just a request if you could give it a try with these conditions and see if you find some solution. $\endgroup$ Commented Dec 12, 2025 at 11:58
  • $\begingroup$ @Rob Join[det,trace]/.Thread[{x1,x2,x3,x4,x5,x6,x7,x8,x9,x10}->{1/2+1/(2 Sqrt[2]),1/2,-1/2,1,1,1,1,1,1,1/Sqrt[2]}]//RootReduce $\endgroup$ Commented Dec 12, 2025 at 12:14
  • $\begingroup$ Hi @azerbajdzan. Could you update the answer to show how you obtained {1/2+1/(2 Sqrt[2]),1/2,-1/2,1,1,1,1,1,1,1/Sqrt[2]}. $\endgroup$ Commented Mar 10 at 10:48

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.