0
$\begingroup$

I want to find multiple nonzero real matrices A, B that satisfy $A.B=\mathbf{0}$ condition.

A = Array[a, {3, 3}];
B = Array[b, {3, 3}];
FindInstance[
 A.B == ConstantArray[0, {3, 3}] && A != ConstantArray[0, {3, 3}] && 
  B != ConstantArray[0, {3, 3}], Flatten[{A, B}], Reals,5]
{{A, B}} /. First[%]

However, the above code can not return the desired results for a long time. What can I do to quickly get multiple sets of matrices that meet the requirements (their elements are preferably rational numbers)?

$\endgroup$
1
  • 1
    $\begingroup$ Is there some reason to avoid using NullSpace? $\endgroup$ Commented Aug 19, 2020 at 15:39

1 Answer 1

2
$\begingroup$

With that many unknowns I am astonished that this completes in less than HUGE amounts of time.

{{{a,b,c},{d,e,f},{g,h,i}},{{j,k,l},{m,n,o},{p,q,r}}}/.
FindInstance[{{a,b,c},{d,e,f},{g,h,i}}.{{j,k,l},{m,n,o},{p,q,r}}==
{{0,0,0},{0,0,0},{0,0,0}}&&Element[a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r,Reals],
{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r},3]

All the results I've seen have rational or integer entries. It does seem to tend towards solutions with one or more zero rows. If a zero row is acceptable then replacing a,b,c with 0,0,0 seems to speed it up significantly. Eliminating the Element[,Reals] speeds it up even more, but that results in a lot of Complex values.

$\endgroup$

Your Answer

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

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